Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixing #1326

Merged
merged 7 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export enum Locators {
SortByDropdownOptions = "div[class^='dropdownItemsWrapper'] button:contains('CohortCreateE2E')",
CohortOnOffSelectionContainer = "#iterative-container",
CohortOnOffCohortCreateE2E = "#iterative-container div:contains(CohortCreateE2E) [role='checkbox']",
CreateNewCohortButton = "button:contains('Save cohort')",
CreateNewCohortButton = "button:contains('New cohort')",
CohortNameInput = "#cohortEditPanel input:eq(0)",
CohortDatasetValueInput = "#cohortEditPanel input[class^='ms-spinButton-input']",
CohortFilterSelection = "#cohortEditPanel [type='radio']",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ import {
ICausalAnalysisSingleData,
ModelAssessmentContext
} from "@responsible-ai/core-ui";
import { localization } from "@responsible-ai/localization";
import _, { isEqual } from "lodash";
import { Text, Link, Stack, getTheme } from "office-ui-fabric-react";
import { getTheme } from "office-ui-fabric-react";
import React from "react";

import { CausalAggregateStyles } from "./CausalAggregateStyles";

export interface ICausalAggregateChartProps {
data: ICausalAnalysisSingleData[];
}
Expand All @@ -25,45 +22,12 @@ export class CausalAggregateChart extends React.PureComponent<ICausalAggregateCh
defaultModelAssessmentContext;

public render(): React.ReactNode {
const styles = CausalAggregateStyles();
return (
<Stack horizontal verticalFill className={styles.container}>
<Stack.Item grow className={styles.leftPane}>
<BasicHighChart
configOverride={getErrorBarChartOptions(
this.props.data,
getTheme()
)}
theme={getTheme()}
id="CausalAggregateChart"
/>
</Stack.Item>
<Stack.Item grow className={styles.rightPane}>
<Stack horizontal={false}>
<Stack.Item className={styles.label}>
<Text variant={"xLarge"} className={styles.header}>
{localization.CausalAnalysis.AggregateView.continuous}
</Text>
{localization.CausalAnalysis.AggregateView.continuousDescription}
</Stack.Item>
<Stack.Item className={styles.label}>
<Text variant={"xLarge"} className={styles.header}>
{localization.CausalAnalysis.AggregateView.binary}
</Text>
{localization.CausalAnalysis.AggregateView.binaryDescription}
</Stack.Item>
<Stack.Item className={styles.lasso}>
{localization.CausalAnalysis.AggregateView.lasso}{" "}
<Link
href="https://econml.azurewebsites.net/spec/estimation/dml.html"
target="_blank"
>
{localization.CausalAnalysis.AggregateView.here}
</Link>
</Stack.Item>
</Stack>
</Stack.Item>
</Stack>
<BasicHighChart
configOverride={getErrorBarChartOptions(this.props.data, getTheme())}
theme={getTheme()}
id="CausalAggregateChart"
/>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export const CausalAggregateStyles: () => IProcessedStyleSet<ICausalAggregateSty
margin: "-5px 0 0 -15px"
},
container: {
height: "500px",
overflowY: "scroll"
height: "100%"
},
description: {
display: "flex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,44 @@ export class CausalAggregateView extends React.PureComponent<ICausalAggregateVie
</LabelWithCallout>
</Stack.Item>
</Stack>
<Stack>
<Stack.Item className={styles.table}>
<CausalAggregateTable data={this.props.data.global_effects} />
<Stack horizontal verticalFill className={styles.container}>
<Stack.Item grow className={styles.leftPane}>
<Stack horizontal={false}>
<Stack.Item>
<CausalAggregateTable data={this.props.data.global_effects} />
</Stack.Item>
<Stack.Item>
<CausalAggregateChart data={this.props.data.global_effects} />
</Stack.Item>
</Stack>
</Stack.Item>
<Stack.Item>
<CausalAggregateChart data={this.props.data.global_effects} />
<Stack.Item grow className={styles.rightPane}>
<Stack horizontal={false}>
<Stack.Item className={styles.label}>
<Text variant={"xLarge"} className={styles.header}>
{localization.CausalAnalysis.AggregateView.continuous}
</Text>
{
localization.CausalAnalysis.AggregateView
.continuousDescription
}
</Stack.Item>
<Stack.Item className={styles.label}>
<Text variant={"xLarge"} className={styles.header}>
{localization.CausalAnalysis.AggregateView.binary}
</Text>
{localization.CausalAnalysis.AggregateView.binaryDescription}
</Stack.Item>
<Stack.Item className={styles.lasso}>
{localization.CausalAnalysis.AggregateView.lasso}{" "}
<Link
href="https://econml.azurewebsites.net/spec/estimation/dml.html"
target="_blank"
>
{localization.CausalAnalysis.AggregateView.here}
</Link>
</Stack.Item>
</Stack>
</Stack.Item>
</Stack>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class CohortInfoSection extends React.PureComponent<ICohortInfoSectionPro
onClick={this.props.toggleShiftCohortVisibility}
/>
<DefaultButton
text={localization.ModelAssessment.CohortInformation.SaveCohort}
text={localization.ModelAssessment.CohortInformation.NewCohort}
onClick={this.props.toggleCreateCohortVisibility}
/>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class MainMenu extends React.PureComponent<IMainMenuProps> {
iconProps: { iconName: "Save" },
key: "saveCohort",
onClick: (): any => this.props.onSaveCohortClick(),
text: localization.ErrorAnalysis.MainMenu.saveCohort
text: localization.ErrorAnalysis.MainMenu.newCohort
});
subMenuPropItems.push({
iconProps: { iconName: "PageList" },
Expand Down
5 changes: 2 additions & 3 deletions libs/localization/src/lib/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"featureList": "Feature list",
"fullscreen": "Fullscreen",
"heatMap": "Heat map",
"saveCohort": "Save cohort",
"newCohort": "New cohort",
"shiftCohort": "Shift cohort",
"treeMap": "Tree map",
"whatIf": "What-If"
Expand Down Expand Up @@ -1268,7 +1268,7 @@
},
"CohortInformation": {
"ShiftCohort": "Shift cohort",
"SaveCohort": "Save cohort",
"NewCohort": "New cohort",
"DataPoints": "Number of datapoints",
"DefaultCohort": " (default)",
"Filters": "Number of filters",
Expand Down Expand Up @@ -1314,7 +1314,6 @@
"cohortList": "Cohort list",
"cohortSettings": "Cohort settings",
"createCohort": "Create cohort",
"saveCohort": "Save cohort",
"shiftCohort": "Shift cohort"
},
"Navigation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class CreateGlobalCohortButton extends React.Component<
return (
<>
<DefaultButton
text={localization.ModelAssessment.CohortInformation.SaveCohort}
text={localization.ModelAssessment.CohortInformation.NewCohort}
onClick={this.toggleVisibility}
/>
<CreateGlobalCohort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class MainMenu extends React.PureComponent<
},
key: "addCohort",
onClick: this.toggleCreateCohortVisibility,
text: localization.ModelAssessment.CohortInformation.SaveCohort
text: localization.ModelAssessment.CohortInformation.NewCohort
}
];
return (
Expand Down