-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
324 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,76 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { Spinner } from "@fluentui/react"; | ||
import React from "react"; | ||
|
||
import { config } from "./config"; | ||
import { getConfig, IAppConfig } from "./config"; | ||
import { ErrorAnalysis } from "./ErrorAnalysis"; | ||
import { Fairness } from "./Fairness"; | ||
import { Interpret } from "./Interpret"; | ||
import { ModelAssessment } from "./ModelAssessment"; | ||
import { getModelData } from "./modelData"; | ||
|
||
export class App extends React.Component { | ||
interface IAppState { | ||
config?: IAppConfig; | ||
modelData?: any; | ||
} | ||
export class App extends React.Component<unknown, IAppState> { | ||
public constructor(props: unknown) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
public componentDidMount(): void { | ||
this.loadData(); | ||
} | ||
public render(): React.ReactNode { | ||
switch (config.dashboardType) { | ||
if (!this.state.config || !this.state.modelData) { | ||
return <Spinner />; | ||
} | ||
switch (this.state.config.dashboardType) { | ||
case "Fairness": | ||
return <Fairness />; | ||
return ( | ||
<Fairness | ||
config={this.state.config} | ||
modelData={this.state.modelData} | ||
/> | ||
); | ||
case "Interpret": | ||
return <Interpret />; | ||
return ( | ||
<Interpret | ||
config={this.state.config} | ||
modelData={this.state.modelData} | ||
/> | ||
); | ||
case "ModelPerformance": | ||
return <Interpret dashboardType={config.dashboardType} />; | ||
return ( | ||
<Interpret | ||
dashboardType={this.state.config.dashboardType} | ||
config={this.state.config} | ||
modelData={this.state.modelData} | ||
/> | ||
); | ||
case "ErrorAnalysis": | ||
return <ErrorAnalysis />; | ||
return ( | ||
<ErrorAnalysis | ||
config={this.state.config} | ||
modelData={this.state.modelData} | ||
/> | ||
); | ||
case "ResponsibleAI": | ||
return <ModelAssessment />; | ||
return ( | ||
<ModelAssessment | ||
config={this.state.config} | ||
modelData={this.state.modelData} | ||
/> | ||
); | ||
default: | ||
return "Not Found"; | ||
} | ||
} | ||
private loadData = async (): Promise<void> => { | ||
const config = await getConfig(); | ||
const modelData = await getModelData(); | ||
this.setState({ config, modelData }); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.