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

Add a feature flag for the new model overview experience #1306

Merged
merged 8 commits into from
Apr 4, 2022

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,35 @@ import {
OverallMetricChart
} from "@responsible-ai/core-ui";
import { localization } from "@responsible-ai/localization";
import _ from "lodash";
import { Text } from "office-ui-fabric-react";
import { Stack, Text } from "office-ui-fabric-react";
import React from "react";

import { modelOverviewStyles } from "./ModelOverview.styles";
interface IModelOverviewProps {
showNewModelOverviewExperience: boolean;
}

class ModelOverviewProps {}
// This will be an interface shortly.
// As long as it has no members it needs to remain a class for code style reasons.
class IModelOverviewState {}

export class ModelOverview extends React.PureComponent<ModelOverviewProps> {
export class ModelOverview extends React.Component<
IModelOverviewProps,
IModelOverviewState
> {
public static contextType = ModelAssessmentContext;
public context: React.ContextType<typeof ModelAssessmentContext> =
defaultModelAssessmentContext;

constructor(props: IModelOverviewProps) {
super(props);
this.state = {
selectedMetrics: [],
romanlutz marked this conversation as resolved.
Show resolved Hide resolved
selectedFeatures: [],
isFeaturePickerLimitExceededDialogOpen: false
};
}

public render(): React.ReactNode {
const classNames = modelOverviewStyles();
if (!this.context.jointDataset.hasPredictedY) {
return (
<MissingParametersPlaceholder>
Expand All @@ -32,14 +46,12 @@ export class ModelOverview extends React.PureComponent<ModelOverviewProps> {
}

return (
<div className={classNames.page}>
<div className={classNames.infoWithText}>
<Text variant="medium">
{localization.Interpret.ModelPerformance.helperText}
</Text>
</div>
<OverallMetricChart />
</div>
<Stack tokens={{ padding: "16px 40px 10px 40px" }}>
romanlutz marked this conversation as resolved.
Show resolved Hide resolved
<Text variant="medium">
{localization.Interpret.ModelPerformance.helperText}
</Text>
{!this.props.showNewModelOverviewExperience && <OverallMetricChart />}
</Stack>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class TabsView extends React.PureComponent<
}
</Text>
</div>
<ModelOverview />
<ModelOverview showNewModelOverviewExperience={false} />
</>
)}
{t.key === GlobalTabKeys.DataExplorerTab && (
Expand Down