-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into gaugup/CorrectTargetIndentifier
- Loading branch information
Showing
28 changed files
with
712 additions
and
395 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 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
68 changes: 68 additions & 0 deletions
68
...isDashboard/Controls/CausalAnalysisView/CausalIndividualView/getIndividualChartOptions.ts
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { IPlotlyProperty } from "@responsible-ai/mlchartlib"; | ||
|
||
export function getIndividualChartOptions( | ||
plotlyProperty: IPlotlyProperty, | ||
onClickHandler?: (data: any) => void | ||
): any { | ||
let template = ""; | ||
const data = plotlyProperty.data.map((series, seriesIndex) => { | ||
const data: any = []; | ||
series.x?.forEach((p, index) => { | ||
const temp = { | ||
customdata: series?.customdata?.[index], | ||
marker: { | ||
fillColor: | ||
seriesIndex === 0 ? series?.marker?.color?.[index] : undefined, | ||
lineColor: | ||
seriesIndex === 0 ? undefined : series?.marker?.line?.color, | ||
lineWidth: seriesIndex === 0 ? undefined : 3, | ||
radius: seriesIndex === 0 ? 4 : 6, | ||
symbol: | ||
seriesIndex === 0 ? series?.marker?.symbol?.[index] : "diamond" | ||
}, | ||
x: p, | ||
y: series?.y?.[index] | ||
}; | ||
template = series.hovertemplate as string; | ||
data.push(temp); | ||
}); | ||
return data; | ||
}); | ||
|
||
const series = data.map((d) => { | ||
return { | ||
data: d, | ||
showInLegend: false | ||
}; | ||
}); | ||
return { | ||
chart: { | ||
type: "scatter", | ||
zoomType: "xy" | ||
}, | ||
plotOptions: { | ||
scatter: { | ||
tooltip: { | ||
pointFormat: template | ||
} | ||
}, | ||
series: { | ||
cursor: "pointer", | ||
point: { | ||
events: { | ||
click() { | ||
if (onClickHandler === undefined) { | ||
return; | ||
} | ||
onClickHandler(this); | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
series | ||
}; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { IChartColorNames } from "./getHighchartsTheme"; | ||
|
||
export interface IHighchartsCustomConfig { | ||
/** | ||
* Max color name for color axis. Min is white. | ||
*/ | ||
colorAxisMaxColor?: keyof IChartColorNames; | ||
|
||
/** | ||
* Disables chart update and rerenders chart when parent component | ||
* of the chart is rerendered | ||
*/ | ||
disableUpdate?: boolean; | ||
|
||
/** | ||
* Disables zooming for chart. Default zooming behavior is "xy". | ||
* To keep zooming enabled but specify a different value then default, | ||
* use "chartOptions.chart.zoomType" | ||
*/ | ||
disableZoom?: boolean; | ||
|
||
/** | ||
* If set true, makes chart background transparent. Default behavior is making | ||
* chart background color same as theme background color | ||
*/ | ||
transparentBackground?: boolean; | ||
|
||
/** | ||
* Gets called when parent component is rerendered and chart is updated | ||
* | ||
* @param chart Chart reference | ||
*/ | ||
onUpdate?(chart: Highcharts.Chart): void; | ||
|
||
/** | ||
* Delegate which enables to change the order of the colors. | ||
* This is the current order: | ||
* primary | ||
* blueMid | ||
* teal | ||
* purple | ||
* purpleLight | ||
* magentaDark | ||
* magentaLight | ||
* black | ||
* orangeLighter | ||
* redDark | ||
* red | ||
* neutral | ||
* | ||
* @param colors Currently sorted colors | ||
* @returns New sorted colors | ||
*/ | ||
onSortColors?( | ||
colors: Array<keyof IChartColorNames> | ||
): Array<keyof IChartColorNames>; | ||
} | ||
|
||
export interface IHighchartsConfig extends Highcharts.Options { | ||
custom?: IHighchartsCustomConfig; | ||
} |
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.