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 error message for counterfactual panel #1310

Merged
merged 4 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/core-ui/src/lib/Interfaces/ICounterfactualData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

export interface ICounterfactualData {
cfs_list: Array<Array<Array<string | number>>>;
error_message?: string;
tongyu-microsoft marked this conversation as resolved.
Show resolved Hide resolved
feature_names: string[];
feature_names_including_target: string[];
summary_importance?: number[];
Expand Down
11 changes: 10 additions & 1 deletion libs/counterfactuals/src/lib/CounterfactualPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import {
TooltipDelay,
DirectionalHint,
IconButton,
ITooltipProps
ITooltipProps,
MessageBar,
MessageBarType
} from "office-ui-fabric-react";
import React from "react";

Expand Down Expand Up @@ -81,6 +83,13 @@ export class CounterfactualPanel extends React.Component<
onRenderFooterContent={this.renderClose}
>
<Stack tokens={{ childrenGap: "m1" }}>
<Stack.Item>
{this.props.data?.error_message && (
<MessageBar messageBarType={MessageBarType.error}>
{this.props.data.error_message}
</MessageBar>
)}
</Stack.Item>
<Stack.Item className={classes.counterfactualList}>
<CounterfactualList
selectedIndex={this.props.selectedIndex}
Expand Down