@fluentui/react-charting 5.23.18 → 5.23.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-charting.d.ts +38 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +18 -0
- package/lib/DeclarativeChart.d.ts +1 -0
- package/lib/DeclarativeChart.js +2 -0
- package/lib/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.d.ts +36 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +67 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +27 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +387 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-amd/DeclarativeChart.d.ts +1 -0
- package/lib-amd/DeclarativeChart.js +6 -0
- package/lib-amd/DeclarativeChart.js.map +1 -0
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.d.ts +36 -0
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +58 -0
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +27 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +402 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-amd/index.d.ts +2 -0
- package/lib-amd/index.js +3 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-commonjs/DeclarativeChart.d.ts +1 -0
- package/lib-commonjs/DeclarativeChart.js +5 -0
- package/lib-commonjs/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.d.ts +36 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +70 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +27 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +402 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-commonjs/index.d.ts +2 -0
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -119,6 +119,15 @@ export const DataVizPalette: {
|
|
|
119
119
|
highSuccess: string;
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
+
// @public
|
|
123
|
+
export const DeclarativeChart: React_2.FunctionComponent<DeclarativeChartProps>;
|
|
124
|
+
|
|
125
|
+
// @public
|
|
126
|
+
export interface DeclarativeChartProps extends React_2.RefAttributes<HTMLDivElement> {
|
|
127
|
+
chartSchema: Schema;
|
|
128
|
+
onSchemaChange?: (eventData: Schema) => void;
|
|
129
|
+
}
|
|
130
|
+
|
|
122
131
|
// @public
|
|
123
132
|
export const DonutChart: React_2.FunctionComponent<IDonutChartProps>;
|
|
124
133
|
|
|
@@ -1591,6 +1600,15 @@ export const PieChart: React_2.FunctionComponent<IPieChartProps>;
|
|
|
1591
1600
|
// @public
|
|
1592
1601
|
export const SankeyChart: React_2.FunctionComponent<ISankeyChartProps>;
|
|
1593
1602
|
|
|
1603
|
+
// @public (undocumented)
|
|
1604
|
+
export interface Schema {
|
|
1605
|
+
accesibilityLabels?: {
|
|
1606
|
+
[key: string]: string;
|
|
1607
|
+
};
|
|
1608
|
+
plotlySchema: any;
|
|
1609
|
+
selectedLegends?: string[];
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1594
1612
|
// @public (undocumented)
|
|
1595
1613
|
export const Shape: React_2.FC<IShapeProps>;
|
|
1596
1614
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/DeclarativeChart/DeclarativeChart';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeclarativeChart.js","sourceRoot":"../src/","sources":["DeclarativeChart.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC","sourcesContent":["export * from './components/DeclarativeChart/DeclarativeChart';\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface Schema {
|
|
3
|
+
/**
|
|
4
|
+
* Plotly schema represented as JSON object
|
|
5
|
+
*/
|
|
6
|
+
plotlySchema: any;
|
|
7
|
+
/**
|
|
8
|
+
* The legends selected by the user to persist in the chart
|
|
9
|
+
*/
|
|
10
|
+
selectedLegends?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Dictionary for localizing the accessibility labels
|
|
13
|
+
*/
|
|
14
|
+
accesibilityLabels?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* DeclarativeChart props.
|
|
20
|
+
* {@docCategory DeclarativeChart}
|
|
21
|
+
*/
|
|
22
|
+
export interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {
|
|
23
|
+
/**
|
|
24
|
+
* The schema representing the chart data, layout and configuration
|
|
25
|
+
*/
|
|
26
|
+
chartSchema: Schema;
|
|
27
|
+
/**
|
|
28
|
+
* Callback when an event occurs
|
|
29
|
+
*/
|
|
30
|
+
onSchemaChange?: (eventData: Schema) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* DeclarativeChart component.
|
|
34
|
+
* {@docCategory DeclarativeChart}
|
|
35
|
+
*/
|
|
36
|
+
export declare const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { DonutChart } from '../DonutChart/index';
|
|
6
|
+
import { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';
|
|
7
|
+
import { transformPlotlyJsonToDonutProps, transformPlotlyJsonToVSBCProps, transformPlotlyJsonToScatterChartProps, transformPlotlyJsonToHorizontalBarWithAxisProps, isDateArray, isNumberArray, transformPlotlyJsonToHeatmapProps, transformPlotlyJsonToSankeyProps, transformPlotlyJsonToGaugeProps, transformPlotlyJsonToGVBCProps, } from './PlotlySchemaAdapter';
|
|
8
|
+
import { LineChart } from '../LineChart/index';
|
|
9
|
+
import { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';
|
|
10
|
+
import { AreaChart } from '../AreaChart/index';
|
|
11
|
+
import { HeatMapChart } from '../HeatMapChart/index';
|
|
12
|
+
import { SankeyChart } from '../SankeyChart/SankeyChart';
|
|
13
|
+
import { GaugeChart } from '../GaugeChart/index';
|
|
14
|
+
import { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';
|
|
15
|
+
var useColorMapping = function () {
|
|
16
|
+
var colorMap = React.useRef(new Map());
|
|
17
|
+
return colorMap;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* DeclarativeChart component.
|
|
21
|
+
* {@docCategory DeclarativeChart}
|
|
22
|
+
*/
|
|
23
|
+
export var DeclarativeChart = React.forwardRef(function (props, forwardedRef) {
|
|
24
|
+
var _a, _b, _c, _d;
|
|
25
|
+
var plotlySchema = props.chartSchema.plotlySchema;
|
|
26
|
+
var xValues = plotlySchema.data[0].x;
|
|
27
|
+
var isXDate = isDateArray(xValues);
|
|
28
|
+
var isXNumber = isNumberArray(xValues);
|
|
29
|
+
var colorMap = useColorMapping();
|
|
30
|
+
switch (plotlySchema.data[0].type) {
|
|
31
|
+
case 'pie':
|
|
32
|
+
return React.createElement(DonutChart, __assign({}, transformPlotlyJsonToDonutProps(plotlySchema, colorMap)));
|
|
33
|
+
case 'bar':
|
|
34
|
+
var orientation_1 = plotlySchema.data[0].orientation;
|
|
35
|
+
if (orientation_1 === 'h') {
|
|
36
|
+
return (React.createElement(HorizontalBarChartWithAxis, __assign({}, transformPlotlyJsonToHorizontalBarWithAxisProps(plotlySchema, colorMap))));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (['group', 'overlay'].includes((_a = plotlySchema === null || plotlySchema === void 0 ? void 0 : plotlySchema.layout) === null || _a === void 0 ? void 0 : _a.barmode)) {
|
|
40
|
+
return React.createElement(GroupedVerticalBarChart, __assign({}, transformPlotlyJsonToGVBCProps(plotlySchema, colorMap)));
|
|
41
|
+
}
|
|
42
|
+
return React.createElement(VerticalStackedBarChart, __assign({}, transformPlotlyJsonToVSBCProps(plotlySchema, colorMap)));
|
|
43
|
+
}
|
|
44
|
+
case 'scatter':
|
|
45
|
+
var isAreaChart = plotlySchema.data.some(function (series) { return series.fill === 'tonexty'; });
|
|
46
|
+
if (isXDate || isXNumber) {
|
|
47
|
+
if (isAreaChart) {
|
|
48
|
+
return React.createElement(AreaChart, __assign({}, transformPlotlyJsonToScatterChartProps(plotlySchema, true, colorMap)));
|
|
49
|
+
}
|
|
50
|
+
return React.createElement(LineChart, __assign({}, transformPlotlyJsonToScatterChartProps(plotlySchema, false, colorMap)));
|
|
51
|
+
}
|
|
52
|
+
return React.createElement(VerticalStackedBarChart, __assign({}, transformPlotlyJsonToVSBCProps(plotlySchema, colorMap)));
|
|
53
|
+
case 'heatmap':
|
|
54
|
+
return React.createElement(HeatMapChart, __assign({}, transformPlotlyJsonToHeatmapProps(plotlySchema)));
|
|
55
|
+
case 'sankey':
|
|
56
|
+
return React.createElement(SankeyChart, __assign({}, transformPlotlyJsonToSankeyProps(plotlySchema, colorMap)));
|
|
57
|
+
case 'indicator':
|
|
58
|
+
if ((_d = (_c = (_b = plotlySchema === null || plotlySchema === void 0 ? void 0 : plotlySchema.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.mode) === null || _d === void 0 ? void 0 : _d.includes('gauge')) {
|
|
59
|
+
return React.createElement(GaugeChart, __assign({}, transformPlotlyJsonToGaugeProps(plotlySchema, colorMap)));
|
|
60
|
+
}
|
|
61
|
+
return React.createElement("div", null, "Unsupported Schema");
|
|
62
|
+
default:
|
|
63
|
+
return React.createElement("div", null, "Unsupported Schema");
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
DeclarativeChart.displayName = 'DeclarativeChart';
|
|
67
|
+
//# sourceMappingURL=DeclarativeChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeclarativeChart.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/DeclarativeChart.tsx"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,uDAAuD;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,EACtC,+CAA+C,EAC/C,WAAW,EACX,aAAa,EACb,iCAAiC,EACjC,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAmC3E,IAAM,eAAe,GAAG;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AAI,CAAC;aAChG;QACH,KAAK,SAAS;YACZ,IAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,UAAC,MAAW,IAAK,OAAA,MAAM,CAAC,IAAI,KAAK,SAAS,EAAzB,CAAyB,CAAC,CAAC;YACvF,IAAI,OAAO,IAAI,SAAS,EAAE;gBACxB,IAAI,WAAW,EAAE;oBACf,OAAO,oBAAC,SAAS,eAAK,sCAAsC,CAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAI,CAAC;iBAChG;gBACD,OAAO,oBAAC,SAAS,eAAK,sCAAsC,CAAC,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAI,CAAC;aACjG;YACD,OAAO,oBAAC,uBAAuB,eAAK,8BAA8B,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAI,CAAC;QACjG,KAAK,SAAS;YACZ,OAAO,oBAAC,YAAY,eAAK,iCAAiC,CAAC,YAAY,CAAC,EAAI,CAAC;QAC/E,KAAK,QAAQ;YACX,OAAO,oBAAC,WAAW,eAAK,gCAAgC,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAI,CAAC;QACvF,KAAK,WAAW;YACd,IAAI,MAAA,MAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,0CAAG,CAAC,CAAC,0CAAE,IAAI,0CAAE,QAAQ,CAAC,OAAO,CAAC,EAAE;gBACpD,OAAO,oBAAC,UAAU,eAAK,+BAA+B,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAI,CAAC;aACpF;YACD,OAAO,sDAA6B,CAAC;QACvC;YACE,OAAO,sDAA6B,CAAC;KACxC;AACH,CAAC,CAAC,CAAC;AACH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport {\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToScatterChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n isDateArray,\n isNumberArray,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n} from './PlotlySchemaAdapter';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\n\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n plotlySchema: any;\n\n /**\n * The legends selected by the user to persist in the chart\n */\n selectedLegends?: string[];\n\n /**\n * Dictionary for localizing the accessibility labels\n */\n accesibilityLabels?: { [key: string]: string };\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>((props, forwardedRef) => {\n const { plotlySchema } = props.chartSchema;\n const xValues = plotlySchema.data[0].x;\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const colorMap = useColorMapping();\n\n switch (plotlySchema.data[0].type) {\n case 'pie':\n return <DonutChart {...transformPlotlyJsonToDonutProps(plotlySchema, colorMap)} />;\n case 'bar':\n const orientation = plotlySchema.data[0].orientation;\n if (orientation === 'h') {\n return (\n <HorizontalBarChartWithAxis {...transformPlotlyJsonToHorizontalBarWithAxisProps(plotlySchema, colorMap)} />\n );\n } else {\n if (['group', 'overlay'].includes(plotlySchema?.layout?.barmode)) {\n return <GroupedVerticalBarChart {...transformPlotlyJsonToGVBCProps(plotlySchema, colorMap)} />;\n }\n return <VerticalStackedBarChart {...transformPlotlyJsonToVSBCProps(plotlySchema, colorMap)} />;\n }\n case 'scatter':\n const isAreaChart = plotlySchema.data.some((series: any) => series.fill === 'tonexty');\n if (isXDate || isXNumber) {\n if (isAreaChart) {\n return <AreaChart {...transformPlotlyJsonToScatterChartProps(plotlySchema, true, colorMap)} />;\n }\n return <LineChart {...transformPlotlyJsonToScatterChartProps(plotlySchema, false, colorMap)} />;\n }\n return <VerticalStackedBarChart {...transformPlotlyJsonToVSBCProps(plotlySchema, colorMap)} />;\n case 'heatmap':\n return <HeatMapChart {...transformPlotlyJsonToHeatmapProps(plotlySchema)} />;\n case 'sankey':\n return <SankeyChart {...transformPlotlyJsonToSankeyProps(plotlySchema, colorMap)} />;\n case 'indicator':\n if (plotlySchema?.data?.[0]?.mode?.includes('gauge')) {\n return <GaugeChart {...transformPlotlyJsonToGaugeProps(plotlySchema, colorMap)} />;\n }\n return <div>Unsupported Schema</div>;\n default:\n return <div>Unsupported Schema</div>;\n }\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IDonutChartProps } from '../DonutChart/index';
|
|
3
|
+
import { ISankeyChartProps } from '../SankeyChart/index';
|
|
4
|
+
import { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';
|
|
5
|
+
import { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';
|
|
6
|
+
import { ILineChartProps } from '../LineChart/index';
|
|
7
|
+
import { IAreaChartProps } from '../AreaChart/index';
|
|
8
|
+
import { IHeatMapChartProps } from '../HeatMapChart/index';
|
|
9
|
+
import { IGaugeChartProps } from '../GaugeChart/index';
|
|
10
|
+
import { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';
|
|
11
|
+
export declare const isDateArray: (array: any[]) => boolean;
|
|
12
|
+
export declare const isNumberArray: (array: any[]) => boolean;
|
|
13
|
+
export declare const getColor: (legendLabel: string, colorMap: React.MutableRefObject<Map<string, string>>) => string;
|
|
14
|
+
export declare const transformPlotlyJsonToDonutProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => IDonutChartProps;
|
|
15
|
+
export declare const transformPlotlyJsonToVSBCProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => IVerticalStackedBarChartProps;
|
|
16
|
+
export declare const transformPlotlyJsonToGVBCProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => IGroupedVerticalBarChartProps;
|
|
17
|
+
export declare const transformPlotlyJsonToScatterChartProps: (jsonObj: any, isAreaChart: boolean, colorMap: React.MutableRefObject<Map<string, string>>) => ILineChartProps | IAreaChartProps;
|
|
18
|
+
export declare const transformPlotlyJsonToHorizontalBarWithAxisProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => IHorizontalBarChartWithAxisProps;
|
|
19
|
+
export declare const transformPlotlyJsonToHeatmapProps: (jsonObj: any) => IHeatMapChartProps;
|
|
20
|
+
export declare const transformPlotlyJsonToSankeyProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => ISankeyChartProps;
|
|
21
|
+
export declare const transformPlotlyJsonToGaugeProps: (jsonObj: any, colorMap: React.MutableRefObject<Map<string, string>>) => IGaugeChartProps;
|
|
22
|
+
/**
|
|
23
|
+
* Interate iteratively through the trace object and find all the array attributes.
|
|
24
|
+
* 1 trace record = 1 series of data
|
|
25
|
+
* @param trace
|
|
26
|
+
*/
|
|
27
|
+
export declare function findArrayAttributes(trace: any): void;
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { getNextColor } from '../../utilities/colors';
|
|
3
|
+
var isDate = function (value) { return !isNaN(Date.parse(value)); };
|
|
4
|
+
var isNumber = function (value) { return !isNaN(parseFloat(value)) && isFinite(value); };
|
|
5
|
+
export var isDateArray = function (array) { return isArrayOrTypedArray(array) && array.every(isDate); };
|
|
6
|
+
export var isNumberArray = function (array) { return isArrayOrTypedArray(array) && array.every(isNumber); };
|
|
7
|
+
export var getColor = function (legendLabel, colorMap) {
|
|
8
|
+
if (!colorMap.current.has(legendLabel)) {
|
|
9
|
+
var nextColor = getNextColor(colorMap.current.size + 1);
|
|
10
|
+
colorMap.current.set(legendLabel, nextColor);
|
|
11
|
+
return nextColor;
|
|
12
|
+
}
|
|
13
|
+
return colorMap.current.get(legendLabel);
|
|
14
|
+
};
|
|
15
|
+
export var transformPlotlyJsonToDonutProps = function (jsonObj, colorMap) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
18
|
+
var firstData = data[0];
|
|
19
|
+
var donutData = (_a = firstData.labels) === null || _a === void 0 ? void 0 : _a.map(function (label, index) {
|
|
20
|
+
var _a;
|
|
21
|
+
var color = getColor(label, colorMap);
|
|
22
|
+
return {
|
|
23
|
+
legend: label,
|
|
24
|
+
data: (_a = firstData.values) === null || _a === void 0 ? void 0 : _a[index],
|
|
25
|
+
color: color,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
// TODO: innerRadius as a fraction needs to be supported internally. The pixel value depends on
|
|
29
|
+
// chart dimensions, arc label dimensions and the legend container height, all of which are subject to change.
|
|
30
|
+
var width = (layout === null || layout === void 0 ? void 0 : layout.width) || 440;
|
|
31
|
+
var height = (layout === null || layout === void 0 ? void 0 : layout.height) || 220;
|
|
32
|
+
var hideLabels = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;
|
|
33
|
+
var donutMarginHorizontal = hideLabels ? 0 : 80;
|
|
34
|
+
var donutMarginVertical = 40 + (hideLabels ? 0 : 40);
|
|
35
|
+
var innerRadius = firstData.hole
|
|
36
|
+
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
|
|
37
|
+
: 0;
|
|
38
|
+
var styles = {
|
|
39
|
+
root: {
|
|
40
|
+
'[class^="arcLabel"]': {
|
|
41
|
+
fontSize: (_b = firstData.textfont) === null || _b === void 0 ? void 0 : _b.size,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
data: {
|
|
47
|
+
chartTitle: layout === null || layout === void 0 ? void 0 : layout.title,
|
|
48
|
+
chartData: donutData,
|
|
49
|
+
},
|
|
50
|
+
hideLegend: (layout === null || layout === void 0 ? void 0 : layout.showlegend) === false ? true : false,
|
|
51
|
+
width: width,
|
|
52
|
+
height: height,
|
|
53
|
+
innerRadius: innerRadius,
|
|
54
|
+
hideLabels: hideLabels,
|
|
55
|
+
showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,
|
|
56
|
+
styles: styles,
|
|
57
|
+
// TODO: Render custom hover card based on textinfo
|
|
58
|
+
// onRenderCalloutPerDataPoint: undefined,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export var transformPlotlyJsonToVSBCProps = function (jsonObj, colorMap) {
|
|
62
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
63
|
+
var mapXToDataPoints = {};
|
|
64
|
+
var yMaxValue = 0;
|
|
65
|
+
data.forEach(function (series, index1) {
|
|
66
|
+
var _a;
|
|
67
|
+
(_a = series.x) === null || _a === void 0 ? void 0 : _a.forEach(function (x, index2) {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
if (!mapXToDataPoints[x]) {
|
|
70
|
+
mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };
|
|
71
|
+
}
|
|
72
|
+
var legend = series.name || "Series ".concat(index1 + 1);
|
|
73
|
+
if (series.type === 'bar') {
|
|
74
|
+
var color = getColor(legend, colorMap);
|
|
75
|
+
mapXToDataPoints[x].chartData.push({
|
|
76
|
+
legend: legend,
|
|
77
|
+
data: (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2],
|
|
78
|
+
color: color,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else if (series.type === 'line') {
|
|
82
|
+
var color = getColor(legend, colorMap);
|
|
83
|
+
mapXToDataPoints[x].lineData.push({
|
|
84
|
+
legend: legend,
|
|
85
|
+
y: (_b = series.y) === null || _b === void 0 ? void 0 : _b[index2],
|
|
86
|
+
color: color,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
yMaxValue = Math.max(yMaxValue, (_c = series.y) === null || _c === void 0 ? void 0 : _c[index2]);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
data: Object.values(mapXToDataPoints),
|
|
94
|
+
chartTitle: layout === null || layout === void 0 ? void 0 : layout.title,
|
|
95
|
+
// width: layout?.width,
|
|
96
|
+
// height: layout?.height,
|
|
97
|
+
barWidth: 'auto',
|
|
98
|
+
yMaxValue: yMaxValue,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
// TODO: Add support for continuous x-axis in grouped vertical bar chart
|
|
102
|
+
export var transformPlotlyJsonToGVBCProps = function (jsonObj, colorMap) {
|
|
103
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
104
|
+
var mapXToDataPoints = {};
|
|
105
|
+
data.forEach(function (series, index1) {
|
|
106
|
+
var _a;
|
|
107
|
+
(_a = series.x) === null || _a === void 0 ? void 0 : _a.forEach(function (x, index2) {
|
|
108
|
+
var _a;
|
|
109
|
+
if (!mapXToDataPoints[x]) {
|
|
110
|
+
mapXToDataPoints[x] = { name: x.toString(), series: [] };
|
|
111
|
+
}
|
|
112
|
+
if (series.type === 'bar') {
|
|
113
|
+
var legend = series.name || "Series ".concat(index1 + 1);
|
|
114
|
+
var color = getColor(legend, colorMap);
|
|
115
|
+
mapXToDataPoints[x].series.push({
|
|
116
|
+
key: legend,
|
|
117
|
+
data: (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2],
|
|
118
|
+
color: color,
|
|
119
|
+
legend: legend,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
data: Object.values(mapXToDataPoints),
|
|
126
|
+
chartTitle: layout === null || layout === void 0 ? void 0 : layout.title,
|
|
127
|
+
// width: layout?.width,
|
|
128
|
+
// height: layout?.height,
|
|
129
|
+
barwidth: 'auto',
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export var transformPlotlyJsonToScatterChartProps = function (jsonObj, isAreaChart, colorMap) {
|
|
133
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
134
|
+
var chartData = data.map(function (series, index) {
|
|
135
|
+
var xValues = series.x;
|
|
136
|
+
var isString = typeof xValues[0] === 'string';
|
|
137
|
+
var isXDate = isDateArray(xValues);
|
|
138
|
+
var isXNumber = isNumberArray(xValues);
|
|
139
|
+
var legend = series.name || "Series ".concat(index + 1);
|
|
140
|
+
var lineColor = getColor(legend, colorMap);
|
|
141
|
+
return {
|
|
142
|
+
legend: legend,
|
|
143
|
+
data: xValues.map(function (x, i) { return ({
|
|
144
|
+
x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x) : x) : x,
|
|
145
|
+
y: series.y[i],
|
|
146
|
+
}); }),
|
|
147
|
+
color: lineColor,
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
var chartProps = {
|
|
151
|
+
chartTitle: layout.title || '',
|
|
152
|
+
lineChartData: chartData,
|
|
153
|
+
};
|
|
154
|
+
if (isAreaChart) {
|
|
155
|
+
return {
|
|
156
|
+
data: chartProps,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return {
|
|
161
|
+
data: chartProps,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
export var transformPlotlyJsonToHorizontalBarWithAxisProps = function (jsonObj, colorMap) {
|
|
166
|
+
var _a, _b;
|
|
167
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
168
|
+
var chartData = data
|
|
169
|
+
.map(function (series, index) {
|
|
170
|
+
return series.y.map(function (yValue, i) {
|
|
171
|
+
var color = getColor(yValue, colorMap);
|
|
172
|
+
return {
|
|
173
|
+
x: series.x[i],
|
|
174
|
+
y: yValue,
|
|
175
|
+
legend: yValue,
|
|
176
|
+
color: color,
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
})
|
|
180
|
+
.flat();
|
|
181
|
+
var chartHeight = layout.height || 350;
|
|
182
|
+
var margin = ((_a = layout.margin) === null || _a === void 0 ? void 0 : _a.l) || 0;
|
|
183
|
+
var padding = ((_b = layout.margin) === null || _b === void 0 ? void 0 : _b.pad) || 0;
|
|
184
|
+
var availableHeight = chartHeight - margin - padding;
|
|
185
|
+
var numberOfBars = data[0].y.length;
|
|
186
|
+
var gapFactor = 0.5;
|
|
187
|
+
var barHeight = availableHeight / (numberOfBars * (1 + gapFactor));
|
|
188
|
+
return {
|
|
189
|
+
data: chartData,
|
|
190
|
+
chartTitle: layout.title || '',
|
|
191
|
+
barHeight: barHeight,
|
|
192
|
+
showYAxisLables: true,
|
|
193
|
+
styles: {
|
|
194
|
+
root: {
|
|
195
|
+
height: chartHeight,
|
|
196
|
+
width: layout.width || 600,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
// FIXME: Order of string axis ticks does not match the order in plotly json
|
|
202
|
+
// TODO: Add support for custom hover card
|
|
203
|
+
export var transformPlotlyJsonToHeatmapProps = function (jsonObj) {
|
|
204
|
+
var _a, _b, _c;
|
|
205
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
206
|
+
var firstData = data[0];
|
|
207
|
+
var heatmapDataPoints = [];
|
|
208
|
+
var zMin = Number.POSITIVE_INFINITY;
|
|
209
|
+
var zMax = Number.NEGATIVE_INFINITY;
|
|
210
|
+
(_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, xIdx) {
|
|
211
|
+
var _a;
|
|
212
|
+
(_a = firstData.y) === null || _a === void 0 ? void 0 : _a.forEach(function (yVal, yIdx) {
|
|
213
|
+
var _a, _b, _c, _d;
|
|
214
|
+
var zVal = (_b = (_a = firstData.z) === null || _a === void 0 ? void 0 : _a[yIdx]) === null || _b === void 0 ? void 0 : _b[xIdx];
|
|
215
|
+
heatmapDataPoints.push({
|
|
216
|
+
x: ((_c = layout.xaxis) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? new Date(xVal) : xVal,
|
|
217
|
+
y: ((_d = layout.yaxis) === null || _d === void 0 ? void 0 : _d.type) === 'date' ? new Date(yVal) : yVal,
|
|
218
|
+
value: zVal,
|
|
219
|
+
});
|
|
220
|
+
zMin = Math.min(zMin, zVal);
|
|
221
|
+
zMax = Math.max(zMax, zVal);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
var heatmapData = {
|
|
225
|
+
legend: firstData.name || '',
|
|
226
|
+
data: heatmapDataPoints,
|
|
227
|
+
value: 0,
|
|
228
|
+
};
|
|
229
|
+
// Convert normalized values to actual values
|
|
230
|
+
var domainValuesForColorScale = (_b = firstData.colorscale) === null || _b === void 0 ? void 0 : _b.map(function (arr) { return arr[0] * (zMax - zMin) + zMin; });
|
|
231
|
+
var rangeValuesForColorScale = (_c = firstData.colorscale) === null || _c === void 0 ? void 0 : _c.map(function (arr) { return arr[1]; });
|
|
232
|
+
return {
|
|
233
|
+
data: [heatmapData],
|
|
234
|
+
domainValuesForColorScale: domainValuesForColorScale,
|
|
235
|
+
rangeValuesForColorScale: rangeValuesForColorScale,
|
|
236
|
+
hideLegend: true,
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
export var transformPlotlyJsonToSankeyProps = function (jsonObj, colorMap) {
|
|
240
|
+
var _a;
|
|
241
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
242
|
+
var _b = data[0], link = _b.link, node = _b.node;
|
|
243
|
+
var validLinks = link.value
|
|
244
|
+
.map(function (val, index) { return ({
|
|
245
|
+
value: val,
|
|
246
|
+
source: link.source[index],
|
|
247
|
+
target: link.target[index],
|
|
248
|
+
}); })
|
|
249
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
250
|
+
//@ts-expect-error Dynamic link object. Ignore for now.
|
|
251
|
+
.filter(function (x) { return x.source !== x.target; }); // Filter out self-references (circular links)
|
|
252
|
+
var sankeyChartData = {
|
|
253
|
+
nodes: node.label.map(function (label, index) {
|
|
254
|
+
var color = getColor(label, colorMap);
|
|
255
|
+
return {
|
|
256
|
+
nodeId: index,
|
|
257
|
+
name: label,
|
|
258
|
+
color: color,
|
|
259
|
+
};
|
|
260
|
+
}),
|
|
261
|
+
links: validLinks.map(function (validLink, index) {
|
|
262
|
+
return __assign({}, validLink);
|
|
263
|
+
}),
|
|
264
|
+
};
|
|
265
|
+
var width = (layout === null || layout === void 0 ? void 0 : layout.width) || 440;
|
|
266
|
+
var height = (layout === null || layout === void 0 ? void 0 : layout.height) || 220;
|
|
267
|
+
var styles = {
|
|
268
|
+
root: {
|
|
269
|
+
fontSize: (_a = layout.font) === null || _a === void 0 ? void 0 : _a.size,
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
var shouldResize = width + height;
|
|
273
|
+
return {
|
|
274
|
+
data: {
|
|
275
|
+
chartTitle: layout === null || layout === void 0 ? void 0 : layout.title,
|
|
276
|
+
SankeyChartData: sankeyChartData,
|
|
277
|
+
},
|
|
278
|
+
width: width,
|
|
279
|
+
height: height,
|
|
280
|
+
styles: styles,
|
|
281
|
+
shouldResize: shouldResize,
|
|
282
|
+
enableReflow: true,
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
export var transformPlotlyJsonToGaugeProps = function (jsonObj, colorMap) {
|
|
286
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
287
|
+
var data = jsonObj.data, layout = jsonObj.layout;
|
|
288
|
+
var firstData = data[0];
|
|
289
|
+
var segments = (_b = (_a = firstData.gauge) === null || _a === void 0 ? void 0 : _a.steps) === null || _b === void 0 ? void 0 : _b.map(function (step, index) {
|
|
290
|
+
var _a, _b;
|
|
291
|
+
var legend = step.name || "Segment ".concat(index + 1);
|
|
292
|
+
var color = getColor(legend, colorMap);
|
|
293
|
+
return {
|
|
294
|
+
legend: legend,
|
|
295
|
+
size: ((_a = step.range) === null || _a === void 0 ? void 0 : _a[1]) - ((_b = step.range) === null || _b === void 0 ? void 0 : _b[0]),
|
|
296
|
+
color: color,
|
|
297
|
+
};
|
|
298
|
+
});
|
|
299
|
+
var sublabel;
|
|
300
|
+
var sublabelColor;
|
|
301
|
+
if (typeof ((_c = firstData.delta) === null || _c === void 0 ? void 0 : _c.reference) === 'number') {
|
|
302
|
+
var diff = firstData.value - firstData.delta.reference;
|
|
303
|
+
if (diff >= 0) {
|
|
304
|
+
sublabel = "\u25B2 ".concat(diff);
|
|
305
|
+
var color = getColor(((_d = firstData.delta.increasing) === null || _d === void 0 ? void 0 : _d.color) || '', colorMap);
|
|
306
|
+
sublabelColor = color;
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
sublabel = "\u25BC ".concat(Math.abs(diff));
|
|
310
|
+
var color = getColor(((_e = firstData.delta.decreasing) === null || _e === void 0 ? void 0 : _e.color) || '', colorMap);
|
|
311
|
+
sublabelColor = color;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
var styles = {
|
|
315
|
+
sublabel: {
|
|
316
|
+
fill: sublabelColor,
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
return {
|
|
320
|
+
segments: segments,
|
|
321
|
+
chartValue: firstData.value,
|
|
322
|
+
chartTitle: (_f = firstData.title) === null || _f === void 0 ? void 0 : _f.text,
|
|
323
|
+
sublabel: sublabel,
|
|
324
|
+
// range values can be null
|
|
325
|
+
minValue: (_k = (_j = (_h = (_g = firstData.gauge) === null || _g === void 0 ? void 0 : _g.axis) === null || _h === void 0 ? void 0 : _h.range) === null || _j === void 0 ? void 0 : _j[0]) !== null && _k !== void 0 ? _k : undefined,
|
|
326
|
+
maxValue: (_p = (_o = (_m = (_l = firstData.gauge) === null || _l === void 0 ? void 0 : _l.axis) === null || _m === void 0 ? void 0 : _m.range) === null || _o === void 0 ? void 0 : _o[1]) !== null && _p !== void 0 ? _p : undefined,
|
|
327
|
+
chartValueFormat: function () { return firstData.value; },
|
|
328
|
+
width: layout === null || layout === void 0 ? void 0 : layout.width,
|
|
329
|
+
height: layout === null || layout === void 0 ? void 0 : layout.height,
|
|
330
|
+
hideLegend: true,
|
|
331
|
+
styles: styles,
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
function isTypedArray(a) {
|
|
335
|
+
return ArrayBuffer.isView(a) && !(a instanceof DataView);
|
|
336
|
+
}
|
|
337
|
+
function isArrayOrTypedArray(a) {
|
|
338
|
+
return Array.isArray(a) || isTypedArray(a);
|
|
339
|
+
}
|
|
340
|
+
function isPlainObject(obj) {
|
|
341
|
+
if (window && window.process && window.process.versions) {
|
|
342
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
343
|
+
}
|
|
344
|
+
return (Object.prototype.toString.call(obj) === '[object Object]' &&
|
|
345
|
+
Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty'));
|
|
346
|
+
}
|
|
347
|
+
var arrayAttributes = [];
|
|
348
|
+
var stack = [];
|
|
349
|
+
var isArrayStack = [];
|
|
350
|
+
var baseContainer, baseAttrName;
|
|
351
|
+
/**
|
|
352
|
+
* Interate iteratively through the trace object and find all the array attributes.
|
|
353
|
+
* 1 trace record = 1 series of data
|
|
354
|
+
* @param trace
|
|
355
|
+
*/
|
|
356
|
+
export function findArrayAttributes(trace) {
|
|
357
|
+
// Init basecontainer and baseAttrName
|
|
358
|
+
crawlIntoTrace(baseContainer, 0, '');
|
|
359
|
+
for (var _i = 0, arrayAttributes_1 = arrayAttributes; _i < arrayAttributes_1.length; _i++) {
|
|
360
|
+
var attribute = arrayAttributes_1[_i];
|
|
361
|
+
console.log(attribute);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function crawlIntoTrace(container, i, astrPartial) {
|
|
365
|
+
var item = container[stack[i]];
|
|
366
|
+
var newAstrPartial = astrPartial + stack[i];
|
|
367
|
+
if (i === stack.length - 1) {
|
|
368
|
+
if (isArrayOrTypedArray(item)) {
|
|
369
|
+
arrayAttributes.push(baseAttrName + newAstrPartial);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
if (isArrayStack[i]) {
|
|
374
|
+
if (Array.isArray(item)) {
|
|
375
|
+
for (var j = 0; j < item.length; j++) {
|
|
376
|
+
if (isPlainObject(item[j])) {
|
|
377
|
+
crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
else if (isPlainObject(item)) {
|
|
383
|
+
crawlIntoTrace(item, i + 1, newAstrPartial + '.');
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/PlotlySchemaAdapter.ts"],"names":[],"mappings":";AAuBA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,IAAM,MAAM,GAAG,UAAC,KAAU,IAAc,OAAA,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAzB,CAAyB,CAAC;AAClE,IAAM,QAAQ,GAAG,UAAC,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AAE,EAAE,CAAC,CAAC;IACrC,KAAwB,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe,EAAE;QAApC,IAAM,SAAS,wBAAA;QAClB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACxB;AACH,CAAC;AAED,SAAS,cAAc,CAAC,SAAc,EAAE,CAAS,EAAE,WAAgB;IACjE,IAAI,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,cAAc,GAAG,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1B,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE;YAC7B,eAAe,CAAC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC;SACrD;KACF;SAAM;QACL,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE;YACnB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACpC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;wBAC1B,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;qBACjE;iBACF;aACF;SACF;aAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE;YAC9B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;SACnD;KACF;AACH,CAAC","sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { IDonutChartProps } from '../DonutChart/index';\nimport {\n IChartDataPoint,\n IChartProps,\n IHorizontalBarChartWithAxisDataPoint,\n ILineChartPoints,\n IVerticalStackedChartProps,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IGroupedVerticalBarChartData,\n} from '../../types/IDataPoint';\nimport { ISankeyChartProps } from '../SankeyChart/index';\nimport { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';\nimport { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';\nimport { ILineChartProps } from '../LineChart/index';\nimport { IAreaChartProps } from '../AreaChart/index';\nimport { IHeatMapChartProps } from '../HeatMapChart/index';\nimport { getNextColor } from '../../utilities/colors';\nimport { IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index';\nimport { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';\n\nconst isDate = (value: any): boolean => !isNaN(Date.parse(value));\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\nexport const isDateArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isDate);\nexport const isNumberArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isNumber);\n\nexport const getColor = (legendLabel: string, colorMap: React.MutableRefObject<Map<string, string>>): string => {\n if (!colorMap.current.has(legendLabel)) {\n const nextColor = getNextColor(colorMap.current.size + 1);\n colorMap.current.set(legendLabel, nextColor);\n return nextColor;\n }\n\n return colorMap.current.get(legendLabel) as string;\n};\n\nexport const transformPlotlyJsonToDonutProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IDonutChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap);\n return {\n legend: label,\n data: firstData.values?.[index],\n color,\n };\n });\n\n // TODO: innerRadius as a fraction needs to be supported internally. The pixel value depends on\n // chart dimensions, arc label dimensions and the legend container height, all of which are subject to change.\n const width: number = layout?.width || 440;\n const height: number = layout?.height || 220;\n const hideLabels = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;\n const donutMarginHorizontal = hideLabels ? 0 : 80;\n const donutMarginVertical = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n\n const styles: IDonutChartProps['styles'] = {\n root: {\n '[class^=\"arcLabel\"]': {\n fontSize: firstData.textfont?.size,\n },\n },\n };\n\n return {\n data: {\n chartTitle: layout?.title,\n chartData: donutData,\n },\n hideLegend: layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,\n styles,\n // TODO: Render custom hover card based on textinfo\n // onRenderCalloutPerDataPoint: undefined,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IVerticalStackedBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = series.name || `Series ${index1 + 1}`;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: series.y?.[index2],\n color,\n });\n } else if (series.type === 'line') {\n const color = getColor(legend, colorMap);\n mapXToDataPoints[x].lineData!.push({\n legend,\n y: series.y?.[index2],\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, series.y?.[index2]);\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n };\n};\n\n// TODO: Add support for continuous x-axis in grouped vertical bar chart\nexport const transformPlotlyJsonToGVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IGroupedVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = series.name || `Series ${index1 + 1}`;\n const color = getColor(legend, colorMap);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: series.y?.[index2],\n color,\n legend,\n });\n }\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n jsonObj: any,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): ILineChartProps | IAreaChartProps => {\n const { data, layout } = jsonObj;\n\n const chartData: ILineChartPoints[] = data.map((series: any, index: number) => {\n const xValues = series.x;\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend = series.name || `Series ${index + 1}`;\n const lineColor = getColor(legend, colorMap);\n\n return {\n legend,\n data: xValues.map((x: string | number, i: number) => ({\n x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n };\n });\n\n const chartProps: IChartProps = {\n chartTitle: layout.title || '',\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n } as IAreaChartProps;\n } else {\n return {\n data: chartProps,\n } as ILineChartProps;\n }\n};\n\nexport const transformPlotlyJsonToHorizontalBarWithAxisProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IHorizontalBarChartWithAxisProps => {\n const { data, layout } = jsonObj;\n\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = data\n .map((series: any, index: number) => {\n return series.y.map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n };\n });\n })\n .flat();\n\n const chartHeight = layout.height || 350;\n const margin = layout.margin?.l || 0;\n const padding = layout.margin?.pad || 0;\n const availableHeight = chartHeight - margin - padding;\n const numberOfBars = data[0].y.length;\n const gapFactor = 0.5;\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n return {\n data: chartData,\n chartTitle: layout.title || '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: layout.width || 600,\n },\n },\n };\n};\n\n// FIXME: Order of string axis ticks does not match the order in plotly json\n// TODO: Add support for custom hover card\nexport const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n firstData.x?.forEach((xVal: any, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = firstData.z?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: layout.xaxis?.type === 'date' ? new Date(xVal) : xVal,\n y: layout.yaxis?.type === 'date' ? new Date(yVal) : yVal,\n value: zVal,\n });\n\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: firstData.name || '',\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Convert normalized values to actual values\n const domainValuesForColorScale: number[] = firstData.colorscale?.map((arr: any) => arr[0] * (zMax - zMin) + zMin);\n const rangeValuesForColorScale: string[] = firstData.colorscale?.map((arr: any) => arr[1]);\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): ISankeyChartProps => {\n const { data, layout } = jsonObj;\n const { link, node } = data[0];\n const validLinks = link.value\n .map((val: number, index: number) => ({\n value: val,\n source: link.source[index],\n target: link.target[index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n //@ts-expect-error Dynamic link object. Ignore for now.\n .filter(x => x.source !== x.target); // Filter out self-references (circular links)\n\n const sankeyChartData = {\n nodes: node.label.map((label: string, index: number) => {\n const color = getColor(label, colorMap);\n\n return {\n nodeId: index,\n name: label,\n color,\n };\n }),\n links: validLinks.map((validLink: any, index: number) => {\n return {\n ...validLink,\n };\n }),\n };\n\n const width: number = layout?.width || 440;\n const height: number = layout?.height || 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n fontSize: layout.font?.size,\n },\n };\n const shouldResize: number = width + height;\n return {\n data: {\n chartTitle: layout?.title,\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IGaugeChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const segments = firstData.gauge?.steps?.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n });\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (typeof firstData.delta?.reference === 'number') {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColor(firstData.delta.increasing?.color || '', colorMap);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColor(firstData.delta.decreasing?.color || '', colorMap);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n return {\n segments,\n chartValue: firstData.value,\n chartTitle: firstData.title?.text,\n sublabel,\n // range values can be null\n minValue: firstData.gauge?.axis?.range?.[0] ?? undefined,\n maxValue: firstData.gauge?.axis?.range?.[1] ?? undefined,\n chartValueFormat: () => firstData.value,\n width: layout?.width,\n height: layout?.height,\n hideLegend: true,\n styles,\n };\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nfunction isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n for (const attribute of arrayAttributes) {\n console.log(attribute);\n }\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -37,4 +37,6 @@ export { DataVizPalette, getColorFromToken, getNextColor } from './utilities/col
|
|
|
37
37
|
export { DataVizGradientPalette, getGradientFromToken, getNextGradient } from './utilities/gradients';
|
|
38
38
|
export type { IGaugeChartProps, IGaugeChartSegment, IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart';
|
|
39
39
|
export { GaugeChart, GaugeChartVariant, GaugeValueFormat } from './GaugeChart';
|
|
40
|
+
export type { DeclarativeChartProps, Schema } from './DeclarativeChart';
|
|
41
|
+
export { DeclarativeChart } from './DeclarativeChart';
|
|
40
42
|
import './version';
|