From 3efa3198454acddeec1cf433ac4e1008833c0a01 Mon Sep 17 00:00:00 2001 From: xuke444 <40614413+xuke444@users.noreply.github.com> Date: Tue, 11 May 2021 18:26:04 -0700 Subject: [PATCH] add few react lint rule (#529) "react/no-multi-comp": only one component is allow in one file. "react/no-this-in-sfc": no "this" keyword is allowed in function component "react/no-unsafe": no unsafe react lifecycle function. "react/no-unused-prop-types": no unused props "react/no-unused-state": no unused stated "react/self-closing-comp": use self closing tag if no children exist. "react/sort-prop-types": sort props "react/state-in-constructor": state can only defined in constructor not private property. "react/jsx-boolean-value": omit "true" when pass boolean value to react element --- .eslintrc.json | 322 ++---------------- .../.eslintrc.comments.eslintrc | 0 .eslintrc/.eslintrc.custom.eslintrc | 288 ++++++++++++++++ .../.eslintrc.filenames.eslintrc | 0 .../.eslintrc.import.eslintrc | 0 .../.eslintrc.react.eslintrc | 9 + .../.eslintrc.typescript.eslintrc | 0 .../.eslintrc.unicorn.eslintrc | 0 apps/dashboard/src/app/App.tsx | 2 +- .../CausalInsightsTab.tsx | 4 +- .../CasualAggregateChart.tsx | 6 +- .../CasualAggregateView.tsx | 2 +- .../CasualIndividualChart.tsx | 39 +-- .../CasualIndividualView.tsx | 2 +- .../TreatmentView/TreatmentView.tsx | 6 +- .../CohortBaseAndFilters.tsx | 2 +- .../src/lib/Cohort/CohortBasedComponent.ts | 5 +- .../Cohort/CohortFilters/CohortFilters.tsx | 2 +- .../src/lib/Cohort/CohortInfo/CohortInfo.tsx | 8 +- .../src/lib/Cohort/CohortList/CohortList.tsx | 4 +- .../lib/Cohort/CohortStats/CohortStats.tsx | 2 +- .../src/lib/Cohort/EditCohort/EditCohort.tsx | 4 +- .../Cohort/PredictionPath/PredictionPath.tsx | 4 +- .../src/lib/Cohort/SaveCohort/SaveCohort.tsx | 4 +- .../lib/Cohort/ShiftCohort/ShiftCohort.tsx | 2 +- .../src/lib/components/AxisConfigDialog.tsx | 2 +- .../core-ui/src/lib/components/SVGToolTip.tsx | 2 +- .../src/lib/DatasetExplorerTab.tsx | 6 +- .../ErrorAnalysisViewTab.tsx | 6 +- .../Controls/FeatureList/FeatureList.tsx | 20 +- .../Controls/FilterTooltip/FilterTooltip.tsx | 4 +- .../Controls/InfoCallout/InfoCallout.tsx | 2 +- .../InspectionView/InspectionView.tsx | 6 +- .../Controls/MatrixArea/MatrixArea.tsx | 6 +- .../Controls/MatrixCells/MatrixCells.tsx | 2 +- .../Controls/MatrixFooter/MatrixFooter.tsx | 4 +- .../Controls/MatrixLegend/MatrixLegend.tsx | 12 +- .../Controls/Navigation/Navigation.tsx | 2 +- .../TabularDataView/TabularDataView.tsx | 4 +- .../Controls/TreeLegend/TreeLegend.tsx | 8 +- .../TreeViewRenderer/TreeViewNode.tsx | 3 - .../Controls/WhatIf/WhatIf.tsx | 4 +- .../ErrorAnalysisDashboard.tsx | 13 +- .../fairness/src/lib/Controls/EmptyHeader.tsx | 2 +- .../src/lib/Controls/FairnessPicker.tsx | 4 +- .../fairness/src/lib/Controls/FairnessTab.tsx | 2 +- libs/fairness/src/lib/Controls/FeatureTab.tsx | 6 +- libs/fairness/src/lib/Controls/ModalHelp.tsx | 2 +- .../src/lib/Controls/ModelComparisonChart.tsx | 6 +- .../fairness/src/lib/Controls/OutcomePlot.tsx | 2 +- .../src/lib/Controls/PerformancePicker.tsx | 4 +- .../src/lib/Controls/PerformancePlot.tsx | 56 +-- .../lib/Controls/PerformancePlotLegend.tsx | 62 ++++ .../Controls/Callout/LabelWithCallout.tsx | 4 +- .../Controls/Cohort/CohortBar.tsx | 4 +- .../Controls/Cohort/CohortEditor.tsx | 2 +- .../Controls/Cohort/CohortEditorFilter.tsx | 4 +- .../DependencePlot/DependencePlot.tsx | 2 +- .../MLIDashboard/Controls/EbmExplanation.tsx | 2 +- .../Controls/FeatureImportance/Beehive.tsx | 10 +- .../FeatureImportanceBar.tsx | 8 +- .../Controls/FeatureImportance/Violin.tsx | 10 +- .../GlobalExplanationTab.tsx | 19 -- .../GlobalExplanationTab/SidePanel.tsx | 2 - .../GlobalOnlyChart/GlobalOnlyChart.tsx | 3 - .../src/lib/MLIDashboard/Controls/ICEPlot.tsx | 4 +- .../ModelPerformanceTab.tsx | 2 +- .../Controls/MultiICEPlot/MultiICEPlot.tsx | 2 +- .../Controls/Scatter/DataExploration.tsx | 7 +- .../Scatter/ExplanationExploration.tsx | 10 +- .../Controls/SinglePointFeatureImportance.tsx | 4 +- .../WhatIfTab/CustomPredictionLabels.tsx | 6 +- .../WhatIfTab/ExistingPredictionLabels.tsx | 2 +- .../WhatIfTab/LocalImportancePlots.tsx | 12 +- .../Controls/WhatIfTab/WhatIfPanel.tsx | 2 +- .../Controls/WhatIfTab/WhatIfTab.tsx | 14 +- .../lib/MLIDashboard/ExplanationDashboard.tsx | 4 +- .../MLIDashboard/NewExplanationDashboard.tsx | 6 +- .../SharedComponents/BinningControl.tsx | 4 +- .../SharedComponents/FeatureEditingTile.tsx | 2 +- 80 files changed, 530 insertions(+), 590 deletions(-) rename .eslintrc.comments.eslintrc => .eslintrc/.eslintrc.comments.eslintrc (100%) create mode 100644 .eslintrc/.eslintrc.custom.eslintrc rename .eslintrc.filenames.eslintrc => .eslintrc/.eslintrc.filenames.eslintrc (100%) rename .eslintrc.import.eslintrc => .eslintrc/.eslintrc.import.eslintrc (100%) rename .eslintrc.react.eslintrc => .eslintrc/.eslintrc.react.eslintrc (85%) rename .eslintrc.typescript.eslintrc => .eslintrc/.eslintrc.typescript.eslintrc (100%) rename .eslintrc.unicorn.eslintrc => .eslintrc/.eslintrc.unicorn.eslintrc (100%) create mode 100644 libs/fairness/src/lib/Controls/PerformancePlotLegend.tsx diff --git a/.eslintrc.json b/.eslintrc.json index c9c3bade7..f54022178 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,305 +5,25 @@ "globals": { "JSX": "readonly" }, - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "extends": [ - "plugin:@nrwl/nx/typescript", - "plugin:@nrwl/nx/javascript", - "./.eslintrc.comments.eslintrc", - "./.eslintrc.filenames.eslintrc", - "./.eslintrc.react.eslintrc", - "./.eslintrc.import.eslintrc", - "./.eslintrc.typescript.eslintrc", - "./.eslintrc.unicorn.eslintrc" - ], - "env": { - "browser": true, - "commonjs": true, - "es6": true, - "jest": true, - "node": true - }, - "parserOptions": { - "project": "./tsconfig.*?.json" - }, - "plugins": ["header", "sort-keys-fix"], - "rules": { - "sort-keys-fix/sort-keys-fix": [ - "error", - "asc", - { - "caseSensitive": false, - "natural": true - } - ], - "header/header": [ - "error", - "line", - [ - " Copyright (c) Microsoft Corporation.", - " Licensed under the MIT License." - ], - 2 - ], - "camelcase": [ - "error", - { - "allow": [ - "accuracy_score", - "accuracy_score_difference", - "accuracy_score_min", - "accuracy_score_ratio", - "balanced_accuracy_score", - "balanced_accuracy_score_min", - "balanced_root_mean_squared_error", - "demographic_parity_difference", - "demographic_parity_ratio", - "equalized_odds_difference", - "equalized_odds_ratio", - "error_rate_difference", - "error_rate_ratio", - "error_y", - "f1_score", - "f1_score_min", - "fallout_rate", - "false_negative_rate", - "false_negative_rate_difference", - "false_negative_rate_ratio", - "false_positive_rate", - "false_positive_rate_difference", - "false_positive_rate_ratio", - "feature_list", - "log_loss", - "lower_bounds", - "max_error", - "mean_absolute_error", - "mean_absolute_error_min", - "mean_squared_error", - "mean_squared_error_min", - "mean_squared_log_error", - "median_absolute_error", - "miss_rate", - "plot_bgcolor", - "precision_score", - "r2_score", - "r2_score_min", - "recall_score", - "recall_score_min", - "rms_error", - "roc_auc_score_min", - "root_mean_squared_error", - "scores_range", - "selection_rate", - "shap_deep", - "shap_kernel", - "shap_tree", - "specificity_score", - "true_negative_rate_difference", - "true_negative_rate_ratio", - "true_positive_rate_difference", - "true_positive_rate_ratio", - "upper_bounds", - "zero_one_loss" - ] - } - ], - "complexity": "warn", - "curly": ["error", "all"], - "max-lines": "warn", - "no-else-return": "error", - "no-useless-call": "error", - "object-shorthand": "error", - "no-lonely-if": "error", - "no-extra-semi": "error", - "quotes": [ - "error", - "double", - { - "avoidEscape": true - } - ], - "no-duplicate-imports": "error", - "array-callback-return": "error", - "dot-location": ["error", "property"], - "eqeqeq": ["error", "smart"], - "new-parens": "error", - "no-caller": "error", - "no-cond-assign": ["error", "except-parens"], - "no-const-assign": "error", - "no-control-regex": "error", - "no-delete-var": "error", - "no-dupe-args": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-empty-character-class": "error", - "no-empty-pattern": "error", - "no-eval": "error", - "no-ex-assign": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-fallthrough": "error", - "no-func-assign": "error", - "no-implied-eval": "error", - "no-invalid-regexp": "error", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": [ - "error", - { - "allowLoop": true, - "allowSwitch": false - } - ], - "no-lone-blocks": "error", - "no-loop-func": "error", - "no-mixed-operators": [ - "error", - { - "groups": [ - ["&", "|", "^", "~", "<<", ">>", ">>>"], - ["==", "!=", "===", "!==", ">", ">=", "<", "<="], - ["&&", "||"], - ["in", "instanceof"] - ], - "allowSamePrecedence": false - } - ], - "no-multi-str": "error", - "no-native-reassign": "error", - "no-negated-in-lhs": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-symbol": "error", - "no-new-wrappers": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-octal-escape": "error", - "no-redeclare": "error", - "no-regex-spaces": "error", - "no-restricted-syntax": ["error", "WithStatement"], - "no-script-url": "error", - "no-self-assign": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-template-curly-in-string": "error", - "no-this-before-super": "error", - "no-throw-literal": "error", - "no-restricted-globals": [ - "error", - "addEventListener", - "blur", - "close", - "closed", - "confirm", - "defaultStatus", - "defaultstatus", - "event", - "external", - "find", - "focus", - "frameElement", - "frames", - "history", - "innerHeight", - "innerWidth", - "length", - "location", - "locationbar", - "menubar", - "moveBy", - "moveTo", - "name", - "onblur", - "onerror", - "onfocus", - "onload", - "onresize", - "onunload", - "open", - "opener", - "opera", - "outerHeight", - "outerWidth", - "pageXOffset", - "pageYOffset", - "parent", - "print", - "removeEventListener", - "resizeBy", - "resizeTo", - "screen", - "screenLeft", - "screenTop", - "screenX", - "screenY", - "scroll", - "scrollbars", - "scrollBy", - "scrollTo", - "scrollX", - "scrollY", - "self", - "status", - "statusbar", - "stop", - "toolbar", - "top" - ], - "no-unexpected-multiline": "error", - "no-unreachable": "error", - "no-unused-expressions": [ - "error", - { - "allowShortCircuit": true, - "allowTernary": true, - "allowTaggedTemplates": true - } - ], - "no-unused-labels": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "error", - "no-useless-escape": "error", - "no-useless-rename": [ - "error", - { - "ignoreDestructuring": false, - "ignoreImport": false, - "ignoreExport": false - } - ], - "no-with": "error", - "no-whitespace-before-property": "error", - "require-yield": "error", - "rest-spread-spacing": ["error", "never"], - "strict": ["error", "never"], - "unicode-bom": ["error", "never"], - "use-isnan": "error", - "valid-typeof": "error", - "no-restricted-properties": [ - "error", - { - "object": "require", - "property": "ensure", - "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" - }, - { - "object": "System", - "property": "import", - "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" - } - ], - "getter-return": "error", - "default-case": "error", - "no-undef": "error", - "no-array-constructor": "error", - "no-unused-vars": "error", - "no-useless-constructor": "error" - } - } - ] + "extends": [ + "plugin:@nrwl/nx/typescript", + "plugin:@nrwl/nx/javascript", + "./.eslintrc/.eslintrc.comments.eslintrc", + "./.eslintrc/.eslintrc.filenames.eslintrc", + "./.eslintrc/.eslintrc.react.eslintrc", + "./.eslintrc/.eslintrc.import.eslintrc", + "./.eslintrc/.eslintrc.typescript.eslintrc", + "./.eslintrc/.eslintrc.unicorn.eslintrc", + "./.eslintrc/.eslintrc.custom.eslintrc" + ], + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "jest": true, + "node": true + }, + "parserOptions": { + "project": "./tsconfig.*?.json" + } } diff --git a/.eslintrc.comments.eslintrc b/.eslintrc/.eslintrc.comments.eslintrc similarity index 100% rename from .eslintrc.comments.eslintrc rename to .eslintrc/.eslintrc.comments.eslintrc diff --git a/.eslintrc/.eslintrc.custom.eslintrc b/.eslintrc/.eslintrc.custom.eslintrc new file mode 100644 index 000000000..47f3945f9 --- /dev/null +++ b/.eslintrc/.eslintrc.custom.eslintrc @@ -0,0 +1,288 @@ +{ + "extends": [ + "plugin:@nrwl/nx/typescript", + "plugin:@nrwl/nx/javascript", + "./.eslintrc.comments.eslintrc", + "./.eslintrc.filenames.eslintrc", + "./.eslintrc.react.eslintrc", + "./.eslintrc.import.eslintrc", + "./.eslintrc.typescript.eslintrc", + "./.eslintrc.unicorn.eslintrc" + ], + "plugins": ["header", "sort-keys-fix"], + "rules": { + "sort-keys-fix/sort-keys-fix": [ + "error", + "asc", + { + "caseSensitive": false, + "natural": true + } + ], + "header/header": [ + "error", + "line", + [ + " Copyright (c) Microsoft Corporation.", + " Licensed under the MIT License." + ], + 2 + ], + "camelcase": [ + "error", + { + "allow": [ + "accuracy_score", + "accuracy_score_difference", + "accuracy_score_min", + "accuracy_score_ratio", + "balanced_accuracy_score", + "balanced_accuracy_score_min", + "balanced_root_mean_squared_error", + "demographic_parity_difference", + "demographic_parity_ratio", + "equalized_odds_difference", + "equalized_odds_ratio", + "error_rate_difference", + "error_rate_ratio", + "error_y", + "f1_score", + "f1_score_min", + "fallout_rate", + "false_negative_rate", + "false_negative_rate_difference", + "false_negative_rate_ratio", + "false_positive_rate", + "false_positive_rate_difference", + "false_positive_rate_ratio", + "feature_list", + "log_loss", + "lower_bounds", + "max_error", + "mean_absolute_error", + "mean_absolute_error_min", + "mean_squared_error", + "mean_squared_error_min", + "mean_squared_log_error", + "median_absolute_error", + "miss_rate", + "plot_bgcolor", + "precision_score", + "r2_score", + "r2_score_min", + "recall_score", + "recall_score_min", + "rms_error", + "roc_auc_score_min", + "root_mean_squared_error", + "scores_range", + "selection_rate", + "shap_deep", + "shap_kernel", + "shap_tree", + "specificity_score", + "true_negative_rate_difference", + "true_negative_rate_ratio", + "true_positive_rate_difference", + "true_positive_rate_ratio", + "upper_bounds", + "zero_one_loss" + ] + } + ], + "complexity": "warn", + "curly": ["error", "all"], + "max-lines": "warn", + "no-else-return": "error", + "no-useless-call": "error", + "object-shorthand": "error", + "no-lonely-if": "error", + "no-extra-semi": "error", + "quotes": [ + "error", + "double", + { + "avoidEscape": true + } + ], + "no-duplicate-imports": "error", + "array-callback-return": "error", + "dot-location": ["error", "property"], + "eqeqeq": ["error", "smart"], + "new-parens": "error", + "no-caller": "error", + "no-cond-assign": ["error", "except-parens"], + "no-const-assign": "error", + "no-control-regex": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-implied-eval": "error", + "no-invalid-regexp": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": [ + "error", + { + "allowLoop": true, + "allowSwitch": false + } + ], + "no-lone-blocks": "error", + "no-loop-func": "error", + "no-mixed-operators": [ + "error", + { + "groups": [ + ["&", "|", "^", "~", "<<", ">>", ">>>"], + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": false + } + ], + "no-multi-str": "error", + "no-native-reassign": "error", + "no-negated-in-lhs": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-restricted-syntax": ["error", "WithStatement"], + "no-script-url": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-template-curly-in-string": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-restricted-globals": [ + "error", + "addEventListener", + "blur", + "close", + "closed", + "confirm", + "defaultStatus", + "defaultstatus", + "event", + "external", + "find", + "focus", + "frameElement", + "frames", + "history", + "innerHeight", + "innerWidth", + "length", + "location", + "locationbar", + "menubar", + "moveBy", + "moveTo", + "name", + "onblur", + "onerror", + "onfocus", + "onload", + "onresize", + "onunload", + "open", + "opener", + "opera", + "outerHeight", + "outerWidth", + "pageXOffset", + "pageYOffset", + "parent", + "print", + "removeEventListener", + "resizeBy", + "resizeTo", + "screen", + "screenLeft", + "screenTop", + "screenX", + "screenY", + "scroll", + "scrollbars", + "scrollBy", + "scrollTo", + "scrollX", + "scrollY", + "self", + "status", + "statusbar", + "stop", + "toolbar", + "top" + ], + "no-unexpected-multiline": "error", + "no-unreachable": "error", + "no-unused-expressions": [ + "error", + { + "allowShortCircuit": true, + "allowTernary": true, + "allowTaggedTemplates": true + } + ], + "no-unused-labels": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-escape": "error", + "no-useless-rename": [ + "error", + { + "ignoreDestructuring": false, + "ignoreImport": false, + "ignoreExport": false + } + ], + "no-with": "error", + "no-whitespace-before-property": "error", + "require-yield": "error", + "rest-spread-spacing": ["error", "never"], + "strict": ["error", "never"], + "unicode-bom": ["error", "never"], + "use-isnan": "error", + "valid-typeof": "error", + "no-restricted-properties": [ + "error", + { + "object": "require", + "property": "ensure", + "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" + }, + { + "object": "System", + "property": "import", + "message": "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting" + } + ], + "getter-return": "error", + "default-case": "error", + "no-undef": "error", + "no-array-constructor": "error", + "no-unused-vars": "error", + "no-useless-constructor": "error" + } +} diff --git a/.eslintrc.filenames.eslintrc b/.eslintrc/.eslintrc.filenames.eslintrc similarity index 100% rename from .eslintrc.filenames.eslintrc rename to .eslintrc/.eslintrc.filenames.eslintrc diff --git a/.eslintrc.import.eslintrc b/.eslintrc/.eslintrc.import.eslintrc similarity index 100% rename from .eslintrc.import.eslintrc rename to .eslintrc/.eslintrc.import.eslintrc diff --git a/.eslintrc.react.eslintrc b/.eslintrc/.eslintrc.react.eslintrc similarity index 85% rename from .eslintrc.react.eslintrc rename to .eslintrc/.eslintrc.react.eslintrc index 74aa7d885..f7c63bc60 100644 --- a/.eslintrc.react.eslintrc +++ b/.eslintrc/.eslintrc.react.eslintrc @@ -11,6 +11,15 @@ "plugin:react-hooks/recommended" ], "rules": { + "react/no-multi-comp": "error", + "react/no-this-in-sfc": "error", + "react/no-unsafe": "error", + "react/no-unused-prop-types": "error", + "react/no-unused-state": "error", + "react/self-closing-comp": "error", + "react/sort-prop-types": "error", + "react/state-in-constructor": "error", + "react/jsx-boolean-value": "error", "react/forbid-foreign-prop-types": [ "error", { diff --git a/.eslintrc.typescript.eslintrc b/.eslintrc/.eslintrc.typescript.eslintrc similarity index 100% rename from .eslintrc.typescript.eslintrc rename to .eslintrc/.eslintrc.typescript.eslintrc diff --git a/.eslintrc.unicorn.eslintrc b/.eslintrc/.eslintrc.unicorn.eslintrc similarity index 100% rename from .eslintrc.unicorn.eslintrc rename to .eslintrc/.eslintrc.unicorn.eslintrc diff --git a/apps/dashboard/src/app/App.tsx b/apps/dashboard/src/app/App.tsx index 045450667..7873a3b1a 100644 --- a/apps/dashboard/src/app/App.tsx +++ b/apps/dashboard/src/app/App.tsx @@ -140,7 +140,7 @@ export class App extends React.Component { /> )} - + ); } diff --git a/libs/causality/src/lib/CasualAnalysisDashboard/CausalInsightsTab.tsx b/libs/causality/src/lib/CasualAnalysisDashboard/CausalInsightsTab.tsx index da70d7fcd..11ce6cea5 100644 --- a/libs/causality/src/lib/CasualAnalysisDashboard/CausalInsightsTab.tsx +++ b/libs/causality/src/lib/CasualAnalysisDashboard/CausalInsightsTab.tsx @@ -36,13 +36,13 @@ export class CausalInsightsTab extends React.PureComponent< public render(): React.ReactNode { return ( - + {localization.CasualAnalysis.MainMenu.header} - + - + + - + {localization.CasualAnalysis.AggregateView.continuous} diff --git a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualAggregateView/CasualAggregateView.tsx b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualAggregateView/CasualAggregateView.tsx index c1c133ade..80c19243e 100644 --- a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualAggregateView/CasualAggregateView.tsx +++ b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualAggregateView/CasualAggregateView.tsx @@ -31,7 +31,7 @@ export class CasualAggregateView extends React.PureComponent< public render(): React.ReactNode { const styles = CasualAggregateStyles(); return ( - + {localization.CasualAnalysis.AggregateView.description} diff --git a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualChart.tsx b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualChart.tsx index 5fa91a93a..26eb61eb8 100644 --- a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualChart.tsx +++ b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualChart.tsx @@ -28,7 +28,6 @@ import { getTheme, Text, DefaultButton, - IDropdownOption, ComboBox, Stack } from "office-ui-fabric-react"; @@ -46,13 +45,10 @@ export interface ICasualIndividualChartState { chartProps?: IGenericChartProps; xDialogOpen: boolean; yDialogOpen: boolean; - selectedWhatIfRootIndex: number; selectedCohortIndex: number; - featuresOption: IDropdownOption[]; selectedPointsIndexes: number[]; pointIsActive: boolean[]; customPointIsActive: boolean[]; - selectedFeatureKey: string; } export class CasualIndividualChart extends React.PureComponent< @@ -76,43 +72,17 @@ export class CasualIndividualChart extends React.PureComponent< this.state = { customPointIsActive: [], - featuresOption: [], pointIsActive: [], selectedCohortIndex: 0, - selectedFeatureKey: JointDataset.DataLabelRoot + "0", selectedPointsIndexes: [], - selectedWhatIfRootIndex: 0, xDialogOpen: false, yDialogOpen: false }; } public componentDidMount(): void { - const featuresOption = new Array( - this.context.jointDataset.datasetFeatureCount - ) - .fill(0) - .map((_, index) => { - const key = JointDataset.DataLabelRoot + index.toString(); - const meta = this.context.jointDataset.metaDict[key]; - const options = meta.isCategorical - ? meta.sortedCategoricalValues?.map((optionText, index) => { - return { key: index, text: optionText }; - }) - : undefined; - return { - data: { - categoricalOptions: options, - fullLabel: meta.label.toLowerCase() - }, - key, - text: meta.abbridgedLabel - }; - }); - this.setState({ - chartProps: this.generateDefaultChartAxes(), - featuresOption + chartProps: this.generateDefaultChartAxes() }); } @@ -264,7 +234,7 @@ export class CasualIndividualChart extends React.PureComponent< )}
-
+
@@ -347,9 +317,6 @@ export class CasualIndividualChart extends React.PureComponent< this.stringifiedValues[key] = this.temporaryPoint?.[key].toString(); this.validationErrors[key] = undefined; }); - this.setState({ - selectedWhatIfRootIndex: index - }); } private onXSet = (value: ISelectorConfig): void => { diff --git a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualView.tsx b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualView.tsx index dad167808..a69227264 100644 --- a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualView.tsx +++ b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/CasualIndividualView/CasualIndividualView.tsx @@ -44,7 +44,7 @@ export class CasualIndividualView extends React.PureComponent< public render(): React.ReactNode { const styles = CasualIndividualStyles(); return ( - + {localization.CasualAnalysis.IndividualView.description} diff --git a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/TreatmentView/TreatmentView.tsx b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/TreatmentView/TreatmentView.tsx index 65717a062..b51dc8e31 100644 --- a/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/TreatmentView/TreatmentView.tsx +++ b/libs/causality/src/lib/CasualAnalysisDashboard/Controls/CasualAnalysisView/TreatmentView/TreatmentView.tsx @@ -31,6 +31,10 @@ export class TreatmentView extends React.PureComponent< } public render(): React.ReactNode { - return
Treatment View
; + return this.state.showModalHelp ? ( +
Treatment View
+ ) : ( +
Treatment View
+ ); } } diff --git a/libs/core-ui/src/lib/Cohort/CohortBaseAndFilters/CohortBaseAndFilters.tsx b/libs/core-ui/src/lib/Cohort/CohortBaseAndFilters/CohortBaseAndFilters.tsx index 29da160ee..38b5fbf08 100644 --- a/libs/core-ui/src/lib/Cohort/CohortBaseAndFilters/CohortBaseAndFilters.tsx +++ b/libs/core-ui/src/lib/Cohort/CohortBaseAndFilters/CohortBaseAndFilters.tsx @@ -32,7 +32,7 @@ export class CohortBaseAndFilters extends React.Component< const filters = this.props.cohort.filtersToString().join(", "); return (
-
+
Base cohort and filters
diff --git a/libs/core-ui/src/lib/Cohort/CohortBasedComponent.ts b/libs/core-ui/src/lib/Cohort/CohortBasedComponent.ts index 8f4b7cb82..fb842c02b 100644 --- a/libs/core-ui/src/lib/Cohort/CohortBasedComponent.ts +++ b/libs/core-ui/src/lib/Cohort/CohortBasedComponent.ts @@ -26,7 +26,10 @@ export abstract class CohortBasedComponent< TProps extends ICohortBasedComponentProps, TState extends ICohortBasedComponentState > extends React.PureComponent { - public updateSelectedCohort = ( + protected getSelectedCohort = (): ErrorCohort => { + return this.state.selectedCohort; + }; + protected updateSelectedCohort = ( filters: IFilter[], compositeFilters: ICompositeFilter[], source: CohortSource = CohortSource.None, diff --git a/libs/core-ui/src/lib/Cohort/CohortFilters/CohortFilters.tsx b/libs/core-ui/src/lib/Cohort/CohortFilters/CohortFilters.tsx index 8a6b1f059..1499453c0 100644 --- a/libs/core-ui/src/lib/Cohort/CohortFilters/CohortFilters.tsx +++ b/libs/core-ui/src/lib/Cohort/CohortFilters/CohortFilters.tsx @@ -29,7 +29,7 @@ export class CohortFilters extends React.Component { const filters = this.props.cohort.filtersToString().join(", "); return (
-
+
Filters
diff --git a/libs/core-ui/src/lib/Cohort/CohortInfo/CohortInfo.tsx b/libs/core-ui/src/lib/Cohort/CohortInfo/CohortInfo.tsx index bff3a4be2..32cac8197 100644 --- a/libs/core-ui/src/lib/Cohort/CohortInfo/CohortInfo.tsx +++ b/libs/core-ui/src/lib/Cohort/CohortInfo/CohortInfo.tsx @@ -57,7 +57,7 @@ export class CohortInfo extends React.PureComponent { onDismiss={this.props.onDismiss} styles={panelStyles} > -
+
{ onClick={(): any => this.props.onSaveCohortClick()} />
-
+
Basic Information
{this.props.currentCohort.cohort.name !== "All data" && ( @@ -77,7 +77,7 @@ export class CohortInfo extends React.PureComponent {
-
+
Instances in base cohort
@@ -128,7 +128,7 @@ export class CohortInfo extends React.PureComponent {
-
+
Prediction path (filters)
diff --git a/libs/core-ui/src/lib/Cohort/CohortList/CohortList.tsx b/libs/core-ui/src/lib/Cohort/CohortList/CohortList.tsx index 624412151..1ab6f33b3 100644 --- a/libs/core-ui/src/lib/Cohort/CohortList/CohortList.tsx +++ b/libs/core-ui/src/lib/Cohort/CohortList/CohortList.tsx @@ -108,7 +108,7 @@ export class CohortList extends React.Component< onDismiss={this.props.onDismiss} styles={panelStyles} > -
+
Cohort List
@@ -117,7 +117,7 @@ export class CohortList extends React.Component< columns={this.columns} setKey="set" layoutMode={DetailsListLayoutMode.justified} - selectionPreservedOnEmptyClick={true} + selectionPreservedOnEmptyClick checkboxVisibility={CheckboxVisibility.hidden} onRenderItemColumn={this.renderItemColumn.bind(this)} /> diff --git a/libs/core-ui/src/lib/Cohort/CohortStats/CohortStats.tsx b/libs/core-ui/src/lib/Cohort/CohortStats/CohortStats.tsx index 6674290b9..17365e05b 100644 --- a/libs/core-ui/src/lib/Cohort/CohortStats/CohortStats.tsx +++ b/libs/core-ui/src/lib/Cohort/CohortStats/CohortStats.tsx @@ -23,7 +23,7 @@ export class CohortStats extends React.Component { const classNames = cohortStatsStyles(); return (
-
+
{localization.ErrorAnalysis.cohortInfo} diff --git a/libs/core-ui/src/lib/Cohort/EditCohort/EditCohort.tsx b/libs/core-ui/src/lib/Cohort/EditCohort/EditCohort.tsx index 0e9ec1268..072ef58db 100644 --- a/libs/core-ui/src/lib/Cohort/EditCohort/EditCohort.tsx +++ b/libs/core-ui/src/lib/Cohort/EditCohort/EditCohort.tsx @@ -95,8 +95,8 @@ export class EditCohort extends React.Component< defaultValue={this.state.cohortName} styles={textFieldStyles} /> - - + + {
- +
{filter}
{index !== filters.length - 1 && ( -
+
)}
))} diff --git a/libs/core-ui/src/lib/Cohort/SaveCohort/SaveCohort.tsx b/libs/core-ui/src/lib/Cohort/SaveCohort/SaveCohort.tsx index 1ee81e910..819c66bcd 100644 --- a/libs/core-ui/src/lib/Cohort/SaveCohort/SaveCohort.tsx +++ b/libs/core-ui/src/lib/Cohort/SaveCohort/SaveCohort.tsx @@ -90,11 +90,11 @@ export class SaveCohort extends React.Component< defaultValue={allDataCopy} styles={textFieldStyles} /> - + + /> { diff --git a/libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx b/libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx index f2020b9e5..6a6ba025b 100644 --- a/libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx +++ b/libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx @@ -108,7 +108,7 @@ export class ShiftCohort extends React.Component< /> + /> diff --git a/libs/core-ui/src/lib/components/AxisConfigDialog.tsx b/libs/core-ui/src/lib/components/AxisConfigDialog.tsx index a75d6a0d0..a20fb6422 100644 --- a/libs/core-ui/src/lib/components/AxisConfigDialog.tsx +++ b/libs/core-ui/src/lib/components/AxisConfigDialog.tsx @@ -150,7 +150,7 @@ export class AxisConfigDialog extends React.PureComponent< + /> {this.props.children} , this.state.svgElement diff --git a/libs/dataset-explorer/src/lib/DatasetExplorerTab.tsx b/libs/dataset-explorer/src/lib/DatasetExplorerTab.tsx index c35c93a88..05a4e0cfe 100644 --- a/libs/dataset-explorer/src/lib/DatasetExplorerTab.tsx +++ b/libs/dataset-explorer/src/lib/DatasetExplorerTab.tsx @@ -41,7 +41,6 @@ export interface IDatasetExplorerTabState { yDialogOpen: boolean; colorDialogOpen: boolean; selectedCohortIndex: number; - calloutVisible: boolean; chartProps?: IGenericChartProps; } @@ -60,7 +59,6 @@ export class DatasetExplorerTab extends React.PureComponent< super(props); this.state = { - calloutVisible: false, colorDialogOpen: false, selectedCohortIndex: 0, xDialogOpen: false, @@ -206,7 +204,7 @@ export class DatasetExplorerTab extends React.PureComponent< ColumnCategories.Outcome ]} selectedColumn={this.state.chartProps.colorAxis} - canBin={true} + canBin mustBin={false} canDither={false} onAccept={this.onColorSet} @@ -242,7 +240,7 @@ export class DatasetExplorerTab extends React.PureComponent< )}
-
+
+ {localization.ErrorAnalysis.MainMenu.errorAnalysisLabel} - + diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FeatureList/FeatureList.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FeatureList/FeatureList.tsx index efba1513c..a20b69f8f 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FeatureList/FeatureList.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FeatureList/FeatureList.tsx @@ -69,8 +69,6 @@ const checkboxStackTokens: IStackTokens = { export interface IFeatureListState { searchedFeatures: string[]; selectedFeatures: string[]; - percents: number[]; - sortedFeatures: string[]; enableApplyButton: boolean; lastAppliedFeatures: Set; tableState: ITableState; @@ -103,10 +101,8 @@ export class FeatureList extends React.Component< this.state = { enableApplyButton: false, lastAppliedFeatures: new Set(this.props.features), - percents: sortedPercents, searchedFeatures, selectedFeatures: this.props.selectedFeatures, - sortedFeatures, tableState }; this.layerHostId = getId("featuresListHost"); @@ -145,9 +141,7 @@ export class FeatureList extends React.Component< this.props.isEnabled ); this.setState({ - percents: sortedPercents, searchedFeatures, - sortedFeatures, tableState }); this.updateSelection(); @@ -211,7 +205,7 @@ export class FeatureList extends React.Component< this, theme )} - selectionPreservedOnEmptyClick={true} + selectionPreservedOnEmptyClick ariaLabelForSelectionColumn="Toggle selection" ariaLabelForSelectAllCheckbox="Toggle selection for all items" checkButtonAriaLabel="Row checkbox" @@ -254,7 +248,7 @@ export class FeatureList extends React.Component< props?: IDetailsRowProps ): JSX.Element | null => { if (!props) { - return
; + return
; } return ( @@ -266,7 +260,7 @@ export class FeatureList extends React.Component< return ; } return ( - + ); @@ -284,7 +278,7 @@ export class FeatureList extends React.Component< switch (column.key) { case "checkbox": if (this.state.selectedFeatures.includes(fieldContent)) { - return ; + return ; } return ; case "importances": @@ -296,13 +290,13 @@ export class FeatureList extends React.Component< width="100%" height="4" rx="5" - > + /> + /> ); @@ -311,7 +305,7 @@ export class FeatureList extends React.Component< return {fieldContent}; } } - return ; + return ; } private updateSelection(): void { diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FilterTooltip/FilterTooltip.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FilterTooltip/FilterTooltip.tsx index f1f5c9984..e89b87b1f 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FilterTooltip/FilterTooltip.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/FilterTooltip/FilterTooltip.tsx @@ -39,7 +39,7 @@ export class FilterTooltip extends React.Component { - + {localization.ErrorAnalysis.errorCoverage} @@ -50,7 +50,7 @@ export class FilterTooltip extends React.Component { - + {localization.ErrorAnalysis.errorRate} diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InfoCallout/InfoCallout.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InfoCallout/InfoCallout.tsx index b4723dcdd..0a580320e 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InfoCallout/InfoCallout.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InfoCallout/InfoCallout.tsx @@ -47,7 +47,7 @@ export class InfoCallout extends React.Component< {this.state.isCalloutVisible && ( diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InspectionView/InspectionView.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InspectionView/InspectionView.tsx index 33b741215..2ec76de95 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InspectionView/InspectionView.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/InspectionView/InspectionView.tsx @@ -186,7 +186,7 @@ export class InspectionView extends React.PureComponent< setKey="set" layoutMode={DetailsListLayoutMode.justified} onRenderItemColumn={this.renderItemColumn.bind(this)} - selectionPreservedOnEmptyClick={true} + selectionPreservedOnEmptyClick ariaLabelForSelectionColumn="Toggle selection" ariaLabelForSelectAllCheckbox="Toggle selection for all items" checkButtonAriaLabel="Row checkbox" @@ -245,14 +245,14 @@ export class InspectionView extends React.PureComponent< height: "100%", width: "20px" })} - >
+ /> ); default: return {fieldContent}; } } - return ; + return ; } private updateViewedFeatureImportances( diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixArea/MatrixArea.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixArea/MatrixArea.tsx index 12428c65f..c8a157b7e 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixArea/MatrixArea.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixArea/MatrixArea.tsx @@ -99,7 +99,7 @@ export class MatrixArea extends React.PureComponent< this.state.matrixFeature1 !== this.props.selectedFeature1 || this.state.matrixFeature2 !== this.props.selectedFeature2 ) { - return
; + return
; } const sameFeatureSelected = this.props.selectedFeature1 === this.props.selectedFeature2; @@ -143,13 +143,13 @@ export class MatrixArea extends React.PureComponent<
{this.props.selectedFeature2 !== noFeature && !sameFeatureSelected && (
-
+
{this.props.selectedFeature2}
)} {(this.props.selectedFeature2 === noFeature || sameFeatureSelected) && ( -
+
)} {
, + />, cellData ]; } diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixFooter/MatrixFooter.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixFooter/MatrixFooter.tsx index 4eb46386c..b1ea039b4 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixFooter/MatrixFooter.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/MatrixFooter/MatrixFooter.tsx @@ -33,7 +33,7 @@ export class MatrixFooter extends React.PureComponent {
+ /> {this.props.category1Values.map((category: any, i: number) => { return (
{
+ /> {this.props.category2Values.map((category: any, i: number) => { return (
{ -
+
{localization.ErrorAnalysis.cells} @@ -62,7 +62,7 @@ export class MatrixLegend extends React.Component { iconId={this._cellsIconId} infoText={localization.ErrorAnalysis.cellsInfo} title={localization.ErrorAnalysis.cellsTitle} - > + />
{this.props.selectedCohort.cells === 0 @@ -72,7 +72,7 @@ export class MatrixLegend extends React.Component { -
+
{localization.ErrorAnalysis.errorCoverage} @@ -80,7 +80,7 @@ export class MatrixLegend extends React.Component { iconId={this._errorCoverageIconId} infoText={localization.ErrorAnalysis.errorCoverageInfo} title={localization.ErrorAnalysis.errorCoverageTitle} - > + />
{this.props.selectedCohort.errorCoverage.toFixed(2)}% @@ -89,7 +89,7 @@ export class MatrixLegend extends React.Component { -
+
{localization.ErrorAnalysis.errorRate} @@ -97,7 +97,7 @@ export class MatrixLegend extends React.Component { iconId={this._errorRateIconId} infoText={localization.ErrorAnalysis.errorRateInfo} title={localization.ErrorAnalysis.errorRateTitle} - > + />
{this.props.selectedCohort.errorRate.toFixed(2)}% diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/Navigation/Navigation.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/Navigation/Navigation.tsx index c528b0274..f4d3a8e60 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/Navigation/Navigation.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/Navigation/Navigation.tsx @@ -122,7 +122,7 @@ export class Navigation extends React.Component { item?: IBreadcrumbItem ): JSX.Element | null => { if (!item) { - return
; + return
; } if (item.onClick) { return ( diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TabularDataView/TabularDataView.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TabularDataView/TabularDataView.tsx index f2b86a4f4..cefc9ff2a 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TabularDataView/TabularDataView.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TabularDataView/TabularDataView.tsx @@ -60,7 +60,7 @@ const onRenderDetailsHeader: IRenderFunction = ( defaultRender ) => { if (!props) { - return
; + return
; } const onRenderColumnHeaderTooltip: IRenderFunction = ( tooltipHostProps @@ -122,7 +122,7 @@ export class TabularDataView extends React.Component< layoutMode={DetailsListLayoutMode.fixedColumns} constrainMode={ConstrainMode.unconstrained} onRenderDetailsHeader={onRenderDetailsHeader} - selectionPreservedOnEmptyClick={true} + selectionPreservedOnEmptyClick ariaLabelForSelectionColumn="Toggle selection" ariaLabelForSelectAllCheckbox="Toggle selection for all items" checkButtonAriaLabel="Row checkbox" diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeLegend/TreeLegend.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeLegend/TreeLegend.tsx index ac41c5e4c..367e28579 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeLegend/TreeLegend.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeLegend/TreeLegend.tsx @@ -37,7 +37,7 @@ export class TreeLegend extends React.Component { -
+
{localization.ErrorAnalysis.errorCoverage} @@ -45,7 +45,7 @@ export class TreeLegend extends React.Component { iconId={this._errorCoverageIconId} infoText={localization.ErrorAnalysis.errorCoverageInfo} title={localization.ErrorAnalysis.errorCoverageTitle} - > + />
{this.props.selectedCohort.errorCoverage.toFixed(2)}% @@ -84,7 +84,7 @@ export class TreeLegend extends React.Component { -
+
{localization.ErrorAnalysis.errorRate} @@ -92,7 +92,7 @@ export class TreeLegend extends React.Component { iconId={this._errorRateIconId} infoText={localization.ErrorAnalysis.errorRateInfo} title={localization.ErrorAnalysis.errorRateTitle} - > + />
{this.props.selectedCohort.errorRate.toFixed(2)}% diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeViewRenderer/TreeViewNode.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeViewRenderer/TreeViewNode.tsx index 315b462fd..b64e520c0 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeViewRenderer/TreeViewNode.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/TreeViewRenderer/TreeViewNode.tsx @@ -24,9 +24,6 @@ export class TreeViewNode extends React.Component { private ref: React.RefObject; public constructor(props: ITreeViewNodeProps) { super(props); - this.state = { - isMouseOver: false - }; this.ref = React.createRef(); } public render(): React.ReactNode { diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/WhatIf/WhatIf.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/WhatIf/WhatIf.tsx index 8ba29f6f7..d9d17a7aa 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/WhatIf/WhatIf.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/Controls/WhatIf/WhatIf.tsx @@ -117,7 +117,7 @@ export class WhatIf extends React.Component { isBlocking={false} onDismiss={this.props.onDismiss} > -
+
{ filterFeatures={this.filterFeatures} filteredFeatureList={this.state.filteredFeatureList} isPanelOpen={this.props.isOpen} - isInPanel={true} + isInPanel jointDataset={this.context.jointDataset} metadata={this.context.modelMetadata} openPanel={(): void => { diff --git a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/ErrorAnalysisDashboard.tsx b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/ErrorAnalysisDashboard.tsx index d0bd6d74e..d4a61186c 100644 --- a/libs/error-analysis/src/lib/ErrorAnalysisDashboard/ErrorAnalysisDashboard.tsx +++ b/libs/error-analysis/src/lib/ErrorAnalysisDashboard/ErrorAnalysisDashboard.tsx @@ -70,7 +70,6 @@ import { IMatrixAreaState, IMatrixFilterState } from "./MatrixFilterState"; -import { ModelExplanationUtils } from "./ModelExplanationUtils"; import { ITreeViewRendererState, createInitialTreeViewState @@ -91,7 +90,6 @@ export class ErrorAnalysisDashboard extends React.PureComponent< public constructor(props: IErrorAnalysisDashboardProps) { super(props); - this.setSortVector = this.setSortVector.bind(this); if (this.props.locale) { localization.setLanguage(this.props.locale); } @@ -301,7 +299,6 @@ export class ErrorAnalysisDashboard extends React.PureComponent< ? WeightVectors.AbsAvg : 0, selectedWhatIfIndex: undefined, - sortVector: undefined, treeViewState: createInitialTreeViewState(), viewType: ViewTypeKeys.ErrorAnalysisView, weightVectorLabels, @@ -516,7 +513,7 @@ export class ErrorAnalysisDashboard extends React.PureComponent< selectedKey={this.state.activeGlobalTab} onLinkClick={this.handleGlobalTabClick} linkSize={PivotLinkSize.normal} - headersOnly={true} + headersOnly styles={{ root: classNames.pivotLabelWrapper }} > {this.pivotItems.map((props) => ( @@ -725,14 +722,6 @@ export class ErrorAnalysisDashboard extends React.PureComponent< } }; - private setSortVector(): void { - this.setState({ - sortVector: ModelExplanationUtils.getSortIndices( - this.state.cohorts[0].cohort.calculateAverageImportance() - ).reverse() - }); - } - private viewExplanation(): void { this.setState({ openFeatureList: false, diff --git a/libs/fairness/src/lib/Controls/EmptyHeader.tsx b/libs/fairness/src/lib/Controls/EmptyHeader.tsx index 3175b4801..c3020e0b5 100644 --- a/libs/fairness/src/lib/Controls/EmptyHeader.tsx +++ b/libs/fairness/src/lib/Controls/EmptyHeader.tsx @@ -12,7 +12,7 @@ export class EmptyHeader extends React.Component { horizontalAlign="space-between" verticalAlign="center" style={{ height: "36px" }} - > + /> ); } } diff --git a/libs/fairness/src/lib/Controls/FairnessPicker.tsx b/libs/fairness/src/lib/Controls/FairnessPicker.tsx index 8c2f2c581..df3d9481f 100644 --- a/libs/fairness/src/lib/Controls/FairnessPicker.tsx +++ b/libs/fairness/src/lib/Controls/FairnessPicker.tsx @@ -57,13 +57,13 @@ export class FairnessPicker extends React.PureComponent< onChange={this.onFairnessChange} options={options} ariaLabel={"Fairness selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth />
{this.state.showCallout && ( diff --git a/libs/fairness/src/lib/Controls/FairnessTab.tsx b/libs/fairness/src/lib/Controls/FairnessTab.tsx index 6fdc19c90..014170d0f 100644 --- a/libs/fairness/src/lib/Controls/FairnessTab.tsx +++ b/libs/fairness/src/lib/Controls/FairnessTab.tsx @@ -43,7 +43,7 @@ export class FairnessTab extends React.PureComponent { /> ; editingFeatureIndex: number | undefined; } @@ -56,8 +55,7 @@ export class FeatureTab extends React.PureComponent { } }); this.state = { - editingFeatureIndex: undefined, - expandedBins: new Set() + editingFeatureIndex: undefined }; this.columns = [ { @@ -136,7 +134,7 @@ export class FeatureTab extends React.PureComponent { columns={this.columns} selectionMode={SelectionMode.single} selection={this.selection} - selectionPreservedOnEmptyClick={true} + selectionPreservedOnEmptyClick getKey={this.getKey} setKey="set" layoutMode={DetailsListLayoutMode.justified} diff --git a/libs/fairness/src/lib/Controls/ModalHelp.tsx b/libs/fairness/src/lib/Controls/ModalHelp.tsx index 5469d9564..4a1079c4a 100644 --- a/libs/fairness/src/lib/Controls/ModalHelp.tsx +++ b/libs/fairness/src/lib/Controls/ModalHelp.tsx @@ -52,7 +52,7 @@ export class ModalHelp extends React.PureComponent { titleAriaId="intro modal" isOpen={this.state?.showModalHelp} onDismiss={this.handleCloseModalHelp} - isModeless={true} + isModeless containerClassName={sharedStyles.modalContentHelp} >
diff --git a/libs/fairness/src/lib/Controls/ModelComparisonChart.tsx b/libs/fairness/src/lib/Controls/ModelComparisonChart.tsx index 5872ec85f..847505425 100644 --- a/libs/fairness/src/lib/Controls/ModelComparisonChart.tsx +++ b/libs/fairness/src/lib/Controls/ModelComparisonChart.tsx @@ -53,7 +53,6 @@ export interface IModelComparisonProps { } export interface IState { - showModalIntro?: boolean; showModalHelp?: boolean; featureKey?: string; performanceKey?: string; @@ -140,8 +139,7 @@ export class ModelComparisonChart extends React.Component< super(props); this.state = { fairnessKey: this.props.fairnessPickerProps.selectedFairnessKey, - performanceKey: this.props.performancePickerProps.selectedPerformanceKey, - showModalIntro: this.props.showIntro + performanceKey: this.props.performancePickerProps.selectedPerformanceKey }; } @@ -249,7 +247,7 @@ export class ModelComparisonChart extends React.Component< titleAriaId="help modal" isOpen={this.state.showModalHelp} onDismiss={this.handleCloseModalHelp} - isModeless={true} + isModeless containerClassName={styles.modalContentHelp} > { >
-
+
diff --git a/libs/fairness/src/lib/Controls/PerformancePicker.tsx b/libs/fairness/src/lib/Controls/PerformancePicker.tsx index 24efe5bca..5d0b3b20f 100644 --- a/libs/fairness/src/lib/Controls/PerformancePicker.tsx +++ b/libs/fairness/src/lib/Controls/PerformancePicker.tsx @@ -56,13 +56,13 @@ export class PerformancePicker extends React.PureComponent< onChange={this.onPerformanceChange} options={options} ariaLabel={"Performance selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth />
{this.state.showCallout && ( diff --git a/libs/fairness/src/lib/Controls/PerformancePlot.tsx b/libs/fairness/src/lib/Controls/PerformancePlot.tsx index 3e425cdc8..2b0a74847 100644 --- a/libs/fairness/src/lib/Controls/PerformancePlot.tsx +++ b/libs/fairness/src/lib/Controls/PerformancePlot.tsx @@ -18,7 +18,7 @@ import { SharedStyles } from "../Shared.styles"; import { FormatMetrics } from "./../util/FormatMetrics"; import { IFairnessContext } from "./../util/IFairnessContext"; import { ModalHelp } from "./ModalHelp"; -import { PerformancePlotStyles } from "./PerformancePlot.styles"; +import { PerformancePlotLegend } from "./PerformancePlotLegend"; interface IPerformancePlotProps { dashboardContext: IFairnessContext; @@ -231,7 +231,7 @@ export class PerformancePlot extends React.PureComponent< >
-
+
{ - public render(): React.ReactNode { - const styles = PerformancePlotStyles(); - const sharedStyles = SharedStyles(); - - return ( - -
-
-
-
- {this.props.useOverUnderPrediction - ? localization.Fairness.Report.underestimationError - : localization.Fairness.Report.falseNegativeRate} -
- {this.props.showSubtitle && ( -
- {localization.Fairness.Report.underpredictionExplanation} -
- )} -
-
-
-
-
-
- {this.props.useOverUnderPrediction - ? localization.Fairness.Report.overestimationError - : localization.Fairness.Report.falsePositiveRate} -
- {this.props.showSubtitle && ( -
- {localization.Fairness.Report.overpredictionExplanation} -
- )} -
-
- - ); - } -} diff --git a/libs/fairness/src/lib/Controls/PerformancePlotLegend.tsx b/libs/fairness/src/lib/Controls/PerformancePlotLegend.tsx new file mode 100644 index 000000000..b49e14e4a --- /dev/null +++ b/libs/fairness/src/lib/Controls/PerformancePlotLegend.tsx @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { localization } from "@responsible-ai/localization"; +import { chartColors } from "@responsible-ai/mlchartlib"; +import { Stack } from "office-ui-fabric-react"; +import React from "react"; + +import { SharedStyles } from "../Shared.styles"; + +import { IPerformancePlotLegendProps } from "./PerformancePlot"; +import { PerformancePlotStyles } from "./PerformancePlot.styles"; + +export class PerformancePlotLegend extends React.PureComponent< + IPerformancePlotLegendProps +> { + public render(): React.ReactNode { + const styles = PerformancePlotStyles(); + const sharedStyles = SharedStyles(); + + return ( + +
+
+
+
+ {this.props.useOverUnderPrediction + ? localization.Fairness.Report.underestimationError + : localization.Fairness.Report.falseNegativeRate} +
+ {this.props.showSubtitle && ( +
+ {localization.Fairness.Report.underpredictionExplanation} +
+ )} +
+
+
+
+
+
+ {this.props.useOverUnderPrediction + ? localization.Fairness.Report.overestimationError + : localization.Fairness.Report.falsePositiveRate} +
+ {this.props.showSubtitle && ( +
+ {localization.Fairness.Report.overpredictionExplanation} +
+ )} +
+
+ + ); + } +} diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/Callout/LabelWithCallout.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/Callout/LabelWithCallout.tsx index dc2e00bba..687d7f0b9 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/Callout/LabelWithCallout.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/Callout/LabelWithCallout.tsx @@ -61,9 +61,9 @@ export class LabelWithCallout extends React.Component< )} {this.state.showCallout && ( ) : ( - + {cohort.name} - + {index && ( {localization.Interpret.CohortBanner.editCohort} diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditor.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditor.tsx index d1222323d..00c6d9b4e 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditor.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditor.tsx @@ -102,7 +102,7 @@ export class CohortEditor extends React.PureComponent< return 0; }} // https://github.com/microsoft/fluentui/issues/6476 id="cohortEditPanel" - isOpen={true} + isOpen onDismiss={this.props.closeCohortEditorPanel} onRenderFooter={this.renderFooter} isFooterAtBottom diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditorFilter.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditorFilter.tsx index ff4256c7c..41a85323d 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditorFilter.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/Cohort/CohortEditorFilter.tsx @@ -155,7 +155,7 @@ export class CohortEditorFilter extends React.Component< selectedKey={this.props.openedFilter.arg} onChange={this.props.setCategoricalValues} options={categoricalOptions} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth calloutProps={FabricStyles.calloutProps} styles={FabricStyles.limitedSizeMenuDropdown} /> @@ -176,7 +176,7 @@ export class CohortEditorFilter extends React.Component< selectedKey={this.props.openedFilter.method} onChange={this.props.setComparison} options={this.comparisonOptions} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth calloutProps={FabricStyles.calloutProps} /> {selectedMeta.featureRange && diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/DependencePlot/DependencePlot.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/DependencePlot/DependencePlot.tsx index f3bf81a0a..9e2525de5 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/DependencePlot/DependencePlot.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/DependencePlot/DependencePlot.tsx @@ -115,7 +115,7 @@ export class DependencePlot extends React.PureComponent {
-
+
{ diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/EbmExplanation.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/EbmExplanation.tsx index 8052c1988..56a81be84 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/EbmExplanation.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/EbmExplanation.tsx @@ -228,7 +228,7 @@ export class EbmExplanation extends React.PureComponent { onChange={this.onFeatureSelect} options={this.featureOptions} ariaLabel={"feature picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} />
diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Beehive.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Beehive.tsx index f3138f45c..78dd49dfa 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Beehive.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Beehive.tsx @@ -474,7 +474,7 @@ export class Beehive extends React.PureComponent< onChange={this.setChart} options={this.props.chartTypeOptions} ariaLabel={"chart type picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> {this.colorOptions.length > 1 && ( @@ -485,7 +485,7 @@ export class Beehive extends React.PureComponent< onChange={this.setColor} options={this.colorOptions} ariaLabel={"color picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> )} @@ -521,7 +521,7 @@ export class Beehive extends React.PureComponent< step={1} value={this.props.config.topK} onChange={(value: number): void => this.setK(value)} - showValue={true} + showValue />
{this.props.dashboardContext.explanationContext.modelMetadata @@ -545,7 +545,7 @@ export class Beehive extends React.PureComponent< onChange={weightContext.onSelection} options={weightContext.options} ariaLabel={"Cross-class weighting selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} />
@@ -554,7 +554,7 @@ export class Beehive extends React.PureComponent< {this.state.calloutContent && ( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/FeatureImportanceBar.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/FeatureImportanceBar.tsx index 161f7907b..ac5aaa9c6 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/FeatureImportanceBar.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/FeatureImportanceBar.tsx @@ -80,7 +80,7 @@ export class FeatureImportanceBar extends React.PureComponent< onChange={this.setChart} options={this.props.chartTypeOptions} ariaLabel={"chart type picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> )} @@ -106,7 +106,7 @@ export class FeatureImportanceBar extends React.PureComponent< step={1} value={this.props.config.topK} onChange={this.setTopK} - showValue={true} + showValue ariaLabel={ localization.Interpret.AggregateImportance.topKFeatures } @@ -119,7 +119,7 @@ export class FeatureImportanceBar extends React.PureComponent< onChange={this.onSortSelect} options={this.sortOptions} ariaLabel={"sort selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> )} @@ -127,7 +127,7 @@ export class FeatureImportanceBar extends React.PureComponent< {this.state.isCalloutVisible && ( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Violin.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Violin.tsx index 662ecac73..e17312c6a 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Violin.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/FeatureImportance/Violin.tsx @@ -346,7 +346,7 @@ export class Violin extends React.PureComponent< onChange={this.setChart} options={this.props.chartTypeOptions} ariaLabel={"chart type picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> {this.props.dashboardContext.explanationContext.modelMetadata @@ -359,7 +359,7 @@ export class Violin extends React.PureComponent< onChange={this.onGroupSelect} options={this.groupByOptions} ariaLabel={"chart type picker"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} /> )} @@ -390,7 +390,7 @@ export class Violin extends React.PureComponent< step={1} value={this.props.config.topK} onChange={this.setTopK} - showValue={true} + showValue />
{this.props.dashboardContext.explanationContext.modelMetadata @@ -417,7 +417,7 @@ export class Violin extends React.PureComponent< onChange={weightContext.onSelection} options={weightContext.options} ariaLabel={"Cross-class weighting selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.smallDropdownStyle} />
@@ -426,7 +426,7 @@ export class Violin extends React.PureComponent< {this.state.calloutContent && ( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/GlobalExplanationTab.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/GlobalExplanationTab.tsx index 384bcb7df..1243397cb 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/GlobalExplanationTab.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/GlobalExplanationTab.tsx @@ -57,14 +57,11 @@ export interface IGlobalExplanationTabProps { interface IGlobalExplanationTabState { topK: number; - minK: number; - maxK: number; sortingSeriesIndex: number; sortArray: number[]; seriesIsActive: boolean[]; selectedCohortIndex: number; selectedFeatureIndex?: number; - crossClassInfoVisible: boolean; chartType: ChartTypes; globalBarSettings?: IGlobalBarSettings; dependenceProps?: IGenericChartProps; @@ -86,7 +83,6 @@ export class GlobalExplanationTab extends React.PureComponent< : undefined; private defaultMinK = 4; - private defaultMaxK = 30; public constructor(props: IGlobalExplanationTabProps) { super(props); @@ -99,9 +95,6 @@ export class GlobalExplanationTab extends React.PureComponent< activeSeries: [], chartType: ChartTypes.Bar, cohortSeries: [], - crossClassInfoVisible: false, - maxK: this.defaultMaxK, - minK: this.defaultMinK, selectedCohortIndex: initialCohortIndex, seriesIsActive: this.props.cohorts.map(() => true), sortArray: [], @@ -115,16 +108,6 @@ export class GlobalExplanationTab extends React.PureComponent< return; } - const minK = Math.min( - 4, - this.context.jointDataset.localExplanationFeatureCount - ); - - const maxK = Math.min( - this.defaultMaxK, - this.context.jointDataset.localExplanationFeatureCount - ); - const sortArray = ModelExplanationUtils.getSortIndices( this.props.cohorts[ this.state.selectedCohortIndex @@ -139,8 +122,6 @@ export class GlobalExplanationTab extends React.PureComponent< ), cohortSeries, globalBarSettings: this.getDefaultSettings(), - maxK, - minK, sortArray }); } diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/SidePanel.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/SidePanel.tsx index 022a79ebf..67f044993 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/SidePanel.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalExplanationTab/SidePanel.tsx @@ -44,7 +44,6 @@ export interface ISidePanelProps { onChartTypeChange(chartType: ChartTypes): void; } interface ISidePanelState { - crossClassInfoVisible: boolean; weightOptions: IDropdownOption[] | undefined; } export class SidePanel extends React.Component< @@ -64,7 +63,6 @@ export class SidePanel extends React.Component< public constructor(props: ISidePanelProps) { super(props); this.state = { - crossClassInfoVisible: false, weightOptions: this.getWeightOptions() }; } diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalOnlyChart/GlobalOnlyChart.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalOnlyChart/GlobalOnlyChart.tsx index 97afad3ee..d8c8f69af 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/GlobalOnlyChart/GlobalOnlyChart.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/GlobalOnlyChart/GlobalOnlyChart.tsx @@ -14,14 +14,12 @@ import { localization } from "@responsible-ai/localization"; import { Icon, Slider, Text } from "office-ui-fabric-react"; import React from "react"; -import { FeatureKeys } from "../../SharedComponents/IBarChartConfig"; import { FeatureImportanceBar } from "../FeatureImportanceBar/FeatureImportanceBar"; import { globalTabStyles } from "../GlobalExplanationTab/GlobalExplanationTab.styles"; import { IGlobalSeries } from "../GlobalExplanationTab/IGlobalSeries"; export interface IGlobalOnlyChartState { topK: number; - sortingSeriesKey: number | string; sortArray: number[]; globalSeries: IGlobalSeries[]; featureNames: string[]; @@ -72,7 +70,6 @@ export class GlobalOnlyChart extends React.PureComponent< sortArray: ModelExplanationUtils.buildSortedVector( globalImportance ).reverse(), - sortingSeriesKey: FeatureKeys.AbsoluteGlobal, topK: Math.min( 4, this.context.precomputedExplanations?.globalFeatureImportance?.scores diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/ICEPlot.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/ICEPlot.tsx index d1ac9035e..bea917590 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/ICEPlot.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/ICEPlot.tsx @@ -299,7 +299,7 @@ export class ICEPlot extends React.Component { ? this.state.rangeView.featureIndex : undefined } - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -311,7 +311,7 @@ export class ICEPlot extends React.Component { selectedKey={ this.state.rangeView.selectedOptionKeys as string[] } - allowFreeform={true} + allowFreeform autoComplete="on" options={this.state.rangeView.categoricalOptions} onChange={this.onCategoricalRangeChanged} diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/ModelPerformanceTab/ModelPerformanceTab.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/ModelPerformanceTab/ModelPerformanceTab.tsx index 15053be77..29f86fb54 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/ModelPerformanceTab/ModelPerformanceTab.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/ModelPerformanceTab/ModelPerformanceTab.tsx @@ -212,7 +212,7 @@ export class ModelPerformanceTab extends React.PureComponent<
-
+
{ private plotlyProps: IPlotlyProperty; public constructor(props: IScatterProps) { super(props); - this.state = { isCalloutVisible: false }; this.plotlyProps = this.props.plotlyProps !== undefined ? _.cloneDeep(this.props.plotlyProps) @@ -73,7 +72,7 @@ export class DataExploration extends React.PureComponent { label={localization.Interpret.ExplanationScatter.xValue} ariaLabel="x picker" selectedKey={this.plotlyProps.data[0].xAccessor} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -84,7 +83,7 @@ export class DataExploration extends React.PureComponent { label={localization.Interpret.ExplanationScatter.colorValue} ariaLabel="color picker" selectedKey={initialColorOption} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -97,7 +96,7 @@ export class DataExploration extends React.PureComponent { label={localization.Interpret.ExplanationScatter.yValue} ariaLabel="y picker" selectedKey={this.plotlyProps.data[0].yAccessor} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/Scatter/ExplanationExploration.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/Scatter/ExplanationExploration.tsx index fa389745f..46c30e5bb 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/Scatter/ExplanationExploration.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/Scatter/ExplanationExploration.tsx @@ -96,7 +96,7 @@ export class ExplanationExploration extends React.PureComponent< label={localization.Interpret.ExplanationScatter.xValue} ariaLabel="x picker" selectedKey={this.plotlyProps.data[0].xAccessor} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -107,7 +107,7 @@ export class ExplanationExploration extends React.PureComponent< label={localization.Interpret.ExplanationScatter.colorValue} ariaLabel="color picker" selectedKey={initialColorOption} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -120,7 +120,7 @@ export class ExplanationExploration extends React.PureComponent< label={localization.Interpret.ExplanationScatter.yValue} ariaLabel="y picker" selectedKey={this.plotlyProps.data[0].yAccessor} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -146,7 +146,7 @@ export class ExplanationExploration extends React.PureComponent< onChange={weightContext.onSelection} options={weightContext.options} ariaLabel={"Cross-class weighting selector"} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -155,7 +155,7 @@ export class ExplanationExploration extends React.PureComponent< {this.state.isCalloutVisible && ( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/SinglePointFeatureImportance.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/SinglePointFeatureImportance.tsx index b5dd28b6a..585c8344f 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/SinglePointFeatureImportance.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/SinglePointFeatureImportance.tsx @@ -119,7 +119,7 @@ export class SinglePointFeatureImportance extends React.PureComponent< step={1} value={this.props.config.topK} onChange={this.setTopK} - showValue={true} + showValue /> {this.sortOptions.length > 1 && ( )} diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/CustomPredictionLabels.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/CustomPredictionLabels.tsx index 42aee2213..9155e8783 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/CustomPredictionLabels.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/CustomPredictionLabels.tsx @@ -154,7 +154,7 @@ export class CustomPredictionLabels extends React.Component< + />
@@ -184,8 +184,8 @@ export class CustomPredictionLabels extends React.Component< + disabled + />
diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/ExistingPredictionLabels.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/ExistingPredictionLabels.tsx index d0cef3c3a..625e96aa1 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/ExistingPredictionLabels.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/ExistingPredictionLabels.tsx @@ -134,7 +134,7 @@ export class ExistingPredictionLabels extends React.Component< + />
{trueClass !== undefined && ( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/LocalImportancePlots.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/LocalImportancePlots.tsx index b308679a5..6ad837519 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/LocalImportancePlots.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/LocalImportancePlots.tsx @@ -222,9 +222,9 @@ export class LocalImportancePlots extends React.Component< )} {this.state.crossClassInfoVisible && ( {this.state.iceTooltipVisible && ( @@ -363,7 +363,7 @@ export class LocalImportancePlots extends React.Component< label={localization.Interpret.WhatIfTab.classPickerLabel} ariaLabel="class picker" selectedKey={this.state.selectedICEClass} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth calloutProps={FabricStyles.calloutProps} styles={FabricStyles.limitedSizeMenuDropdown} /> diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfPanel.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfPanel.tsx index 09c0586cf..b9119a84f 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfPanel.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfPanel.tsx @@ -170,7 +170,7 @@ export class WhatIfPanel extends React.Component { key={item.key} label={metaInfo.abbridgedLabel} autoComplete={"on"} - allowFreeform={true} + allowFreeform selectedKey={this.props.temporaryPoint?.[item.key]} options={item.data.categoricalOptions} onChange={this.setCustomRowPropertyDropdown.bind( diff --git a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfTab.tsx b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfTab.tsx index f2b95d2ac..cb9e91c40 100644 --- a/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfTab.tsx +++ b/libs/interpret/src/lib/MLIDashboard/Controls/WhatIfTab/WhatIfTab.tsx @@ -68,14 +68,8 @@ export interface IWhatIfTabState { selectedPointsIndexes: number[]; pointIsActive: boolean[]; customPointIsActive: boolean[]; - topK: number; sortArray: number[]; sortingSeriesIndex: number | undefined; - secondaryChartChoice: string; - selectedFeatureKey: string; - selectedICEClass: number; - crossClassInfoVisible: boolean; - iceTooltipVisible: boolean; } export class WhatIfTab extends React.PureComponent< @@ -105,26 +99,20 @@ export class WhatIfTab extends React.PureComponent< super(props); this.state = { - crossClassInfoVisible: false, customPointIsActive: [], customPoints: [], editingDataCustomIndex: undefined, featuresOption: [], filteredFeatureList: [], - iceTooltipVisible: false, isPanelOpen: this.props.invokeModel !== undefined, pointIsActive: [], request: undefined, - secondaryChartChoice: WhatIfConstants.featureImportanceKey, selectedCohortIndex: 0, - selectedFeatureKey: JointDataset.DataLabelRoot + "0", - selectedICEClass: 0, selectedPointsIndexes: [], selectedWhatIfRootIndex: 0, showSelectionWarning: false, sortArray: [], sortingSeriesIndex: undefined, - topK: 4, xDialogOpen: false, yDialogOpen: false }; @@ -457,7 +445,7 @@ export class WhatIfTab extends React.PureComponent< )}
-
+
{this.pivotItems.map((props) => ( @@ -860,7 +860,7 @@ export class ExplanationDashboard extends React.Component< onLinkClick={this.handleLocalTabClick} linkFormat={PivotLinkFormat.tabs} linkSize={PivotLinkSize.normal} - headersOnly={true} + headersOnly styles={FabricStyles.verticalTabsStyle} > ) : ( - + {this.pivotItems.map((props) => ( @@ -170,7 +170,7 @@ export class NewExplanationDashboard extends React.PureComponent< GlobalTabKeys.ModelPerformance && } {this.state.activeGlobalTab === GlobalTabKeys.DataExploration && ( - + )} {this.state.activeGlobalTab === GlobalTabKeys.ExplanationTab && ( diff --git a/libs/interpret/src/lib/MLIDashboard/SharedComponents/BinningControl.tsx b/libs/interpret/src/lib/MLIDashboard/SharedComponents/BinningControl.tsx index 42ab353a0..b888030c8 100644 --- a/libs/interpret/src/lib/MLIDashboard/SharedComponents/BinningControl.tsx +++ b/libs/interpret/src/lib/MLIDashboard/SharedComponents/BinningControl.tsx @@ -75,7 +75,7 @@ export class BinningControl extends React.PureComponent< label={localization.Interpret.IcePlot.featurePickerLabel} ariaLabel="feature picker" selectedKey={this.state ? this.state.featureIndex : undefined} - useComboBoxAsMenuWidth={true} + useComboBoxAsMenuWidth styles={FabricStyles.defaultDropdownStyle} />
@@ -85,7 +85,7 @@ export class BinningControl extends React.PureComponent<