@hitachivantara/uikit-react-viz 5.15.25 → 5.15.26
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/dist/types/index.d.ts +12 -0
- package/package.json +4 -4
- package/dist/esm/BarChart/BarChart.js.map +0 -1
- package/dist/esm/BaseChart/BaseChart.js.map +0 -1
- package/dist/esm/Boxplot/Boxplot.js.map +0 -1
- package/dist/esm/Boxplot/Boxplot.styles.js.map +0 -1
- package/dist/esm/Boxplot/useBoxplot.js.map +0 -1
- package/dist/esm/Boxplot/useBoxplotData.js.map +0 -1
- package/dist/esm/ConfusionMatrix/ConfusionMatrix.js.map +0 -1
- package/dist/esm/ConfusionMatrix/ConfusionMatrix.styles.js.map +0 -1
- package/dist/esm/ConfusionMatrix/utils.js.map +0 -1
- package/dist/esm/DonutChart/DonutChart.js.map +0 -1
- package/dist/esm/Heatmap/Heatmap.js.map +0 -1
- package/dist/esm/Heatmap/Heatmap.styles.js.map +0 -1
- package/dist/esm/LineChart/LineChart.js.map +0 -1
- package/dist/esm/ScatterPlot/ScatterPlot.js.map +0 -1
- package/dist/esm/Treemap/Treemap.js.map +0 -1
- package/dist/esm/hooks/tooltip/styles.js.map +0 -1
- package/dist/esm/hooks/tooltip/useTooltip.js.map +0 -1
- package/dist/esm/hooks/useData.js.map +0 -1
- package/dist/esm/hooks/useDataZoom.js.map +0 -1
- package/dist/esm/hooks/useDataset.js.map +0 -1
- package/dist/esm/hooks/useGrid.js.map +0 -1
- package/dist/esm/hooks/useLegend.js.map +0 -1
- package/dist/esm/hooks/useOption.js.map +0 -1
- package/dist/esm/hooks/useSeries.js.map +0 -1
- package/dist/esm/hooks/useVisualMap.js.map +0 -1
- package/dist/esm/hooks/useVizTheme.js.map +0 -1
- package/dist/esm/hooks/useXAxis.js.map +0 -1
- package/dist/esm/hooks/useYAxis.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/providers/Provider.js.map +0 -1
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/registerTheme.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -603,3 +603,15 @@ declare interface YAxis extends HvChartYAxis {
|
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
export { }
|
|
606
|
+
|
|
607
|
+
declare namespace _default {
|
|
608
|
+
function process(sourceText: any, sourcePath: any): {
|
|
609
|
+
code: string;
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare namespace _default {
|
|
614
|
+
function process(sourceText: any, sourcePath: any): {
|
|
615
|
+
code: string;
|
|
616
|
+
};
|
|
617
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-viz",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Contributed React visualization components for the NEXT UI Kit.",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"react-dom": ">=17.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hitachivantara/uikit-react-utils": "^0.2.
|
|
37
|
-
"@hitachivantara/uikit-styles": "^5.
|
|
36
|
+
"@hitachivantara/uikit-react-utils": "^0.2.33",
|
|
37
|
+
"@hitachivantara/uikit-styles": "^5.46.0"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public",
|
|
44
44
|
"directory": "package"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "d96b3d461f5676cf95f4321fd9a3104874814fc3",
|
|
47
47
|
"exports": {
|
|
48
48
|
".": {
|
|
49
49
|
"types": "./dist/types/index.d.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","sources":["../../../src/BarChart/BarChart.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { BarChart } from \"echarts/charts\";\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n DataZoomSliderComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n HvChartTooltipClasses,\n useData,\n useDataset,\n useDataZoom,\n useGrid,\n useLegend,\n useOption,\n useSeries,\n useTooltip,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport { HvBarChartMeasures } from \"../types\";\nimport {\n Arrayable,\n HvAxisChartCommonProps,\n HvChartCommonProps,\n} from \"../types/common\";\n\n// Register chart components\necharts.use([\n BarChart,\n DatasetComponent,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n DataZoomSliderComponent,\n DataZoomInsideComponent,\n MarkLineComponent,\n]);\n\nexport interface HvBarChartClasses extends HvChartTooltipClasses {}\n\nexport interface HvBarChartProps\n extends HvAxisChartCommonProps,\n HvChartCommonProps {\n /** Columns to measure on the chart. */\n measures: Arrayable<HvBarChartMeasures>;\n /** Whether the bar chart should be horizontal. Defaults to `false`. */\n horizontal?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBarChartClasses;\n}\n\n/**\n * A bar chart is a chart or graph that presents categorical data with rectangular bars.\n */\nexport const HvBarChart = forwardRef<ReactECharts, HvBarChartProps>(\n function HvBarChart(props, ref) {\n const {\n yAxis,\n xAxis,\n horizontal = false,\n horizontalRangeSlider,\n grid,\n data,\n groupBy,\n splitBy,\n sortBy,\n filters,\n stack,\n seriesNameFormatter,\n measures,\n legend,\n tooltip,\n classes,\n height,\n width,\n onOptionChange,\n ...others\n } = props;\n\n const { data: chartData, mapping: measuresMapping } = useData({\n data,\n groupBy,\n sortBy,\n splitBy,\n measures,\n filters,\n });\n\n const chartDataset = useDataset(chartData);\n\n const chartYAxis = useYAxis({\n axes: Array.isArray(yAxis) || yAxis == null ? yAxis : [yAxis],\n defaultType: horizontal ? \"categorical\" : \"continuous\",\n });\n\n const chartXAxis = useXAxis({\n type: horizontal ? \"continuous\" : \"categorical\",\n ...xAxis,\n });\n\n const chartSlider = useDataZoom({\n showHorizontal: horizontalRangeSlider?.show,\n });\n\n const chartGrid = useGrid({ ...grid });\n\n const chartSeries = useSeries({\n type: \"bar\",\n data: chartData,\n groupBy,\n measuresMapping,\n stack,\n nameFormatter: seriesNameFormatter,\n horizontal,\n });\n\n const chartLegend = useLegend({\n ...legend,\n series: chartSeries.series,\n icon: \"square\",\n });\n\n const chartTooltip = useTooltip({\n ...tooltip,\n trigger: \"axis\",\n measuresMapping,\n classes,\n horizontal,\n });\n\n const option = useOption({\n option: {\n ...chartYAxis,\n ...chartXAxis,\n ...chartSlider,\n ...chartGrid,\n ...chartDataset,\n ...chartSeries,\n ...chartLegend,\n ...chartTooltip,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvBarChart"],"mappings":";;;;;;;;;;;;;;;;AAoCA,QAAQ,IAAI;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAkBM,MAAM,aAAa;AAAA,EACxB,SAASA,YAAW,OAAO,KAAK;AACxB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAEJ,UAAM,EAAE,MAAM,WAAW,SAAS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
{"version":3,"file":"BaseChart.js","sources":["../../../src/BaseChart/BaseChart.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { useForkRef } from \"@mui/material/utils\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { AriaComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { CanvasRenderer } from \"echarts/renderers\";\n\nimport { useVizTheme } from \"../hooks\";\nimport { HvChartCommonProps, HvEChartsOption } from \"../types/common\";\n\n// Register chart components\necharts.use([CanvasRenderer, AriaComponent]);\n\nexport interface HvBaseChartProps extends Pick<HvChartCommonProps, \"onEvents\"> {\n /** ECharts option. */\n option: HvEChartsOption;\n /** Charts width. */\n width?: echarts.ResizeOpts[\"width\"];\n /** Charts height. */\n height?: echarts.ResizeOpts[\"height\"];\n}\n\n/**\n * Base chart.\n */\nexport const HvBaseChart = forwardRef<ReactECharts, HvBaseChartProps>(\n function HvBaseChart(props, ref) {\n const { option, width, height, onEvents, ...others } = props;\n\n const { theme, activeTheme } = useVizTheme();\n\n const currentTheme = useRef<string | undefined>(theme);\n const chartRef = useRef<ReactECharts>(null);\n\n const forkedRef = useForkRef<ReactECharts>(ref, chartRef);\n\n const [initialOption, setInitialOption] = useState<HvEChartsOption>(option);\n\n // Dispose the instance of the chart when the component unmounts. This ensures that\n // the chart theme will update when the theme changes.\n useEffect(() => {\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n return () => {\n instance.dispose();\n };\n }, [activeTheme]);\n\n useEffect(() => {\n // When the theme changes echarts destroys the chart and mounts it again\n // thus we need to reset the initial option\n if (theme !== currentTheme.current) {\n setInitialOption(option);\n currentTheme.current = theme;\n return;\n }\n\n const instance = chartRef.current?.getEchartsInstance();\n\n if (!instance) return;\n\n // More info: https://echarts.apache.org/en/api.html#echartsInstance.setOption\n instance.setOption(option, {\n replaceMerge: [\"xAxis\", \"yAxis\", \"series\", \"dataset\", \"dataZoom\"],\n });\n }, [theme, option]);\n\n return (\n <ReactECharts\n ref={forkedRef}\n echarts={echarts}\n option={initialOption}\n theme={theme}\n notMerge // When true all the current components will be removed and new components will be created according to the new option\n style={{\n width: width ?? \"100%\",\n height: height ?? \"100%\",\n }}\n onEvents={onEvents}\n {...others}\n />\n );\n },\n);\n"],"names":["HvBaseChart"],"mappings":";;;;;;;;AAWA,QAAQ,IAAI,CAAC,gBAAgB,aAAa,CAAC;AAcpC,MAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,KAAK;AAC/B,UAAM,EAAE,QAAQ,OAAO,QAAQ,UAAU,GAAG,WAAW;AAEvD,UAAM,EAAE,OAAO,YAAY,IAAI,YAAY;AAErC,UAAA,eAAe,OAA2B,KAAK;AAC/C,UAAA,WAAW,OAAqB,IAAI;AAEpC,UAAA,YAAY,WAAyB,KAAK,QAAQ;AAExD,UAAM,CAAC,eAAe,gBAAgB,IAAI,SAA0B,MAAM;AAI1E,cAAU,MAAM;AACR,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC,SAAU;AAEf,aAAO,MAAM;AACX,iBAAS,QAAQ;AAAA,MACnB;AAAA,IAAA,GACC,CAAC,WAAW,CAAC;AAEhB,cAAU,MAAM;AAGV,UAAA,UAAU,aAAa,SAAS;AAClC,yBAAiB,MAAM;AACvB,qBAAa,UAAU;AACvB;AAAA,MAAA;AAGI,YAAA,WAAW,SAAS,SAAS,mBAAmB;AAEtD,UAAI,CAAC,SAAU;AAGf,eAAS,UAAU,QAAQ;AAAA,QACzB,cAAc,CAAC,SAAS,SAAS,UAAU,WAAW,UAAU;AAAA,MAAA,CACjE;AAAA,IAAA,GACA,CAAC,OAAO,MAAM,CAAC;AAGhB,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA,UAAQ;AAAA,QACR,OAAO;AAAA,UACL,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,QACpB;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Boxplot.js","sources":["../../../src/Boxplot/Boxplot.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { BoxplotChart } from \"echarts/charts\";\nimport { TooltipComponent, VisualMapComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n useGrid,\n useLegend,\n useOption,\n useTooltip,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport { HvBoxplotMeasure, HvChartTooltip } from \"../types\";\nimport {\n Arrayable,\n HvAxisChartCommonProps,\n HvChartCommonProps,\n} from \"../types/common\";\nimport { useClasses } from \"./Boxplot.styles\";\nimport { useBoxplot } from \"./useBoxplot\";\n\n// Register chart components\necharts.use([BoxplotChart, TooltipComponent, VisualMapComponent]);\n\nexport type HvBoxplotClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBoxplotProps\n extends Omit<\n HvAxisChartCommonProps,\n \"splitBy\" | \"horizontalRangeSlider\" | \"seriesNameFormatter\" | \"stack\"\n >,\n Omit<HvChartCommonProps, \"groupBy\" | \"sortBy\"> {\n /** The name of the heatmap */\n name?: string;\n /** Columns to measure on the chart. */\n measures: Arrayable<HvBoxplotMeasure>;\n /** Columns to use to group the data. */\n groupBy?: string;\n /** The tooltip options. */\n tooltip?: Omit<HvChartTooltip, \"type\" | \"valueFormatter\" | \"titleFormatter\">;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBoxplotClasses;\n}\n\n/**\n * A Boxplot chart visually summarizes the distribution of a dataset by depicting key statistical measures such as the median, quartiles, and outliers.\n */\nexport const HvBoxplot = forwardRef<ReactECharts, HvBoxplotProps>(\n function HvBoxplot(props, ref) {\n const {\n name,\n data,\n xAxis,\n yAxis,\n grid,\n legend,\n measures,\n groupBy,\n tooltip,\n width,\n height,\n filters,\n classes: classesProp,\n onOptionChange,\n ...others\n } = props;\n\n const { classes } = useClasses(classesProp);\n\n const chartTooltip = useTooltip({\n component: (params) => {\n const title = params?.title;\n const upper = params?.value?.[5];\n const q3 = params?.value?.[4];\n const median = params?.value?.[3];\n const q1 = params?.value?.[2];\n const lower = params?.value?.[1];\n\n return `\n <div class=\"${classes.tooltipRoot}\">\n <div class=\"${classes.tooltipContainer}\">\n <div>\n <p class=\"${classes.tooltipText}\">${title}</p>\n <p class=\"${classes.tooltipText}\">Upper: ${upper}</p>\n <p class=\"${classes.tooltipText}\">Q3: ${q3}</p>\n <p class=\"${classes.tooltipText}\">Median: ${median}</p>\n <p class=\"${classes.tooltipText}\">Q1: ${q1}</p>\n <p class=\"${classes.tooltipText}\">Lower: ${lower}</p>\n </div>\n </div>\n </div>`;\n },\n ...tooltip,\n });\n\n const chartGrid = useGrid({ ...grid });\n\n const chartLegend = useLegend({\n ...legend,\n icon: \"square\",\n });\n\n const chartXAxis = useXAxis({\n ...xAxis,\n });\n\n const chartYAxis = useYAxis({\n axes: Array.isArray(yAxis) || yAxis == null ? yAxis : [yAxis],\n defaultType: \"continuous\",\n ...yAxis,\n });\n\n const chartBoxplot = useBoxplot({ data, groupBy, measures, filters });\n\n const chartOption = useOption({\n option: {\n ...chartBoxplot,\n ...chartGrid,\n ...chartLegend,\n ...chartTooltip,\n ...chartXAxis,\n ...chartYAxis,\n },\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={chartOption}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvBoxplot"],"mappings":";;;;;;;;;;;;;;AA0BA,QAAQ,IAAI,CAAC,cAAc,kBAAkB,kBAAkB,CAAC;AAyBzD,MAAM,YAAY;AAAA,EACvB,SAASA,WAAU,OAAO,KAAK;AACvB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AA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AAS;AAEpE,UAAM,cAAc,UAAU;AAAA,MAC5B,QAAQ;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,MAAA;AAAA,IACL,CACD;AAGC,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Boxplot.styles.js","sources":["../../../src/Boxplot/Boxplot.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvBoxplot\", {\n tooltipRoot: {\n backgroundColor: theme.colors.atmo1,\n width: \"fit-content\",\n minWidth: 150,\n boxShadow: theme.colors.shadow,\n zIndex: theme.zIndices.sticky,\n },\n tooltipContainer: {\n padding: theme.spacing(\"15px\", \"sm\"),\n display: \"flex\",\n flexDirection: \"column\",\n },\n tooltipText: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,aAAa;AAAA,EACtE,aAAa;AAAA,IACX,iBAAiB,MAAM,OAAO;AAAA,IAC9B,OAAO;AAAA,IACP,UAAU;AAAA,IACV,WAAW,MAAM,OAAO;AAAA,IACxB,QAAQ,MAAM,SAAS;AAAA,EACzB;AAAA,EACA,kBAAkB;AAAA,IAChB,SAAS,MAAM,QAAQ,QAAQ,IAAI;AAAA,IACnC,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,aAAa;AAAA,IACX,YAAY,MAAM,WAAW;AAAA,IAC7B,YAAY,MAAM,YAAY;AAAA,IAC9B,UAAU,MAAM,UAAU;AAAA,IAC1B,OAAO,MAAM,OAAO;AAAA,EAAA;AAExB,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBoxplot.js","sources":["../../../src/Boxplot/useBoxplot.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvBoxplotMeasure, HvChartData, HvChartFilter } from \"../types\";\nimport { Arrayable } from \"../types/common\";\nimport { useBoxplotData } from \"./useBoxplotData\";\n\ninterface HvDataHookProps {\n data: HvChartData;\n groupBy?: string;\n measures: Arrayable<HvBoxplotMeasure>;\n filters?: Arrayable<HvChartFilter>;\n}\n\nexport const useBoxplot = ({\n data,\n groupBy,\n measures,\n filters,\n}: HvDataHookProps) => {\n const measuresFields = useMemo(() => {\n if (measures == null) return {};\n if (typeof measures === \"string\") return { [measures]: undefined };\n if (Array.isArray(measures)) {\n return measures.reduce<{ [key: string]: string | undefined }>(\n (acc, value) => {\n const field = typeof value === \"string\" ? value : value.field;\n acc[field] = typeof value === \"string\" ? undefined : value.yAxis;\n return acc;\n },\n {},\n );\n }\n return { [measures.field]: measures.yAxis };\n }, [measures]);\n\n const chartData = useBoxplotData({\n data,\n groupBy,\n measures: measuresFields,\n filters,\n });\n\n const boxplotData = useMemo(() => {\n const setData: Record<string, any[]> = {};\n Object.keys(measuresFields).forEach((m) => {\n setData[m] = [];\n Object.keys(chartData).forEach((key) => {\n setData[m].push(chartData[key][m]);\n });\n });\n\n const sources: any[] = [];\n const transforms: any[] = [];\n const series: any[] = [];\n\n Object.keys(measuresFields).forEach((m, index) => {\n sources.push({\n source: setData[m],\n id: m,\n });\n transforms.push({\n fromDatasetId: m,\n transform: {\n type: \"boxplot\",\n config: {\n itemNameFormatter: (params: any) =>\n Object.keys(chartData)[params.value],\n },\n },\n });\n series.push({\n name: m,\n type: \"boxplot\",\n datasetIndex: Object.keys(measuresFields).length + index,\n yAxisId: measuresFields[m],\n });\n });\n\n const datasets = {\n dataset: [...sources, ...transforms],\n series,\n };\n\n return datasets;\n }, [chartData, measuresFields]);\n\n return boxplotData;\n};\n"],"names":[],"mappings":";;AAaO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACf,QAAA,iBAAiB,QAAQ,MAAM;AAC/B,QAAA,YAAY,KAAM,QAAO,CAAC;AAC1B,QAAA,OAAO,aAAa,SAAU,QAAO,EAAE,CAAC,QAAQ,GAAG,OAAU;AAC7D,QAAA,MAAM,QAAQ,QAAQ,GAAG;AAC3B,aAAO,SAAS;AAAA,QACd,CAAC,KAAK,UAAU;AACd,gBAAM,QAAQ,OAAO,UAAU,WAAW,QAAQ,MAAM;AACxD,cAAI,KAAK,IAAI,OAAO,UAAU,WAAW,SAAY,MAAM;AACpD,iBAAA;AAAA,QACT;AAAA,QACA,CAAA;AAAA,MACF;AAAA,IAAA;AAEF,WAAO,EAAE,CAAC,SAAS,KAAK,GAAG,SAAS,MAAM;AAAA,EAAA,GACzC,CAAC,QAAQ,CAAC;AAEb,QAAM,YAAY,eAAe;AAAA,IAC/B;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,EAAA,CACD;AAEK,QAAA,cAAc,QAAQ,MAAM;AAChC,UAAM,UAAiC,CAAC;AACxC,WAAO,KAAK,cAAc,EAAE,QAAQ,CAAC,MAAM;AACjC,cAAA,CAAC,IAAI,CAAC;AACd,aAAO,KAAK,SAAS,EAAE,QAAQ,CAAC,QAAQ;AACtC,gBAAQ,CAAC,EAAE,KAAK,UAAU,GAAG,EAAE,CAAC,CAAC;AAAA,MAAA,CAClC;AAAA,IAAA,CACF;AAED,UAAM,UAAiB,CAAC;AACxB,UAAM,aAAoB,CAAC;AAC3B,UAAM,SAAgB,CAAC;AAEvB,WAAO,KAAK,cAAc,EAAE,QAAQ,CAAC,GAAG,UAAU;AAChD,cAAQ,KAAK;AAAA,QACX,QAAQ,QAAQ,CAAC;AAAA,QACjB,IAAI;AAAA,MAAA,CACL;AACD,iBAAW,KAAK;AAAA,QACd,eAAe;AAAA,QACf,WAAW;AAAA,UACT,MAAM;AAAA,UACN,QAAQ;AAAA,YACN,mBAAmB,CAAC,WAClB,OAAO,KAAK,SAAS,EAAE,OAAO,KAAK;AAAA,UAAA;AAAA,QACvC;AAAA,MACF,CACD;AACD,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc,OAAO,KAAK,cAAc,EAAE,SAAS;AAAA,QACnD,SAAS,eAAe,CAAC;AAAA,MAAA,CAC1B;AAAA,IAAA,CACF;AAED,UAAM,WAAW;AAAA,MACf,SAAS,CAAC,GAAG,SAAS,GAAG,UAAU;AAAA,MACnC;AAAA,IACF;AAEO,WAAA;AAAA,EAAA,GACN,CAAC,WAAW,cAAc,CAAC;AAEvB,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBoxplotData.js","sources":["../../../src/Boxplot/useBoxplotData.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { escape } from \"arquero\";\n\nimport { HvChartData, HvChartFilter } from \"../types\";\nimport { Arrayable } from \"../types/common\";\nimport {\n getHvArqueroCombinedFilters,\n normalizeColumnName,\n processTableData,\n} from \"../utils\";\n\ninterface HvDataHookProps {\n data: HvChartData;\n groupBy?: string;\n measures: { [key: string]: string | undefined };\n filters?: Arrayable<HvChartFilter>;\n}\n\nexport const useBoxplotData = ({\n data,\n groupBy: groupByProp,\n measures,\n filters: filtersProp,\n}: HvDataHookProps) => {\n const chartData = useMemo(() => {\n // Converting data to arquero table data and normalizing the columns name\n const { data: processedData } = processTableData(data);\n let tableData = processedData;\n\n // Filter data right away\n if (filtersProp) {\n const filters = (\n Array.isArray(filtersProp) ? filtersProp : [filtersProp]\n ).map((filter) => ({\n ...filter,\n field: normalizeColumnName(filter.field), // normalize\n }));\n\n tableData = tableData.filter(\n escape((row: any) => getHvArqueroCombinedFilters(row, filters)),\n );\n }\n\n const normalizedGroupBy = normalizeColumnName(groupByProp || \"\"); // normalize\n const uniqueGroupBy = new Set(\n tableData.array(normalizedGroupBy) as string[],\n );\n\n const results: Record<string, Record<string, any[]>> = {};\n uniqueGroupBy.forEach((group) => {\n results[group] = {};\n Object.keys(measures).forEach((measure) => {\n results[group][measure] = tableData\n .params({ group, groupBy: normalizedGroupBy })\n .filter((d: any, $: any) => d[$.groupBy] === $.group)\n .array(normalizeColumnName(measure)); // normalize\n });\n });\n\n return results;\n }, [data, filtersProp, groupByProp, measures]);\n\n return chartData;\n};\n"],"names":[],"mappings":";;;AAkBO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,SAAS;AACX,MAAuB;AACf,QAAA,YAAY,QAAQ,MAAM;AAE9B,UAAM,EAAE,MAAM,kBAAkB,iBAAiB,IAAI;AACrD,QAAI,YAAY;AAGhB,QAAI,aAAa;AACT,YAAA,WACJ,MAAM,QAAQ,WAAW,IAAI,cAAc,CAAC,WAAW,GACvD,IAAI,CAAC,YAAY;AAAA,QACjB,GAAG;AAAA,QACH,OAAO,oBAAoB,OAAO,KAAK;AAAA;AAAA,MAAA,EACvC;AAEF,kBAAY,UAAU;AAAA,QACpB,OAAO,CAAC,QAAa,4BAA4B,KAAK,OAAO,CAAC;AAAA,MAChE;AAAA,IAAA;AAGI,UAAA,oBAAoB,oBAAoB,eAAe,EAAE;AAC/D,UAAM,gBAAgB,IAAI;AAAA,MACxB,UAAU,MAAM,iBAAiB;AAAA,IACnC;AAEA,UAAM,UAAiD,CAAC;AAC1C,kBAAA,QAAQ,CAAC,UAAU;AACvB,cAAA,KAAK,IAAI,CAAC;AAClB,aAAO,KAAK,QAAQ,EAAE,QAAQ,CAAC,YAAY;AACjC,gBAAA,KAAK,EAAE,OAAO,IAAI,UACvB,OAAO,EAAE,OAAO,SAAS,kBAAkB,CAAC,EAC5C,OAAO,CAAC,GAAQ,MAAW,EAAE,EAAE,OAAO,MAAM,EAAE,KAAK,EACnD,MAAM,oBAAoB,OAAO,CAAC;AAAA,MAAA,CACtC;AAAA,IAAA,CACF;AAEM,WAAA;AAAA,KACN,CAAC,MAAM,aAAa,aAAa,QAAQ,CAAC;AAEtC,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfusionMatrix.js","sources":["../../../src/ConfusionMatrix/ConfusionMatrix.tsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { HeatmapChart } from \"echarts/charts\";\nimport {\n GridComponent,\n TooltipComponent,\n VisualMapComponent,\n} from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\nimport { HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n HvVisualMapHookProps,\n useData,\n useGrid,\n useOption,\n useTooltip,\n useVisualMap,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport {\n Arrayable,\n HvChartCommonProps,\n HvChartXAxis,\n HvChartYAxis,\n} from \"../types/common\";\nimport { HvConfusionMatrixMeasure } from \"../types/measures\";\nimport { HvChartTooltip } from \"../types/tooltip\";\nimport { getGroupKey } from \"../utils\";\nimport { useClasses } from \"./ConfusionMatrix.styles\";\nimport {\n HvConfusionMatrixColorScale,\n HvConfusionMatrixFormat,\n HvConfusionMatrixValuesProps,\n} from \"./types\";\nimport { useColorScale, useGridLayout, useSeries } from \"./utils\";\n\n// Register chart components\necharts.use([\n HeatmapChart,\n VisualMapComponent,\n GridComponent,\n TooltipComponent,\n]);\n\nexport type HvConfusionMatrixClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvConfusionMatrixProps\n extends Omit<HvChartCommonProps, \"tooltip\"> {\n /** Column to measure. */\n measure: HvConfusionMatrixMeasure;\n /** Columns to use to split the measure. */\n splitBy?: Arrayable<string>;\n /**\n * Column to use for the delta confusion matrix.\n *\n * It can be set to `true` in case the `measure` already has the calculations for the delta confusion matrix.\n */\n delta?: boolean | string;\n /** Options for the xAxis, i.e. the horizontal axis. */\n xAxis?: HvChartXAxis;\n /** Options for the yAxis, i.e. the vertical axis. */\n yAxis?: HvChartYAxis;\n /** Tooltip options. */\n tooltip?: Omit<HvChartTooltip, \"type\">;\n /** Format of the confusion matrix. Defaults to `square`. */\n format?: HvConfusionMatrixFormat;\n /** Properties to customize the prediction values. */\n valuesProps?: HvConfusionMatrixValuesProps;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvConfusionMatrixClasses;\n /**\n * Color scale of the confusion matrix.\n *\n * If an array of two strings is provided, the first and second values are the lower and upper ends of the scale, respectively.\n * An array of objects can also be used to create a custom scale.\n * If `delta` is not provided, a default color scale is used when `colorScale` is not defined: `[base-light, cat3]`.\n */\n colorScale?: [HvColorAny, HvColorAny] | HvConfusionMatrixColorScale[];\n}\n\n/**\n * Confusion Matrix is a table displaying the performance of a predictive model.\n * Typically the columns show the predicted class and the rows the expected class.\n * The main diagonal counts the positive matches while the cells outside it count the mismatches between predicted and expected.\n */\nexport const HvConfusionMatrix = forwardRef<\n ReactECharts,\n HvConfusionMatrixProps\n>(function HvConfusionMatrix(props, ref) {\n const {\n legend,\n groupBy,\n measure,\n sortBy,\n splitBy,\n filters,\n grid,\n data: dataProp,\n tooltip,\n xAxis,\n yAxis,\n colorScale: colorScaleProp,\n delta,\n valuesProps,\n width,\n height,\n format = \"square\",\n classes: classesProp,\n onOptionChange,\n ...others\n } = props;\n\n const { classes } = useClasses(classesProp);\n\n const groupByKey = getGroupKey(groupBy);\n\n const { data: chartData } = useData({\n data: dataProp,\n groupBy,\n measures: [measure],\n sortBy: sortBy ?? groupBy, // automatically orders x axis to create the confusion matrix\n splitBy,\n filters,\n delta: typeof delta === \"string\" ? delta : undefined,\n });\n\n const colorScale = useColorScale({\n delta: !!delta,\n data: chartData,\n custom: colorScaleProp,\n filterKey: groupByKey,\n });\n\n const chartVisualMap = useVisualMap({\n show: colorScale?.pieces != null,\n type: colorScale?.pieces != null ? \"piecewise\" : \"continuous\",\n ...(colorScale as Pick<\n HvVisualMapHookProps,\n \"max\" | \"min\" | \"colorScale\" | \"pieces\"\n >),\n ...legend,\n });\n\n const chartTooltip = useTooltip({\n component: (params) => {\n const value = params?.series?.[0].value;\n const fmtValue =\n typeof measure !== \"string\" && measure.valueFormatter\n ? measure.valueFormatter(value)\n : tooltip?.valueFormatter\n ? tooltip?.valueFormatter(value)\n : value;\n const ftmTitle = tooltip?.titleFormatter\n ? tooltip.titleFormatter(params?.title)\n : params?.title;\n\n const content = `${ftmTitle} - ${params?.series?.[0].name}: ${fmtValue}`;\n\n return `\n <div class=\"${classes.tooltipRoot}\">\n <div class=\"${classes.tooltipContainer}\">\n <div>\n <p class=\"${classes.tooltipText}\">${content}</p>\n </div>\n </div>\n </div>`;\n },\n ...tooltip,\n });\n\n const chartYAxis = useYAxis({\n axes: [\n {\n type: \"categorical\",\n name: \"True Label\",\n position: \"left\",\n ...yAxis,\n nameProps: {\n location: \"center\",\n padding:\n yAxis?.nameProps?.location == null ||\n yAxis?.nameProps?.location === \"center\"\n ? yAxis?.position === \"right\"\n ? [50, 0, 0, 0]\n : [0, 0, 50, 0]\n : undefined,\n ...yAxis?.nameProps,\n },\n data: chartData\n .columnNames()\n .filter((p) => p !== groupByKey)\n .reverse(),\n },\n ],\n });\n\n const chartXAxis = useXAxis({\n name: \"Predicted Value\",\n position: \"top\",\n ...xAxis,\n nameProps: {\n location: \"center\",\n padding:\n xAxis?.nameProps?.location == null ||\n xAxis?.nameProps?.location === \"center\"\n ? xAxis?.position === \"bottom\"\n ? [30, 0, 0, 0]\n : [0, 0, 30, 0]\n : undefined,\n ...xAxis?.nameProps,\n },\n data: chartData.array(groupByKey) as any,\n });\n\n const chartSeries = useSeries({\n data: chartData,\n filterKey: groupByKey,\n valuesProps,\n delta: !!(delta && colorScale == null),\n });\n\n const chartGridLayout = useGridLayout({\n data: chartData,\n format,\n filterKey: groupByKey,\n visualMapVisible: chartVisualMap.visualMap.show,\n visualMapYPosition: chartVisualMap.visualMap.top,\n xAxisPosition: chartXAxis.xAxis.position,\n });\n\n const chartGrid = useGrid({\n // If sizes are provided, the grid size should automatically adapt to the values provided\n width: width != null ? undefined : chartGridLayout.size.width,\n height: height != null ? undefined : chartGridLayout.size.height,\n ...chartGridLayout.padding,\n ...grid,\n });\n\n const size = useMemo(() => {\n return {\n width,\n // Echarts has a problem were the height is always set to 300px\n // Thus, we need to update the height to make sure the chart is not cut out\n height:\n height ??\n chartGridLayout.size.height +\n chartGridLayout.padding.bottom +\n chartGridLayout.padding.top,\n };\n }, [\n chartGridLayout.padding.bottom,\n chartGridLayout.padding.top,\n chartGridLayout.size.height,\n height,\n width,\n ]);\n\n const option = useOption({\n option: {\n ...chartVisualMap,\n ...chartTooltip,\n ...chartGrid,\n ...chartXAxis,\n ...chartYAxis,\n ...chartSeries,\n },\n onOptionChange,\n });\n\n return <HvBaseChart ref={ref} option={option} {...size} {...others} />;\n});\n"],"names":["HvConfusionMatrix"],"mappings":";;;;;;;;;;;;;;;;AAyCA,QAAQ,IAAI;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AA2CM,MAAM,oBAAoB,WAG/B,SAASA,mBAAkB,OAAO,KAAK;AACjC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAEJ,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAEpC,QAAA,aAAa,YAAY,OAAO;AAEtC,QAAM,EAAE,MAAM,U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B,QAAQ;AAAA,IAC9B;AAAA,EAAA,GACC;AAAA,IACD,gBAAgB,QAAQ;AAAA,IACxB,gBAAgB,QAAQ;AAAA,IACxB,gBAAgB,KAAK;AAAA,IACrB;AAAA,IACA;AAAA,EAAA,CACD;AAED,QAAM,SAAS,UAAU;AAAA,IACvB,QAAQ;AAAA,MACN,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA;AAAA,EAAA,CACD;AAED,6BAAQ,aAAY,EAAA,KAAU,QAAiB,GAAG,MAAO,GAAG,QAAQ;AACtE,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfusionMatrix.styles.js","sources":["../../../src/ConfusionMatrix/ConfusionMatrix.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvConfusionMatrix\",\n {\n tooltipRoot: {\n backgroundColor: theme.colors.atmo1,\n width: \"fit-content\",\n minWidth: 150,\n boxShadow: theme.colors.shadow,\n zIndex: theme.zIndices.sticky,\n },\n tooltipContainer: {\n padding: theme.spacing(\"15px\", \"sm\"),\n display: \"flex\",\n flexDirection: \"column\",\n },\n tooltipText: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,YAAY,cAAA,IAAkB;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,aAAa;AAAA,MACX,iBAAiB,MAAM,OAAO;AAAA,MAC9B,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW,MAAM,OAAO;AAAA,MACxB,QAAQ,MAAM,SAAS;AAAA,IACzB;AAAA,IACA,kBAAkB;AAAA,MAChB,SAAS,MAAM,QAAQ,QAAQ,IAAI;AAAA,MACnC,SAAS;AAAA,MACT,eAAe;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,MACX,YAAY,MAAM,WAAW;AAAA,MAC7B,YAAY,MAAM,YAAY;AAAA,MAC9B,UAAU,MAAM,UAAU;AAAA,MAC1B,OAAO,MAAM,OAAO;AAAA,IAAA;AAAA,EACtB;AAEJ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/ConfusionMatrix/utils.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport type ColumnTable from \"arquero/dist/types/table/column-table\";\nimport { useTheme } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvChartXAxis } from \"../types/common\";\nimport {\n HvConfusionMatrixColorScale,\n HvConfusionMatrixFormat,\n HvConfusionMatrixValuesProps,\n} from \"./types\";\n\nexport const useColorScale = ({\n data,\n delta,\n custom,\n filterKey,\n}: {\n data: ColumnTable;\n delta: boolean;\n filterKey: string;\n custom?: [string, string] | HvConfusionMatrixColorScale[];\n}) => {\n const { colors } = useTheme();\n\n const colorScale = useMemo(() => {\n if (custom == null && delta) {\n return;\n }\n\n if (custom && typeof custom[0] === \"object\") {\n return {\n pieces: (custom as HvConfusionMatrixColorScale[]).reduce<\n HvConfusionMatrixColorScale[]\n >((acc, curr) => {\n acc.push({\n ...curr,\n color: colors?.[curr.color] || curr.color,\n });\n return acc;\n }, []),\n };\n }\n\n const flatData = data\n .columnNames()\n .filter((p) => p !== filterKey)\n .reduce<number[]>((acc, c) => {\n acc.push(...data.array(c));\n return acc;\n }, []);\n const max = Math.max(...flatData);\n const min = Math.min(...flatData);\n\n const parsedColors = custom?.map((c) =>\n typeof c === \"string\" ? colors?.[c] || c : c.color,\n );\n\n return {\n colorScale: parsedColors || [\n colors?.base_light || \"\",\n colors?.cat3 || \"\",\n ],\n max,\n min,\n };\n }, [colors, custom, data, filterKey, delta]);\n\n return colorScale;\n};\n\nexport const useSeries = ({\n data,\n filterKey,\n delta,\n valuesProps,\n}: {\n data: ColumnTable;\n filterKey: string;\n delta: boolean;\n valuesProps?: HvConfusionMatrixValuesProps;\n}) => {\n const { colors } = useTheme();\n\n const getDeltaColor = useCallback(\n (value: number, diagonal: boolean) => {\n if ((diagonal && value > 0) || (!diagonal && value < 0)) {\n return colors?.positive;\n }\n if ((diagonal && value < 0) || (!diagonal && value > 0)) {\n return colors?.negative;\n }\n\n return colors?.base_light;\n },\n [colors],\n );\n\n const chartSeries = useMemo(() => {\n return {\n series: {\n id: `series~${filterKey}`,\n type: \"heatmap\",\n label: {\n show: true,\n ...valuesProps,\n ...(valuesProps?.color && {\n color: colors?.[valuesProps.color] || valuesProps.color,\n }),\n },\n emphasis: {\n disabled: true,\n },\n data: data\n .columnNames()\n .filter((p) => p !== filterKey)\n .reduce<(string | number)[][]>((acc, c, j) => {\n const row: any = (data.array(c) as any[]).reduce<\n {\n value: any[];\n visualMap?: boolean;\n itemStyle?: object;\n }[]\n >((racc, rv, i) => {\n racc.push({\n value: [data.array(filterKey)[i], c, rv != null ? rv : \"-\"],\n ...(delta && {\n visualMap: false,\n itemStyle: {\n color: getDeltaColor(rv, i === j),\n },\n }),\n });\n return racc;\n }, []);\n\n acc.push(...row);\n return acc;\n }, []),\n },\n };\n }, [colors, data, delta, filterKey, getDeltaColor, valuesProps]);\n\n return chartSeries;\n};\n\nconst SQUARE_SIZE = 52;\n\nexport const useGridLayout = ({\n data,\n filterKey,\n format,\n xAxisPosition,\n visualMapVisible,\n visualMapYPosition,\n}: {\n xAxisPosition: HvChartXAxis[\"position\"];\n data: ColumnTable;\n filterKey: string;\n format: HvConfusionMatrixFormat;\n visualMapVisible: boolean;\n visualMapYPosition: \"top\" | \"center\" | \"bottom\";\n}) => {\n const size = useMemo(() => {\n const nCols = data.array(filterKey).length;\n const nRows = data.columnNames().filter((p) => p !== filterKey).length;\n const itemHeight = format === \"square\" ? SQUARE_SIZE : SQUARE_SIZE / 2;\n\n return {\n padding: {\n bottom:\n xAxisPosition === \"bottom\" ||\n (visualMapVisible && visualMapYPosition === \"bottom\")\n ? 60\n : 20,\n top:\n xAxisPosition === \"top\" ||\n (visualMapVisible && visualMapYPosition === \"top\")\n ? 60\n : 20,\n ...(visualMapVisible &&\n visualMapYPosition === \"bottom\" &&\n xAxisPosition === \"bottom\" && {\n bottom: 100,\n }),\n ...(visualMapVisible &&\n visualMapYPosition === \"top\" &&\n xAxisPosition === \"top\" && {\n top: 100,\n }),\n left: 80,\n right: 80,\n },\n size: {\n height: Math.max(itemHeight * nRows, itemHeight * 8),\n width: Math.max(SQUARE_SIZE * nCols, SQUARE_SIZE * 8),\n },\n };\n }, [\n data,\n filterKey,\n format,\n visualMapVisible,\n visualMapYPosition,\n xAxisPosition,\n ]);\n\n return size;\n};\n"],"names":[],"mappings":";;AAWO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACE,QAAA,EAAE,OAAO,IAAI,SAAS;AAEtB,QAAA,aAAa,QAAQ,MAAM;AAC3B,QAAA,UAAU,QAAQ,OAAO;AAC3B;AAAA,IAAA;AAGF,QAAI,UAAU,OAAO,OAAO,CAAC,MAAM,UAAU;AACpC,aAAA;AAAA,QACL,QAAS,OAAyC,OAEhD,CAAC,KAAK,SAAS;AACf,cAAI,KAAK;AAAA,YACP,GAAG;AAAA,YACH,OAAO,SAAS,KAAK,KAAK,KAAK,KAAK;AAAA,UAAA,CACrC;AACM,iBAAA;AAAA,QAAA,GACN,CAAE,CAAA;AAAA,MACP;AAAA,IAAA;AAGF,UAAM,WAAW,KACd,YAAY,EACZ,OAAO,CAAC,MAAM,MAAM,SAAS,EAC7B,OAAiB,CAAC,KAAK,MAAM;AAC5B,UAAI,KAAK,GAAG,KAAK,MAAM,CAAC,CAAC;AAClB,aAAA;AAAA,IACT,GAAG,EAAE;AACP,UAAM,MAAM,KAAK,IAAI,GAAG,QAAQ;AAChC,UAAM,MAAM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I,cAAc,OAAO,cAAc,CAAC;AAAA,MAAA;AAAA,IAExD;AAAA,EAAA,GACC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAEM,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.js","sources":["../../../src/DonutChart/DonutChart.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { PieChart } from \"echarts/charts\";\nimport {\n DatasetComponent,\n GridComponent,\n LegendComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n HvChartTooltipClasses,\n useData,\n useDataset,\n useGrid,\n useLegend,\n useOption,\n useSeries,\n useTooltip,\n} from \"../hooks\";\nimport { HvDonutChartMeasure } from \"../types\";\nimport { HvChartCommonProps } from \"../types/common\";\n\n// Register chart components\necharts.use([\n PieChart,\n DatasetComponent,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n]);\n\nexport interface HvDonutChartClasses extends HvChartTooltipClasses {}\n\nexport interface HvDonutChartProps extends HvChartCommonProps {\n /** Column to measure. */\n measure: HvDonutChartMeasure;\n /** Type: regular or thin. Defaults to `regular`. */\n type?: \"regular\" | \"thin\";\n /** Formatter for the slices names used on the tooltips and legend. */\n slicesNameFormatter?: (value?: string) => string;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvDonutChartClasses;\n}\n\n/**\n * Donut charts nicely convey the part-whole relationship and they have become\n * the most recognizable chart types for representing proportions in business and data statistics.\n */\nexport const HvDonutChart = forwardRef<ReactECharts, HvDonutChartProps>(\n function HvDonutChart(props, ref) {\n const {\n data,\n groupBy,\n classes,\n legend,\n tooltip,\n measure: measures,\n sortBy,\n filters,\n grid,\n width,\n height,\n type = \"regular\",\n slicesNameFormatter,\n onOptionChange,\n ...others\n } = props;\n\n const { data: chartData, mapping: measuresMapping } = useData({\n data,\n groupBy,\n measures,\n sortBy,\n filters,\n });\n\n const chartDataset = useDataset(chartData);\n\n const chartSeries = useSeries({\n type: \"pie\",\n data: chartData,\n groupBy,\n measuresMapping,\n radius: type === \"thin\" ? [\"65%\", \"70%\"] : [\"55%\", \"70%\"],\n });\n\n const chartLegend = useLegend({\n ...legend,\n show: legend?.show ?? true,\n icon: \"square\",\n series: chartSeries.series,\n formatter: slicesNameFormatter,\n });\n\n const chartTooltip = useTooltip({\n ...tooltip,\n measuresMapping,\n classes,\n nameFormatter: slicesNameFormatter,\n });\n\n const chartGrid = useGrid({ ...grid });\n\n const option = useOption({\n option: {\n ...chartSeries,\n ...chartDataset,\n ...chartLegend,\n ...chartTooltip,\n ...chartGrid,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvDonutChart"],"mappings":";;;;;;;;;;;;;AA0BA,QAAQ,IAAI;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAmBM,MAAM,eAAe;AAAA,EAC1B,SAASA,cAAa,OAAO,KAAK;AAC1B,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAEJ,UAAM,EAAE,MAAM,WAAW,SAAS,gBAAA,IAAoB,QAAQ;AAAA,MAC5D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAEK,UAAA,eAAe,WAAW,SAAS;AAEzC,UAAM,cAAc,UAAU;AAAA,MAC5B,MAAM;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,QAAQ,SAAS,SAAS,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,KAAK;AAAA,IAAA,CACzD;AAED,UAAM,cAAc,UAAU;AAAA,MAC5B,GAAG;AAAA,MACH,MAAM,QAAQ,QAAQ;AAAA,MACtB,MAAM;AAAA,MACN,QAAQ,YAAY;AAAA,MACpB,WAAW;AAAA,IAAA,CACZ;AAED,UAAM,eAAe,WAAW;AAAA,MAC9B,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IAAA,CAChB;AAED,UAAM,YAAY,QAAQ,EAAE,GAAG,MAAM;AAErC,UAAM,SAAS,UAAU;AAAA,MACvB,QAAQ;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA;AAAA,IAAA,CACD;AAGC,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heatmap.js","sources":["../../../src/Heatmap/Heatmap.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { HeatmapChart } from \"echarts/charts\";\nimport { TooltipComponent, VisualMapComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { useTheme, type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\nimport { HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n useOption,\n useTooltip,\n useVisualMap,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport { HvChartTooltip } from \"../types\";\nimport { HvChartCommonProps, XAxis, YAxis } from \"../types/common\";\nimport { useClasses } from \"./Heatmap.styles\";\n\n// Register chart components\necharts.use([HeatmapChart, TooltipComponent, VisualMapComponent]);\n\nexport type HvHeatmapClasses = ExtractNames<typeof useClasses>;\n\nexport type HvHeatmapItem = Array<number | string>;\n\nexport type HvHeatmapData = Array<HvHeatmapItem>;\n\nexport interface HvHeatmapProps\n extends Omit<\n HvChartCommonProps,\n \"data\" | \"groupBy\" | \"sortBy\" | \"grid\" | \"legend\" | \"tooltip\" | \"filters\"\n > {\n /** The name of the heatmap */\n name?: string;\n /** The data to use on the heatmap */\n data?: HvHeatmapData;\n /** The min value of the Heatmap */\n min: number;\n /** The max value of the Heatmap */\n max: number;\n /** The X axis definition */\n xAxis?: XAxis;\n /** The Y axis definition. */\n yAxis?: YAxis;\n /** The tooltip options. */\n tooltip?: Omit<HvChartTooltip, \"type\">;\n /** Color scale of the confusion matrix. Accepts an array of strings spanning from the lower to the upper ends of the scale. */\n colorScale?: HvColorAny[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvHeatmapClasses;\n}\n\n/**\n * A Heatmap uses color gradients to represent data intensity across a surface.\n */\nexport const HvHeatmap = forwardRef<ReactECharts, HvHeatmapProps>(\n function HvHeatmap(props, ref) {\n const {\n name,\n data,\n min,\n max,\n colorScale,\n xAxis,\n yAxis,\n classes: classesProp,\n tooltip,\n width,\n height,\n onOptionChange,\n ...others\n } = props;\n\n const { classes } = useClasses(classesProp);\n const { colors } = useTheme();\n\n const chartTooltip = useTooltip({\n component: (params) => {\n const value = params?.value;\n const title = params?.title;\n\n const valueToShow = value\n ? `${yAxis?.data?.[Number(value[1])]} - ${xAxis?.data?.[Number(value[0])]}: ${params?.series?.[0]?.name}`\n : \"-\";\n\n return `\n <div class=\"${classes.tooltipRoot}\">\n <div class=\"${classes.tooltipContainer}\">\n <div>\n <p class=\"${classes.tooltipText}\">${title}</p>\n <p class=\"${classes.tooltipText}\">${valueToShow}</p>\n </div>\n </div>\n </div>`;\n },\n ...tooltip,\n });\n\n const chartXAxis = useXAxis({ type: \"categorical\", ...xAxis });\n const chartYAxis = useYAxis({\n defaultType: \"categorical\",\n axes: yAxis ? [yAxis] : [],\n });\n\n const convertedColors = colorScale?.map(\n (color) => colors?.[color] || color,\n );\n\n const chartVisualMap = useVisualMap({\n min,\n max,\n orient: \"horizontal\",\n left: \"center\",\n calculable: true,\n position: {\n y: \"bottom\",\n },\n colorScale: convertedColors || [\n colors?.cat1_180 || \"\",\n colors?.cat1_20 || \"\",\n ],\n });\n\n const option = useOption({\n option: {\n xAxis: chartXAxis.xAxis,\n yAxis: chartYAxis.yAxis,\n visualMap: chartVisualMap.visualMap,\n series: [\n {\n name,\n type: \"heatmap\",\n data,\n label: {\n show: true,\n },\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowColor: \"rgba(0, 0, 0, 0.5)\",\n },\n },\n },\n ],\n ...chartTooltip,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvHeatmap"],"mappings":";;;;;;;;;;;;;AAqBA,QAAQ,IAAI,CAAC,cAAc,kBAAkB,kBAAkB,CAAC;AAoCzD,MAAM,YAAY;AAAA,EACvB,SAASA,WAAU,OAAO,KAAK;AACvB,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAEJ,UAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AACpC,UAAA,EAAE,OAAO,IAAI,SAAS;AAE5B,UAAM,eAAe,WAAW;AAAA,MAC9B,WAAW,CAAC,WAAW;AACrB,cAAM,QAAQ,QAAQ;AACtB,cAAM,QAAQ,QAAQ;AAEhB,cAAA,cAAc,QAChB,GAAG,OAAO,OAAO,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,OAAO,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK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AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heatmap.styles.js","sources":["../../../src/Heatmap/Heatmap.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvHeatmap\", {\n tooltipRoot: {\n backgroundColor: theme.colors.atmo1,\n width: \"fit-content\",\n minWidth: 150,\n boxShadow: theme.colors.shadow,\n zIndex: theme.zIndices.sticky,\n },\n tooltipContainer: {\n padding: theme.spacing(\"15px\", \"sm\"),\n display: \"flex\",\n flexDirection: \"column\",\n },\n tooltipText: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,aAAa;AAAA,EACtE,aAAa;AAAA,IACX,iBAAiB,MAAM,OAAO;AAAA,IAC9B,OAAO;AAAA,IACP,UAAU;AAAA,IACV,WAAW,MAAM,OAAO;AAAA,IACxB,QAAQ,MAAM,SAAS;AAAA,EACzB;AAAA,EACA,kBAAkB;AAAA,IAChB,SAAS,MAAM,QAAQ,QAAQ,IAAI;AAAA,IACnC,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,aAAa;AAAA,IACX,YAAY,MAAM,WAAW;AAAA,IAC7B,YAAY,MAAM,YAAY;AAAA,IAC9B,UAAU,MAAM,UAAU;AAAA,IAC1B,OAAO,MAAM,OAAO;AAAA,EAAA;AAExB,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","sources":["../../../src/LineChart/LineChart.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { LineChart } from \"echarts/charts\";\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n DataZoomSliderComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n HvChartTooltipClasses,\n useData,\n useDataset,\n useDataZoom,\n useGrid,\n useLegend,\n useOption,\n useSeries,\n useTooltip,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport { HvChartEmptyCellMode, HvLineChartMeasures } from \"../types\";\nimport {\n Arrayable,\n HvAxisChartCommonProps,\n HvChartCommonProps,\n} from \"../types/common\";\n\n// Register chart components\necharts.use([\n LineChart,\n DatasetComponent,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n DataZoomSliderComponent,\n DataZoomInsideComponent,\n MarkLineComponent,\n]);\n\nexport interface HvLineChartClasses extends HvChartTooltipClasses {}\n\nexport interface HvLineChartProps\n extends HvAxisChartCommonProps,\n HvChartCommonProps {\n /** Columns to measure on the chart. */\n measures: Arrayable<HvLineChartMeasures>;\n /** Strategy to use when there are empty cells. Defaults to `void`. */\n emptyCellMode?: HvChartEmptyCellMode;\n /** Whether the area under the lines should be filled. Defaults to `false`. */\n area?: boolean;\n /** Sets opacity of the filled area if `area` is true. Defaults to `0.5`. */\n areaOpacity?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvLineChartClasses;\n}\n\n/**\n * A line chart or line plot or line graph is a type of chart which displays information as a series of data points\n * connected by straight line segments. It is a basic type of chart common in many fields.\n */\nexport const HvLineChart = forwardRef<ReactECharts, HvLineChartProps>(\n function HvLineChart(props, ref) {\n const {\n area = false,\n emptyCellMode = \"void\",\n areaOpacity = 0.5,\n yAxis,\n xAxis,\n horizontalRangeSlider,\n grid,\n data,\n groupBy,\n splitBy,\n sortBy,\n filters,\n measures,\n stack,\n seriesNameFormatter,\n legend,\n classes,\n tooltip,\n width,\n height,\n onOptionChange,\n ...others\n } = props;\n\n const { data: chartData, mapping: measuresMapping } = useData({\n data,\n groupBy,\n measures,\n splitBy,\n sortBy,\n filters,\n });\n\n const chartDataset = useDataset(chartData);\n\n const chartYAxis = useYAxis({\n axes: Array.isArray(yAxis) || yAxis == null ? yAxis : [yAxis],\n });\n\n const chartXAxis = useXAxis({ ...xAxis, scale: true });\n\n const chartSlider = useDataZoom({\n showHorizontal: horizontalRangeSlider?.show,\n });\n\n const chartGrid = useGrid({ ...grid });\n\n const chartSeries = useSeries({\n type: \"line\",\n data: chartData,\n groupBy,\n measuresMapping,\n area,\n areaOpacity,\n emptyCellMode,\n stack,\n nameFormatter: seriesNameFormatter,\n });\n\n const chartLegend = useLegend({\n ...legend,\n series: chartSeries.series,\n });\n\n const chartTooltip = useTooltip({\n ...tooltip,\n trigger: \"axis\",\n measuresMapping,\n classes,\n });\n\n const option = useOption({\n option: {\n ...chartYAxis,\n ...chartXAxis,\n ...chartSlider,\n ...chartGrid,\n ...chartDataset,\n ...chartSeries,\n ...chartLegend,\n ...chartTooltip,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvLineChart"],"mappings":";;;;;;;;;;;;;;;;AAoCA,QAAQ,IAAI;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAuBM,MAAM,cAAc;AAAA,EACzB,SAASA,aAAY,OAAO,KAAK;AACzB,UAAA;AAAA,MACJ,OAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,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":["../../../src/ScatterPlot/ScatterPlot.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { ScatterChart } from \"echarts/charts\";\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n DataZoomSliderComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport {\n HvChartTooltipClasses,\n useData,\n useDataset,\n useDataZoom,\n useGrid,\n useLegend,\n useOption,\n useSeries,\n useTooltip,\n useXAxis,\n useYAxis,\n} from \"../hooks\";\nimport {\n Arrayable,\n HvAxisChartCommonProps,\n HvChartCommonProps,\n} from \"../types/common\";\nimport { HvScatterPlotMeasure } from \"../types/measures\";\n\n// Register chart components\necharts.use([\n ScatterChart,\n DatasetComponent,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n DataZoomSliderComponent,\n DataZoomInsideComponent,\n MarkLineComponent,\n]);\n\nexport interface HvScatterPlotClasses extends HvChartTooltipClasses {}\n\nexport interface HvScatterPlotProps\n extends HvChartCommonProps,\n Omit<HvAxisChartCommonProps, \"stack\"> {\n /** Columns to measure on the plot. */\n measures: Arrayable<HvScatterPlotMeasure>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvScatterPlotClasses;\n}\n\n/**\n * A scatter plot is a type of chart which displays dots to represent two numeric variables.\n * This type of chart is used to determine the relationship between two variables.\n */\nexport const HvScatterPlot = forwardRef<ReactECharts, HvScatterPlotProps>(\n function HvScatterPlot(props, ref) {\n const {\n yAxis,\n xAxis,\n horizontalRangeSlider,\n grid,\n data,\n groupBy,\n splitBy,\n sortBy,\n filters,\n measures,\n seriesNameFormatter,\n legend,\n classes,\n tooltip,\n width,\n height,\n onOptionChange,\n ...others\n } = props;\n\n const { data: chartData, mapping: measuresMapping } = useData({\n data,\n groupBy,\n measures,\n splitBy,\n sortBy,\n filters,\n });\n\n const chartDataset = useDataset(chartData);\n\n const chartYAxis = useYAxis({\n axes: Array.isArray(yAxis) || yAxis == null ? yAxis : [yAxis],\n });\n\n const chartXAxis = useXAxis({ type: \"continuous\", ...xAxis });\n\n const chartSlider = useDataZoom({\n showHorizontal: horizontalRangeSlider?.show,\n });\n\n const chartGrid = useGrid({ ...grid });\n\n const chartSeries = useSeries({\n type: \"scatter\",\n data: chartData,\n groupBy,\n measuresMapping,\n nameFormatter: seriesNameFormatter,\n });\n\n const chartLegend = useLegend({\n ...legend,\n series: chartSeries.series,\n });\n\n const chartTooltip = useTooltip({\n ...tooltip,\n trigger: \"axis\",\n measuresMapping,\n classes,\n });\n\n const option = useOption({\n option: {\n ...chartYAxis,\n ...chartXAxis,\n ...chartSlider,\n ...chartGrid,\n ...chartDataset,\n ...chartSeries,\n ...chartLegend,\n ...chartTooltip,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvScatterPlot"],"mappings":";;;;;;;;;;;;;;;;AAoCA,QAAQ,IAAI;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAiBM,MAAM,gBAAgB;AAAA,EAC3B,SAASA,eAAc,OAAO,KAAK;AAC3B,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAEJ,UAAM,EAAE,MAAM,WAAW,SAAS,gBAAA,IAAoB,QAAQ;AAAA,MAC5D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAEK,UAAA,eAAe,WAAW,SAAS;AAEzC,UAAM,aAAa,SAAS;AAAA,MAC1B,MAAM,MAAM,QAAQ,KAAK,KAAK,SAAS,OAAO,QAAQ,CAAC,KAAK;AAAA,IAAA,CAC7D;AAED,UAAM,aAAa,SAAS,EAAE,MAAM,cAAc,GAAG,OAAO;AAE5D,UAAM,cAAc,YAAY;AAAA,MAC9B,gBAAgB,uBAAuB;AAAA,IAAA,CACxC;AAED,UAAM,YAAY,QAAQ,EAAE,GAAG,MAAM;AAErC,UAAM,cAAc,UAAU;AAAA,MAC5B,MAAM;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IAAA,CAChB;AAED,UAAM,cAAc,UAAU;AAAA,MAC5B,GAAG;AAAA,MACH,QAAQ,YAAY;AAAA,IAAA,CACrB;AAED,UAAM,eAAe,WAAW;AAAA,MAC9B,GAAG;AAAA,MACH,SAAS;AAAA,MACT;AAAA,MACA;AAAA,IAAA,CACD;AAED,UAAM,SAAS,UAAU;AAAA,MACvB,QAAQ;AAAA,QACN,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA;AAAA,IAAA,CACD;AAGC,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Treemap.js","sources":["../../../src/Treemap/Treemap.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport ReactECharts from \"echarts-for-react/lib/core\";\nimport { TreemapChart } from \"echarts/charts\";\nimport { TooltipComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\n\nimport { HvBaseChart } from \"../BaseChart\";\nimport { HvChartTooltipClasses, useOption, useTooltip } from \"../hooks\";\nimport { HvChartTooltip } from \"../types\";\nimport { HvChartCommonProps } from \"../types/common\";\n\n// Register chart components\necharts.use([TreemapChart, TooltipComponent]);\n\nexport type HvTreemapData = {\n [propName: string]:\n | string\n | number\n | number[]\n | HvTreemapData[]\n | undefined\n | null;\n children?: HvTreemapData[];\n name?: string;\n value?: number[];\n};\n\nexport interface HvTreemapChartClasses extends HvChartTooltipClasses {}\n\nexport interface HvTreemapChartProps\n extends Omit<\n HvChartCommonProps,\n \"data\" | \"groupBy\" | \"sortBy\" | \"grid\" | \"legend\" | \"tooltip\" | \"filters\"\n > {\n /** The name of the treemap */\n name?: string;\n /** The data to use on the treemap */\n data?: HvTreemapData[];\n /** The tooltip options. */\n tooltip?: Omit<HvChartTooltip, \"type\">;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTreemapChartClasses;\n}\n\n/**\n * A tree map chart visually represents hierarchical data using nested rectangles, with each rectangle's size proportional to the value it represents.\n */\nexport const HvTreemapChart = forwardRef<ReactECharts, HvTreemapChartProps>(\n function HvTreemapChart(props, ref) {\n const {\n name,\n data,\n classes,\n width,\n height,\n tooltip,\n onOptionChange,\n ...others\n } = props;\n\n const chartTooltip = useTooltip({\n ...tooltip,\n type: \"single\",\n classes,\n });\n\n const option = useOption({\n option: {\n series: [\n {\n name,\n type: \"treemap\",\n data,\n },\n ],\n ...chartTooltip,\n },\n onOptionChange,\n });\n\n return (\n <HvBaseChart\n ref={ref}\n option={option}\n width={width}\n height={height}\n {...others}\n />\n );\n },\n);\n"],"names":["HvTreemapChart"],"mappings":";;;;;;;;AAYA,QAAQ,IAAI,CAAC,cAAc,gBAAgB,CAAC;AAmCrC,MAAM,iBAAiB;AAAA,EAC5B,SAASA,gBAAe,OAAO,KAAK;AAC5B,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAEJ,UAAM,eAAe,WAAW;AAAA,MAC9B,GAAG;AAAA,MACH,MAAM;AAAA,MACN;AAAA,IAAA,CACD;AAED,UAAM,SAAS,UAAU;AAAA,MACvB,QAAQ;AAAA,QACN,QAAQ;AAAA,UACN;AAAA,YACE;AAAA,YACA,MAAM;AAAA,YACN;AAAA,UAAA;AAAA,QAEJ;AAAA,QACA,GAAG;AAAA,MACL;AAAA,MACA;AAAA,IAAA,CACD;AAGC,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/hooks/tooltip/styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvChartTooltip\", {\n /** Single tooltip styles */\n singleTooltipRoot: {\n width: \"fit-content\",\n boxShadow: theme.colors.shadow,\n backgroundColor: theme.colors.atmo1,\n padding: theme.space.sm,\n display: \"flex\",\n },\n singleTooltipTitle: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n singleTooltipValue: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n marginLeft: theme.space.xs,\n },\n /** Multiple tooltip styles */\n multipleTooltipRoot: {\n width: \"fit-content\",\n boxShadow: theme.colors.shadow,\n backgroundColor: theme.colors.atmo1,\n },\n multipleTooltipTitleContainer: {\n padding: `15px ${theme.space.sm}`,\n borderBottom: `3px solid ${theme.colors.atmo2}`,\n },\n multipleTooltipTitle: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n multipleTooltipValuesContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: theme.space.sm,\n\n \"& > *:not(:last-child)\": { paddingBottom: theme.space.sm },\n },\n multipleTooltipSeriesContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n multipleTooltipSeriesNameContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n marginRight: theme.space.sm,\n },\n multipleTooltipSeriesColor: {\n width: \"10px\",\n height: \"10px\",\n marginRight: \"5px\",\n },\n multipleTooltipSeriesName: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.semibold,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n multipleTooltipSeriesValue: {\n fontFamily: theme.fontFamily.body,\n fontWeight: theme.fontWeights.normal,\n fontSize: theme.fontSizes.sm,\n color: theme.colors.secondary,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,kBAAkB;AAAA;AAAA,EAE3E,mBAAmB;AAAA,IACjB,OAAO;AAAA,IACP,WAAW,MAAM,OAAO;AAAA,IACxB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,SAAS,MAAM,MAAM;AAAA,IACrB,SAAS;AAAA,EACX;AAAA,EACA,oBAAoB;AAAA,IAClB,YAAY,MAAM,WAAW;AAAA,IAC7B,YAAY,MAAM,YAAY;AAAA,IAC9B,UAAU,MAAM,UAAU;AAAA,IAC1B,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,oBAAoB;AAAA,IAClB,YAAY,MAAM,WAAW;AAAA,IAC7B,YAAY,MAAM,YAAY;AAAA,IAC9B,UAAU,MAAM,UAAU;AAAA,IAC1B,OAAO,MAAM,OAAO;AAAA,IACpB,YAAY,MAAM,MAAM;AAAA,EAC1B;AAAA;AAAA,EAEA,qBAAqB;AAAA,IACnB,OAAO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import { useCallback, useMemo } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvChartTooltip, HvChartTooltipParams } from \"../../types\";\nimport { HvEChartsOption } from \"../../types/common\";\nimport { getMeasure, SingleMeasure } from \"../../utils\";\nimport { useClasses } from \"./styles\";\n\nexport type HvChartTooltipClasses = ExtractNames<typeof useClasses>;\n\n/** Echarts doesn't seem to have the type for the tooltip params */\ninterface EChartsTooltipParams {\n seriesName: string;\n value: (string | number)[];\n encode: { [key: string]: number[] };\n color: string;\n dimensionNames: string[];\n name: string;\n seriesType: string;\n}\n\ninterface HvTooltipHookProps {\n measuresMapping?: Record<string, SingleMeasure>;\n trigger?: \"item\" | \"axis\";\n classes?: HvChartTooltipClasses;\n horizontal?: boolean;\n show?: HvChartTooltip[\"show\"];\n type?: HvChartTooltip[\"type\"];\n component?: HvChartTooltip[\"component\"];\n valueFormatter?: HvChartTooltip[\"valueFormatter\"];\n titleFormatter?: HvChartTooltip[\"titleFormatter\"];\n nameFormatter?: (value?: string) => string;\n}\n\nexport const useTooltip = ({\n measuresMapping = {},\n classes,\n component,\n show = true,\n horizontal = false,\n trigger = \"item\",\n type = \"multiple\",\n valueFormatter,\n titleFormatter,\n nameFormatter,\n}: HvTooltipHookProps) => {\n const { classes: hvClasses } = useClasses(classes);\n\n const renderTooltip = useCallback(\n (params: EChartsTooltipParams[]) => {\n const title =\n params[0].seriesType === \"treemap\" ||\n params[0].seriesType === \"heatmap\" ||\n params[0].seriesType === \"boxplot\"\n ? params[0].name\n : params[0].seriesType === \"pie\"\n ? params[0].seriesName\n : horizontal\n ? params[0].value[params[0].encode.y[0]]\n : params[0].value[params[0].encode.x[0]];\n\n const formattedTitle = titleFormatter ? titleFormatter(title) : title;\n\n if (type === \"single\") {\n const measure = getMeasure(\n params[0].seriesType === \"pie\" ||\n params[0].seriesType === \"treemap\" ||\n params[0].seriesType === \"heatmap\" ||\n params[0].seriesType === \"boxplot\"\n ? params[0].name\n : horizontal\n ? params[0].dimensionNames[params[0].encode.x[0]]\n : params[0].dimensionNames[params[0].encode.y[0]],\n measuresMapping,\n );\n\n const value =\n params[0].seriesType === \"pie\" ||\n params[0].seriesType === \"treemap\" ||\n params[0].seriesType === \"heatmap\"\n ? params[0].value[params[0].encode.value[0]]\n : horizontal\n ? params[0].value[params[0].encode.x[0]]\n : params[0].value[params[0].encode.y[0]];\n\n const formattedValue =\n measure && typeof measure !== \"string\" && measure.valueFormatter\n ? measure.valueFormatter(value)\n : valueFormatter\n ? valueFormatter(value)\n : value;\n\n return `\n <div class=\"${hvClasses?.singleTooltipRoot}\">\n <p class=\"${hvClasses?.singleTooltipTitle}\">${formattedTitle}</p>\n <p class=\"${hvClasses?.singleTooltipValue}\">${formattedValue}</p>\n </div>\n `;\n }\n\n return `\n <div class=\"${hvClasses?.multipleTooltipRoot}\">\n <div class=\"${hvClasses?.multipleTooltipTitleContainer}\">\n <div>\n <p class=\"${hvClasses?.multipleTooltipTitle}\">${formattedTitle}</p>\n </div>\n </div>\n <div class=\"${hvClasses?.multipleTooltipValuesContainer}\">\n ${params\n .map((s) => {\n const measure = getMeasure(\n s.seriesType === \"pie\"\n ? s.name\n : horizontal\n ? s.dimensionNames[s.encode.x[0]]\n : s.dimensionNames[s.encode.y[0]],\n measuresMapping,\n );\n\n const value =\n s.seriesType === \"pie\"\n ? s.value[s.encode.value[0]]\n : horizontal\n ? s.value[s.encode.x[0]]\n : s.value[s.encode.y[0]];\n\n const formattedValue =\n typeof measure !== \"string\" && measure?.valueFormatter\n ? measure.valueFormatter(value)\n : valueFormatter\n ? valueFormatter(value)\n : value;\n\n const name = s.seriesType === \"pie\" ? s.name : s.seriesName;\n\n const formattedName = nameFormatter\n ? nameFormatter(name)\n : name;\n\n return `\n <div key=\"${s.seriesName}\" class=\"${hvClasses?.multipleTooltipSeriesContainer}\">\n <div class=\"${hvClasses?.multipleTooltipSeriesNameContainer}\">\n <p style=\"background-color: ${s.color};\" class=\"${hvClasses?.multipleTooltipSeriesColor}\" />\n <p class=\"${hvClasses?.multipleTooltipSeriesName}\">${formattedName}</p>\n </div>\n <p class=\"${hvClasses?.multipleTooltipSeriesValue}\">${formattedValue}</p>\n </div>\n `;\n })\n .join(\" \")}\n </div>\n </div>\n `;\n },\n [\n hvClasses,\n horizontal,\n type,\n measuresMapping,\n nameFormatter,\n titleFormatter,\n valueFormatter,\n ],\n );\n\n const renderCustomTooltip = useCallback(\n (params: EChartsTooltipParams[]) => {\n if (typeof component === \"function\") {\n const values: HvChartTooltipParams = {\n title:\n params[0].seriesType === \"boxplot\"\n ? params[0].name\n : params[0].seriesType === \"pie\" ||\n params[0].seriesType === \"treemap\" ||\n params[0].seriesType === \"heatmap\"\n ? params[0].seriesName\n : horizontal\n ? params[0].value[params[0].encode.y[0]]\n : params[0].value[params[0].encode.x[0]],\n series: params.map((p) => {\n return {\n color: p.color,\n name:\n p.seriesType === \"heatmap\"\n ? String(p.value[p.encode.y[0]])\n : p.seriesType === \"pie\" || p.seriesType === \"treemap\"\n ? p.name\n : p.seriesName,\n value:\n p.seriesType === \"pie\" ||\n p.seriesType === \"treemap\" ||\n p.seriesType === \"heatmap\"\n ? p.value[p.encode.value[0]]\n : horizontal\n ? p.value[p.encode.x[0]]\n : p.value[p.encode.y[0]],\n };\n }),\n value: params[0].value,\n };\n\n return component(values);\n }\n\n return component;\n },\n [component, horizontal],\n );\n\n const option = useMemo<Pick<HvEChartsOption, \"tooltip\">>(() => {\n return {\n tooltip: {\n confine: false,\n show,\n trigger,\n position: (point: any, params: any, dom: any, rect: any, size: any) => {\n return [point[0], point[1] - size.contentSize[1]];\n },\n formatter: (params: any) => {\n const tooltipParams = Array.isArray(params) ? params : [params];\n\n return component\n ? renderCustomTooltip(tooltipParams)\n : renderTooltip(tooltipParams);\n },\n },\n };\n }, [trigger, component, show, renderTooltip, renderCustomTooltip]);\n\n return option;\n};\n"],"names":[],"mappings":";;;AAkCO,MAAM,aAAa,CAAC;AAAA,EACzB,kBAAkB,CAA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AAAA,IACT;AAAA,IACA,CAAC,WAAW,UAAU;AAAA,EACxB;AAEM,QAAA,SAAS,QAA0C,MAAM;AACtD,WAAA;AAAA,MACL,SAAS;AAAA,QACP,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,CAAC,OAAY,QAAa,KAAU,MAAW,SAAc;AAC9D,iBAAA,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AAAA,QAClD;AAAA,QACA,WAAW,CAAC,WAAgB;AAC1B,gBAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM;AAE9D,iBAAO,YACH,oBAAoB,aAAa,IACjC,cAAc,aAAa;AAAA,QAAA;AAAA,MACjC;AAAA,IAEJ;AAAA,EAAA,GACC,CAAC,SAAS,WAAW,MAAM,eAAe,mBAAmB,CAAC;AAE1D,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useData.js","sources":["../../../src/hooks/useData.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { desc, escape, not } from \"arquero\";\n\nimport {\n HvBarChartMeasures,\n HvChartAggregation,\n HvChartData,\n HvChartOrder,\n HvConfusionMatrixMeasure,\n HvDonutChartMeasure,\n HvLineChartMeasures,\n HvScatterPlotMeasure,\n} from \"../types\";\nimport {\n Arrayable,\n HvAxisChartCommonProps,\n HvChartCommonProps,\n} from \"../types/common\";\nimport {\n getGroupKey,\n getHvArqueroCombinedFilters,\n normalizeColumnName,\n processTableData,\n SingleMeasure,\n} from \"../utils\";\n\nconst getAgFunc = (func: HvChartAggregation, field: string) =>\n func === \"count\" ? \"count()\" : `${func}(d[\"${field}\"])`;\n\ninterface HvDataHookProps {\n data: HvChartData;\n groupBy: HvChartCommonProps[\"groupBy\"];\n measures:\n | Arrayable<HvLineChartMeasures | HvBarChartMeasures | HvScatterPlotMeasure>\n | HvDonutChartMeasure\n | HvConfusionMatrixMeasure;\n splitBy?: HvAxisChartCommonProps[\"splitBy\"];\n sortBy?: HvChartCommonProps[\"sortBy\"];\n filters?: HvChartCommonProps[\"filters\"];\n delta?: string;\n}\n\nexport const useData = ({\n data,\n groupBy,\n measures,\n sortBy,\n splitBy,\n filters: filtersProp,\n delta,\n}: HvDataHookProps) => {\n const groupByKey = getGroupKey(groupBy);\n\n return useMemo(() => {\n // Converting data to Arquero table data and normalizing the columns name\n const { data: processedData, mapping } = processTableData(data);\n let tableData = processedData;\n\n // Filter data right away\n if (filtersProp) {\n const filters = (\n Array.isArray(filtersProp) ? filtersProp : [filtersProp]\n ).map((filter) => ({\n ...filter,\n field: normalizeColumnName(filter.field), // normalize\n }));\n\n tableData = tableData.filter(\n escape((row: any) => getHvArqueroCombinedFilters(row, filters)),\n );\n }\n\n const groupByFields = (\n groupBy ? (Array.isArray(groupBy) ? groupBy : [groupBy]) : []\n ).map((value) => normalizeColumnName(value)); // normalize\n\n const splitByFields = (\n Array.isArray(splitBy) ? splitBy : splitBy != null ? [splitBy] : []\n ).map((value) => normalizeColumnName(value)); // normalize\n\n // keeps track of fields (table columns) used as measures\n const measuresFields: string[] = [];\n // keeps track of the measures specs provided by the user for each derived column; non-normalized names are used as this will be exported;\n const measuresMapping: Record<string, SingleMeasure> = {};\n // defines the new columns to be derived and their agg function\n let measuresColumns: Record<string, string> = {};\n if (typeof measures === \"string\") {\n measuresMapping[measures] = measures;\n const normalizedMeasure = normalizeColumnName(measures); // normalize\n measuresColumns[normalizedMeasure] = getAgFunc(\"sum\", normalizedMeasure);\n measuresFields.push(normalizedMeasure);\n } else if (Array.isArray(measures)) {\n measuresColumns = measures.reduce<Record<string, string>>(\n (acc, value) => {\n let field: string;\n let agFunction: HvChartAggregation;\n let columnName: string;\n if (typeof value === \"string\") {\n measuresMapping[value] = value;\n field = normalizeColumnName(value); // normalize\n agFunction = \"sum\";\n columnName = field;\n } else {\n // finds out if there are more measures for the same field\n const notUnique =\n measures.filter((m) =>\n typeof m === \"string\"\n ? m === value.field\n : m.field === value.field,\n ).length > 1;\n const appendAgg = notUnique && value.agg && value.agg !== \"sum\";\n measuresMapping[\n appendAgg ? `${value.field}_${value.agg}` : value.field\n ] = value;\n field = normalizeColumnName(value.field); // normalize\n agFunction = value.agg ?? \"sum\";\n columnName = appendAgg ? `${field}_${value.agg}` : field;\n }\n\n measuresFields.push(field);\n acc[columnName] = getAgFunc(agFunction, field);\n return acc;\n },\n {},\n );\n } else if (measures != null) {\n measuresMapping[measures.field] = measures;\n const normalizedMeasure = normalizeColumnName(measures.field); // normalize\n measuresColumns[normalizedMeasure] = getAgFunc(\n measures.agg ?? \"sum\",\n normalizedMeasure,\n );\n measuresFields.push(normalizedMeasure);\n }\n\n let sortByFields: Record<string, HvChartOrder> = {};\n if (typeof sortBy === \"string\") {\n const normalizedSort = normalizeColumnName(sortBy); // normalize\n sortByFields[normalizedSort] = \"asc\";\n } else if (Array.isArray(sortBy)) {\n sortByFields = sortBy.reduce<Record<string, HvChartOrder>>(\n (acc, value) => {\n let field: string;\n let orderFunction: HvChartOrder;\n if (typeof value === \"string\") {\n field = normalizeColumnName(value); // normalize;\n orderFunction = \"asc\";\n } else {\n field = normalizeColumnName(value.field); // normalize\n orderFunction = value.order ?? \"asc\";\n }\n acc[field] = orderFunction;\n return acc;\n },\n {},\n );\n } else if (sortBy != null) {\n const normalizedSort = normalizeColumnName(sortBy.field); // normalize\n sortByFields[normalizedSort] = sortBy.order ?? \"asc\";\n }\n\n const allFields = [...groupByFields, ...splitByFields, ...measuresFields];\n\n // --- Confusion matrix ---\n // Recalculate the measures columns according to the delta column\n if (delta) {\n const deltaExpression = Object.keys(measuresColumns).reduce<\n Record<string, string>\n >((acc, curr) => {\n const normalizedMeasure = normalizeColumnName(curr); // normalize\n const normalizedDelta = normalizeColumnName(delta); // normalize\n acc[normalizedMeasure] =\n `d => d.${normalizedMeasure} - d.${normalizedDelta}`;\n return acc;\n }, {});\n\n tableData = tableData.derive(deltaExpression);\n }\n\n // remove unneeded fields\n tableData = tableData.select(...allFields);\n\n // group by groupBy fields\n if (groupByFields.length > 0) {\n tableData = tableData.groupby(groupByFields);\n }\n\n if (splitByFields.length > 0) {\n // pivot by splitBy fields\n tableData = tableData.pivot(splitByFields, measuresColumns);\n } else {\n // if there is no splitBy fields, just aggregate measures fields\n tableData = tableData.rollup(measuresColumns);\n }\n\n // if grouped by multiple fields, create a new joint field\n // as the line chart doesn't implement hierarchical axis label grouping\n if (groupByFields.length > 1) {\n const expression = `d => ${groupByFields\n .map((field) => `d.${field}`)\n .join(\" + '_' + \")}`;\n\n tableData = tableData.derive(\n { [groupByKey]: expression },\n { after: groupByFields[groupByFields.length - 1] },\n );\n }\n\n // sort by sortBy fields\n if (Object.keys(sortByFields).length > 0) {\n tableData = tableData.orderby(\n ...Object.keys(sortByFields)\n // only sort by fields that are in the table, ignore the rest\n .filter((key) => allFields.includes(key))\n .map((key) => (sortByFields[key] === \"desc\" ? desc(key) : key)),\n );\n }\n\n // revert the normalized names to the ones given by the user\n const reversedMapping: Record<string, string> = {};\n for (const column of tableData.columnNames()) {\n if (mapping[column] != null) {\n // use the original name (not normalized)\n reversedMapping[column] = mapping[column];\n } else {\n const found = Object.entries(mapping).find(([key]) =>\n column.includes(key),\n );\n if (found) {\n const [key, value] = found;\n // replace partially with the original name (not normalized)\n reversedMapping[column] = column.replace(key, value as string);\n } else {\n // keep the current name\n reversedMapping[column] = column;\n }\n }\n }\n\n tableData = tableData.select(reversedMapping);\n\n // if a derived field was created, remove the original fields\n if (groupByFields.length > 1) {\n tableData = tableData.select(not(...groupByFields));\n }\n\n return { data: tableData, mapping: measuresMapping };\n }, [\n data,\n filtersProp,\n groupBy,\n splitBy,\n measures,\n sortBy,\n delta,\n groupByKey,\n ]);\n};\n"],"names":[],"mappings":";;;AA0BA,MAAM,YAAY,CAAC,MAA0B,UAC3C,SAAS,UAAU,YAAY,GAAG,IAAI,OAAO,KAAK;AAe7C,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;A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ACtC,eAAA,UAAU,UAAU,eAAe;AACxC,UAAA,QAAQ,MAAM,KAAK,MAAM;AAEX,wBAAA,MAAM,IAAI,QAAQ,MAAM;AAAA,MAAA,OACnC;AACL,cAAM,QAAQ,OAAO,QAAQ,OAAO,EAAE;AAAA,UAAK,CAAC,CAAC,GAAG,MAC9C,OAAO,SAAS,GAAG;AAAA,QACrB;AACA,YAAI,OAAO;AACH,gBAAA,CAAC,KAAK,KAAK,IAAI;AAErB,0BAAgB,MAAM,IAAI,OAAO,QAAQ,KAAK,KAAe;AAAA,QAAA,OACxD;AAEL,0BAAgB,MAAM,IAAI;AAAA,QAAA;AAAA,MAC5B;AAAA,IACF;AAGU,gBAAA,UAAU,OAAO,eAAe;AAGxC,QAAA,cAAc,SAAS,GAAG;AAC5B,kBAAY,UAAU,OAAO,IAAI,GAAG,aAAa,CAAC;AAAA,IAAA;AAGpD,WAAO,EAAE,MAAM,WAAW,SAAS,gBAAgB;AAAA,EAAA,GAClD;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDataZoom.js","sources":["../../../src/hooks/useDataZoom.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvEChartsOption } from \"../types/common\";\n\ninterface HvDataZoomHookProps {\n showHorizontal?: boolean;\n}\n\nexport const useDataZoom = ({\n showHorizontal = false,\n}: HvDataZoomHookProps) => {\n const option = useMemo<Pick<HvEChartsOption, \"dataZoom\">>(() => {\n return {\n dataZoom: showHorizontal\n ? [\n {\n show: true,\n type: \"slider\",\n orient: \"horizontal\",\n },\n {\n show: true,\n type: \"inside\",\n orient: \"horizontal\",\n zoomOnMouseWheel: \"shift\",\n moveOnMouseWheel: true,\n },\n ]\n : [],\n };\n }, [showHorizontal]);\n\n return option;\n};\n"],"names":[],"mappings":";AAQO,MAAM,cAAc,CAAC;AAAA,EAC1B,iBAAiB;AACnB,MAA2B;AACnB,QAAA,SAAS,QAA2C,MAAM;AACvD,WAAA;AAAA,MACL,UAAU,iBACN;AAAA,QACE;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA;AAAA,UACE,MAAM;AAAA,UACN,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,kBAAkB;AAAA,UAClB,kBAAkB;AAAA,QAAA;AAAA,MACpB,IAEF,CAAA;AAAA,IACN;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEZ,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDataset.js","sources":["../../../src/hooks/useDataset.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { internal } from \"arquero\";\n\nimport { HvEChartsOption } from \"../types/common\";\n\nexport const useDataset = (data: internal.ColumnTable) => {\n return useMemo<Pick<HvEChartsOption, \"dataset\">>(() => {\n return {\n dataset: {\n source: data.columnNames().reduce<Record<string, any>>((acc, c) => {\n acc[c] = data.array(c);\n return acc;\n }, {}),\n },\n };\n }, [data]);\n};\n"],"names":[],"mappings":";AAKa,MAAA,aAAa,CAAC,SAA+B;AACxD,SAAO,QAA0C,MAAM;AAC9C,WAAA;AAAA,MACL,SAAS;AAAA,QACP,QAAQ,KAAK,YAAA,EAAc,OAA4B,CAAC,KAAK,MAAM;AACjE,cAAI,CAAC,IAAI,KAAK,MAAM,CAAC;AACd,iBAAA;AAAA,QAAA,GACN,CAAE,CAAA;AAAA,MAAA;AAAA,IAET;AAAA,EAAA,GACC,CAAC,IAAI,CAAC;AACX;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGrid.js","sources":["../../../src/hooks/useGrid.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvChartGrid } from \"../types\";\nimport { HvEChartsOption } from \"../types/common\";\n\ninterface HvGridHookProps {\n top?: HvChartGrid[\"top\"];\n bottom?: HvChartGrid[\"bottom\"];\n left?: HvChartGrid[\"left\"];\n right?: HvChartGrid[\"right\"];\n width?: number | string;\n height?: number | string;\n}\n\nexport const useGrid = ({\n top,\n left,\n right,\n bottom,\n width,\n height,\n}: HvGridHookProps) => {\n const option = useMemo<Pick<HvEChartsOption, \"grid\">>(() => {\n return {\n // if no value is defined we shouldn't pass anything because echarts doesn't behave well otherwise\n grid: {\n ...(top != null && {\n top,\n }),\n ...(bottom != null && {\n bottom,\n }),\n ...(left != null && {\n left,\n }),\n ...(right != null && {\n right,\n }),\n ...(width != null && {\n width,\n }),\n ...(height != null && {\n height,\n }),\n },\n };\n }, [top, left, right, bottom, height, width]);\n\n return option;\n};\n"],"names":[],"mappings":";AAcO,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACf,QAAA,SAAS,QAAuC,MAAM;AACnD,WAAA;AAAA;AAAA,MAEL,MAAM;AAAA,QACJ,GAAI,OAAO,QAAQ;AAAA,UACjB;AAAA,QACF;AAAA,QACA,GAAI,UAAU,QAAQ;AAAA,UACpB;AAAA,QACF;AAAA,QACA,GAAI,QAAQ,QAAQ;AAAA,UAClB;AAAA,QACF;AAAA,QACA,GAAI,SAAS,QAAQ;AAAA,UACnB;AAAA,QACF;AAAA,QACA,GAAI,SAAS,QAAQ;AAAA,UACnB;AAAA,QACF;AAAA,QACA,GAAI,UAAU,QAAQ;AAAA,UACpB;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EAAA,GACC,CAAC,KAAK,MAAM,OAAO,QAAQ,QAAQ,KAAK,CAAC;AAErC,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLegend.js","sources":["../../../src/hooks/useLegend.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvEChartsOption } from \"../types/common\";\nimport { HvChartLegend, HvChartLegendIcon } from \"../types/legend\";\nimport { getLegendIcon } from \"../utils\";\n\ninterface HvLegendHookProps {\n show?: HvChartLegend[\"show\"];\n direction?: HvChartLegend[\"direction\"];\n position?: HvChartLegend[\"position\"];\n series?: Pick<HvEChartsOption, \"series.series\">;\n icon?: HvChartLegendIcon;\n formatter?: string | ((value?: string) => string);\n}\n\nexport const useLegend = ({\n series,\n show,\n icon,\n formatter,\n position: positionProp,\n direction = \"horizontal\",\n}: HvLegendHookProps) => {\n const option = useMemo<Pick<HvEChartsOption, \"legend\">>(() => {\n const position: Record<string, string> = {\n y: positionProp?.y ?? \"top\",\n x: positionProp?.x ?? \"center\",\n };\n\n return {\n legend: {\n show: show ?? (Array.isArray(series) && series.length > 1),\n itemGap: 20,\n formatter,\n orient: direction,\n ...position,\n ...(icon && { icon: getLegendIcon(icon) }),\n ...(!icon && {\n data:\n show !== false && Array.isArray(series)\n ? series.map((s) => {\n let iconType: HvChartLegendIcon = \"line\";\n if (s.areaStyle != null) {\n iconType = \"square\";\n }\n if (s.type === \"scatter\") {\n iconType = \"circle\";\n }\n return {\n name: s.name as string,\n icon: getLegendIcon(iconType),\n };\n })\n : undefined,\n }),\n },\n };\n }, [series, show, icon, formatter, positionProp, direction]);\n\n return option;\n};\n"],"names":[],"mappings":";;AAeO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,YAAY;AACd,MAAyB;AACjB,QAAA,SAAS,QAAyC,MAAM;AAC5D,UAAM,WAAmC;AAAA,MACvC,GAAG,cAAc,KAAK;AAAA,MACtB,GAAG,cAAc,KAAK;AAAA,IACxB;AAEO,WAAA;AAAA,MACL,QAAQ;AAAA,QACN,MAAM,SAAS,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS;AAAA,QACxD,SAAS;AAAA,QACT;AAAA,QACA,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,GAAI,QAAQ,EAAE,MAAM,cAAc,IAAI,EAAE;AAAA,QACxC,GAAI,CAAC,QAAQ;AAAA,UACX,MACE,SAAS,SAAS,MAAM,QAAQ,MAAM,IAClC,OAAO,IAAI,CAAC,MAAM;AAChB,gBAAI,WAA8B;AAC9B,gBAAA,EAAE,aAAa,MAAM;AACZ,yBAAA;AAAA,YAAA;AAET,gBAAA,EAAE,SAAS,WAAW;AACb,yBAAA;AAAA,YAAA;AAEN,mBAAA;AAAA,cACL,MAAM,EAAE;AAAA,cACR,MAAM,cAAc,QAAQ;AAAA,YAC9B;AAAA,UAAA,CACD,IACD;AAAA,QAAA;AAAA,MACR;AAAA,IAEJ;AAAA,EAAA,GACC,CAAC,QAAQ,MAAM,MAAM,WAAW,cAAc,SAAS,CAAC;AAEpD,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOption.js","sources":["../../../src/hooks/useOption.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { HvChartCommonProps, HvEChartsOption } from \"../types/common\";\n\ninterface HvOptionHookProps {\n option: HvEChartsOption;\n onOptionChange?: HvChartCommonProps[\"onOptionChange\"];\n}\n\nexport const useOption = ({\n option: optionProp,\n onOptionChange,\n}: HvOptionHookProps) => {\n const option = useMemo<HvEChartsOption>(() => {\n // Common properties to all charts\n const baseOption = {\n aria: {\n enabled: true,\n },\n animation: false,\n };\n\n const opt = { ...baseOption, ...optionProp };\n\n return onOptionChange ? onOptionChange(opt) : opt;\n }, [onOptionChange, optionProp]);\n\n return option;\n};\n"],"names":[],"mappings":";AASO,MAAM,YAAY,CAAC;AAAA,EACxB,QAAQ;AAAA,EACR;AACF,MAAyB;AACjB,QAAA,SAAS,QAAyB,MAAM;AAE5C,UAAM,aAAa;AAAA,MACjB,MAAM;AAAA,QACJ,SAAS;AAAA,MACX;AAAA,MACA,WAAW;AAAA,IACb;AAEA,UAAM,MAAM,EAAE,GAAG,YAAY,GAAG,WAAW;AAEpC,WAAA,iBAAiB,eAAe,GAAG,IAAI;AAAA,EAAA,GAC7C,CAAC,gBAAgB,UAAU,CAAC;AAExB,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSeries.js","sources":["../../../src/hooks/useSeries.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { internal } from \"arquero\";\nimport {\n BarSeriesOption,\n LineSeriesOption,\n PieSeriesOption,\n ScatterSeriesOption,\n} from \"echarts/charts\";\n\nimport { HvChartEmptyCellMode } from \"../types\";\nimport {\n HvAxisChartCommonProps,\n HvChartCommonProps,\n HvEChartsOption,\n} from \"../types/common\";\nimport {\n BarFullMeasure,\n LineFullMeasure,\n ScatterPlotMeasure,\n} from \"../types/measures\";\nimport { getGroupKey, getMeasure, SingleMeasure } from \"../utils\";\n\ninterface HvSeriesHookProps {\n type: \"line\" | \"bar\" | \"pie\" | \"scatter\" | \"treemap\";\n data: internal.ColumnTable;\n groupBy: HvChartCommonProps[\"groupBy\"];\n measuresMapping: Record<string, SingleMeasure>;\n area?: boolean;\n areaOpacity?: number;\n emptyCellMode?: HvChartEmptyCellMode;\n stack?: HvAxisChartCommonProps[\"stack\"];\n nameFormatter?: HvAxisChartCommonProps[\"seriesNameFormatter\"];\n horizontal?: boolean;\n radius?: number | string | (number | string)[];\n}\n\nexport const useSeries = ({\n groupBy,\n type,\n data,\n measuresMapping,\n nameFormatter,\n stack,\n emptyCellMode,\n radius,\n horizontal = false,\n area = false,\n areaOpacity = 0.5,\n}: HvSeriesHookProps) => {\n const groupByKey = getGroupKey(groupBy);\n\n const option: Pick<HvEChartsOption, \"series\"> = useMemo<\n Pick<HvEChartsOption, \"series\">\n >(() => {\n return {\n series: data\n .columnNames()\n .filter((c) => c !== groupByKey)\n .map((c) => {\n const measure = getMeasure(c, measuresMapping);\n\n let pieOps: PieSeriesOption = {};\n let lineOps: LineSeriesOption = {};\n let barOps: BarSeriesOption = {};\n let scatterOps: ScatterSeriesOption = {};\n\n // scatter\n if (type === \"scatter\") {\n const yAxisId =\n typeof measure !== \"string\"\n ? (measure as ScatterPlotMeasure).yAxis\n : undefined;\n scatterOps = {\n yAxisId,\n encode: {\n x: groupByKey,\n y: c,\n },\n };\n }\n\n // pie\n if (type === \"pie\") {\n pieOps = {\n encode: {\n value: c,\n itemName: groupByKey,\n },\n labelLine: {\n show: false,\n },\n label: {\n show: false,\n },\n emphasis: {\n label: {\n show: false,\n },\n },\n radius,\n };\n }\n\n // line or bar\n if (type === \"line\" || type === \"bar\") {\n const sampling =\n typeof measure !== \"string\"\n ? (measure as LineFullMeasure | BarFullMeasure).sampling\n : undefined;\n const yAxisId =\n typeof measure !== \"string\"\n ? (measure as LineFullMeasure | BarFullMeasure).yAxis\n : undefined;\n const stackName =\n typeof measure !== \"string\"\n ? ((measure as LineFullMeasure | BarFullMeasure).stack ??\n stack ??\n undefined)\n : (stack ?? undefined);\n\n const axisOps = {\n sampling,\n yAxisId,\n stack: stackName,\n encode: horizontal\n ? {\n x: c,\n y: groupByKey,\n }\n : {\n x: groupByKey,\n y: c,\n },\n };\n\n // bar\n if (type === \"bar\") {\n barOps = {\n ...axisOps,\n barMaxWidth: 90,\n barMinWidth: 3,\n };\n }\n\n // line\n if (type === \"line\") {\n const showSymbol =\n typeof measure !== \"string\"\n ? !(measure as LineFullMeasure).hideSymbol\n : true;\n const connectNulls =\n typeof measure !== \"string\" &&\n (measure as LineFullMeasure).emptyCellMode\n ? (measure as LineFullMeasure).emptyCellMode === \"connect\"\n : emptyCellMode === \"connect\";\n const isArea =\n typeof measure !== \"string\"\n ? ((measure as LineFullMeasure).area ?? area)\n : area;\n const aOpacity =\n typeof measure !== \"string\"\n ? ((measure as LineFullMeasure).areaOpacity ?? areaOpacity)\n : areaOpacity;\n\n lineOps = {\n ...axisOps,\n connectNulls,\n showSymbol,\n areaStyle: isArea ? { opacity: aOpacity } : undefined,\n };\n }\n }\n\n return {\n id: `series~${groupByKey}~${c}`,\n type,\n name: nameFormatter ? nameFormatter(c) : c,\n ...pieOps,\n ...barOps,\n ...lineOps,\n ...scatterOps,\n };\n }),\n };\n }, [\n data,\n groupByKey,\n measuresMapping,\n type,\n nameFormatter,\n radius,\n stack,\n horizontal,\n emptyCellMode,\n area,\n areaOpacity,\n ]);\n\n return option;\n};\n"],"names":[],"mappings":";;AAoCO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,OAAO;AAAA,EACP,cAAc;AAChB,MAAyB;AACjB,QAAA,aAAa,YAAY,OAAO;AAEhC,QAAA,SAA0C,QAE9C,MAAM;AACC,WAAA;AAAA,MACL,QAAQ,KACL,YAAY,EACZ,OAAO,CAAC,MAAM,MAAM,UAAU,EAC9B,IAAI,CAAC,MAAM;AACJ,cAAA,UAAU,WAAW,GAAG,eAAe;AAE7C,YAAI,SAA0B,CAAC;AAC/B,YAAI,UAA4B,CAAC;AACjC,YAAI,SAA0B,CAAC;AAC/B,YAAI,aAAkC,CAAC;AAGvC,YAAI,SAAS,WAAW;AACtB,gBAAM,UACJ,OAAO,YAAY,WACd,QAA+B,QAChC;AACO,uBAAA;AAAA,YACX;AAAA,YACA,QAAQ;AAAA,cACN,GAAG;AAAA,cACH,GAAG;AAAA,YAAA;AAAA,UAEP;AAAA,QAAA;AAIF,YAAI,SAAS,OAAO;AACT,mBAAA;AAAA,YACP,QAAQ;AAAA,cACN,OAAO;AAAA,cACP,UAAU;AAAA,YACZ;AAAA,YACA,WAAW;AAAA,cACT,MAAM;AAAA,YACR;AAAA,YACA,OAAO;AAAA,cACL,MAAM;AAAA,YACR;AAAA,YACA,UAAU;AAAA,cACR,OAAO;AAAA,gBACL,MAAM;AAAA,cAAA;AAAA,YAEV;AAAA,YACA;AAAA,UACF;AAAA,QAAA;AAIE,YAAA,SAAS,UAAU,SAAS,OAAO;AACrC,gBAAM,WACJ,OAAO,YAAY,WACd,QAA6C,WAC9C;A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
|
|
1
|
-
{"version":3,"file":"useVisualMap.js","sources":["../../../src/hooks/useVisualMap.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { VisualMapComponentOption } from \"echarts\";\n\nimport { HvChartLegend } from \"../types\";\nimport { HvEChartsOption } from \"../types/common\";\nimport { getLegendIcon } from \"../utils\";\n\nexport type HvVisualMapHookProps = VisualMapComponentOption & {\n show?: boolean;\n pieces?: Record<string, string | number>[];\n max?: number;\n min?: number;\n colorScale?: string[];\n type?: \"continuous\" | \"piecewise\";\n // Uses the same props as the legend\n position?: HvChartLegend[\"position\"];\n direction?: HvChartLegend[\"direction\"];\n};\n\nexport const useVisualMap = ({\n show = true,\n direction = \"horizontal\",\n type = \"continuous\",\n pieces,\n max,\n min,\n colorScale,\n position: positionProp,\n ...others\n}: HvVisualMapHookProps) => {\n const option = useMemo<Pick<HvEChartsOption, \"visualMap\">>(() => {\n return {\n visualMap: {\n type,\n show,\n ...(pieces && {\n pieces,\n }),\n ...(type === \"piecewise\" && {\n itemSymbol: getLegendIcon(\"square\"),\n itemGap: 20,\n itemHeight: 16,\n itemWidth: 16,\n }),\n ...(colorScale && {\n max,\n min,\n inRange: {\n color: colorScale,\n },\n }),\n orient: direction,\n top: positionProp?.y || \"top\",\n left: positionProp?.x || \"center\",\n ...others,\n },\n };\n }, [\n colorScale,\n direction,\n max,\n min,\n others,\n\n pieces,\n positionProp?.x,\n positionProp?.y,\n show,\n type,\n ]);\n\n return option;\n};\n"],"names":[],"mappings":";;AAmBO,MAAM,eAAe,CAAC;AAAA,EAC3B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,MAA4B;AACpB,QAAA,SAAS,QAA4C,MAAM;AACxD,WAAA;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,GAAI,UAAU;AAAA,UACZ;AAAA,QACF;AAAA,QACA,GAAI,SAAS,eAAe;AAAA,UAC1B,YAAY,cAAc,QAAQ;AAAA,UAClC,SAAS;AAAA,UACT,YAAY;AAAA,UACZ,WAAW;AAAA,QACb;AAAA,QACA,GAAI,cAAc;AAAA,UAChB;AAAA,UACA;AAAA,UACA,SAAS;AAAA,YACP,OAAO;AAAA,UAAA;AAAA,QAEX;AAAA,QACA,QAAQ;AAAA,QACR,KAAK,cAAc,KAAK;AAAA,QACxB,MAAM,cAAc,KAAK;AAAA,QACzB,GAAG;AAAA,MAAA;AAAA,IAEP;AAAA,EAAA,GACC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA,cAAc;AAAA,IACd,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EAAA,CACD;AAEM,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVizTheme.js","sources":["../../../src/hooks/useVizTheme.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { HvVizContext, HvVizContextValue } from \"../providers/Provider\";\n\nexport const useVizTheme = (): HvVizContextValue => {\n return useContext(HvVizContext);\n};\n"],"names":[],"mappings":";;AAIO,MAAM,cAAc,MAAyB;AAClD,SAAO,WAAW,YAAY;AAChC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useXAxis.js","sources":["../../../src/hooks/useXAxis.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useTheme } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvChartXAxis, HvEChartsOption } from \"../types/common\";\nimport { getAxisType } from \"../utils\";\n\ninterface HvXAxisHookProps extends HvChartXAxis {\n scale?: boolean;\n data?: string[];\n}\n\nexport const useXAxis = ({\n id,\n type = \"categorical\",\n labelFormatter,\n labelRotation,\n name,\n maxValue,\n minValue,\n scale = false,\n data,\n position,\n nameProps,\n}: HvXAxisHookProps) => {\n const { colors } = useTheme();\n\n const option = useMemo<Pick<HvEChartsOption, \"xAxis\">>(() => {\n const nameStyleKeys = nameProps\n ? Object.keys(nameProps).filter((key) => key !== \"location\")\n : undefined;\n const nameStyle =\n nameProps && nameStyleKeys\n ? nameStyleKeys.reduce<Record<string, any>>((acc, curr) => {\n acc[curr] =\n (curr === \"color\" && colors?.[nameProps[curr] as string]) ||\n nameProps[curr as keyof typeof nameProps];\n return acc;\n }, {})\n : undefined;\n\n return {\n xAxis: {\n id,\n type: getAxisType(type),\n name,\n scale,\n axisLabel: {\n rotate: labelRotation ?? 0,\n formatter: labelFormatter,\n },\n max: maxValue === \"max\" ? \"dataMax\" : maxValue,\n min: minValue === \"min\" ? \"dataMin\" : minValue,\n ...(nameProps?.location && {\n nameLocation: nameProps.location,\n }),\n ...(nameStyle && {\n nameTextStyle: nameStyle,\n }),\n ...(data && { data }),\n ...(position && { position }),\n },\n };\n }, [\n nameProps,\n id,\n type,\n name,\n scale,\n labelRotation,\n labelFormatter,\n maxValue,\n minValue,\n data,\n position,\n colors,\n ]);\n\n return option;\n};\n"],"names":[],"mappings":";;;AAWO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AACF,MAAwB;AAChB,QAAA,EAAE,OAAO,IAAI,SAAS;AAEtB,QAAA,SAAS,QAAwC,MAAM;AACrD,UAAA,gBAAgB,YAClB,OAAO,KAAK,SAAS,EAAE,OAAO,CAAC,QAAQ,QAAQ,UAAU,IACzD;AACJ,UAAM,YACJ,aAAa,gBACT,cAAc,OAA4B,CAAC,KAAK,SAAS;AACnD,UAAA,IAAI,IACL,SAAS,WAAW,SAAS,UAAU,IAAI,CAAW,KACvD,UAAU,IAA8B;AACnC,aAAA;AAAA,IAAA,GACN,CAAA,CAAE,IACL;AAEC,WAAA;AAAA,MACL,OAAO;AAAA,QACL;AAAA,QACA,MAAM,YAAY,IAAI;AAAA,QACtB;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,QAAQ,iBAAiB;AAAA,UACzB,WAAW;AAAA,QACb;AAAA,QACA,KAAK,aAAa,QAAQ,YAAY;AAAA,QACtC,KAAK,aAAa,QAAQ,YAAY;AAAA,QACtC,GAAI,WAAW,YAAY;AAAA,UACzB,cAAc,UAAU;AAAA,QAC1B;AAAA,QACA,GAAI,aAAa;AAAA,UACf,eAAe;AAAA,QACjB;AAAA,QACA,GAAI,QAAQ,EAAE,KAAK;AAAA,QACnB,GAAI,YAAY,EAAE,SAAS;AAAA,MAAA;AAAA,IAE/B;AAAA,EAAA,GACC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAEM,SAAA;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useYAxis.js","sources":["../../../src/hooks/useYAxis.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { useTheme } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvChartAxisType } from \"../types\";\nimport { HvEChartsOption, YAxis } from \"../types/common\";\nimport { getAxisType } from \"../utils\";\n\ninterface HvYAxisHookProps {\n axes?: YAxis[];\n defaultType?: HvChartAxisType;\n}\n\nexport const useYAxis = ({\n axes,\n defaultType = \"continuous\",\n}: HvYAxisHookProps) => {\n const { colors } = useTheme();\n\n const createAxis = useCallback(\n ({\n id,\n type,\n name,\n labelFormatter,\n labelRotation,\n maxValue,\n minValue,\n nameProps,\n data,\n position,\n }: YAxis) => {\n const nameStyleKeys = nameProps\n ? Object.keys(nameProps).filter((key) => key !== \"location\")\n : undefined;\n const nameStyle =\n nameProps && nameStyleKeys\n ? nameStyleKeys.reduce<Record<string, any>>((acc, curr) => {\n acc[curr] =\n (curr === \"color\" && colors?.[nameProps[curr] as string]) ||\n nameProps[curr as keyof typeof nameProps];\n return acc;\n }, {})\n : undefined;\n\n return {\n id,\n type: getAxisType(type) ?? getAxisType(defaultType),\n name,\n axisLabel: {\n rotate: labelRotation ?? 0,\n formatter: labelFormatter,\n },\n max: maxValue === \"max\" ? \"dataMax\" : maxValue,\n min: minValue === \"min\" ? \"dataMin\" : minValue,\n ...(nameProps?.location && {\n nameLocation: nameProps?.location,\n }),\n ...(nameStyle && {\n nameTextStyle: nameStyle,\n }),\n ...(data && { data }),\n ...(position && { position }),\n };\n },\n [colors, defaultType],\n );\n\n const option = useMemo<Pick<HvEChartsOption, \"yAxis\">>(() => {\n return {\n yAxis: Array.isArray(axes)\n ? axes.map((axis) => createAxis(axis))\n : [createAxis({})],\n };\n }, [axes, createAxis]);\n\n return option;\n};\n"],"names":[],"mappings":";;;AAYO,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,cAAc;AAChB,MAAwB;AAChB,QAAA,EAAE,OAAO,IAAI,SAAS;AAE5B,QAAM,aAAa;AAAA,IACjB,CAAC;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,MACW;AACL,YAAA,gBAAgB,YAClB,OAAO,KAAK,SAAS,EAAE,OAAO,CAAC,QAAQ,QAAQ,UAAU,IACzD;AACJ,YAAM,YACJ,aAAa,gBACT,cAAc,OAA4B,CAAC,KAAK,SAAS;AACnD,YAAA,IAAI,IACL,SAAS,WAAW,SAAS,UAAU,IAAI,CAAW,KACvD,UAAU,IAA8B;AACnC,eAAA;AAAA,MAAA,GACN,CAAA,CAAE,IACL;AAEC,aAAA;AAAA,QACL;AAAA,QACA,MAAM,YAAY,IAAI,KAAK,YAAY,WAAW;AAAA,QAClD;AAAA,QACA,WAAW;AAAA,UACT,QAAQ,iBAAiB;AAAA,UACzB,WAAW;AAAA,QACb;AAAA,QACA,KAAK,aAAa,QAAQ,YAAY;AAAA,QACtC,KAAK,aAAa,QAAQ,YAAY;AAAA,QACtC,GAAI,WAAW,YAAY;AAAA,UACzB,cAAc,WAAW;AAAA,QAC3B;AAAA,QACA,GAAI,aAAa;AAAA,UACf,eAAe;AAAA,QACjB;AAAA,QACA,GAAI,QAAQ,EAAE,KAAK;AAAA,QACnB,GAAI,YAAY,EAAE,SAAS;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,WAAW;AAAA,EACtB;AAEM,QAAA,SAAS,QAAwC,MAAM;AACpD,WAAA;AAAA,MACL,OAAO,MAAM,QAAQ,IAAI,IACrB,KAAK,IAAI,CAAC,SAAS,WAAW,IAAI,CAAC,IACnC,CAAC,WAAW,CAAA,CAAE,CAAC;AAAA,IACrB;AAAA,EAAA,GACC,CAAC,MAAM,UAAU,CAAC;AAEd,SAAA;AACT;"}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sources":["../../../src/providers/Provider.tsx"],"sourcesContent":["import { createContext, useMemo } from \"react\";\nimport { useTheme, type HvTheme } from \"@hitachivantara/uikit-react-utils\";\n\nimport { registerTheme } from \"../utils/registerTheme\";\n\nexport interface HvVizContextValue {\n /**\n * Current theme\n */\n theme?: string;\n /**\n * The current active theme\n */\n activeTheme?: HvTheme;\n}\n\nexport const HvVizContext = createContext<HvVizContextValue>({\n theme: undefined,\n});\n\nexport interface HvVizProviderProps {\n /**\n * Component tree.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Enables theming capabilities for visualizations.\n *\n * Without this provider the visualizations will not comply to the UI Kit themes.\n *\n * This provider should always be used in combination with the `HvProvider` from\n * the core package since the former uses the themes provided by the latter.\n *\n * `HvVizProvider` should always be used after `HvProvider` like so to work properly:\n *\n * ```\n * <HvProvider>\n * <HvVizProvider>\n * (...)\n * </HvVizProvider>\n * </HvProvider>\n * ```\n */\nexport const HvVizProvider = ({ children }: HvVizProviderProps) => {\n const { activeTheme, selectedMode, selectedTheme } = useTheme();\n\n const value = useMemo(() => {\n const themeName = `${selectedTheme}-${selectedMode}`;\n registerTheme(themeName, selectedMode, activeTheme);\n return { theme: themeName, activeTheme };\n }, [selectedTheme, selectedMode, activeTheme]);\n\n return (\n <HvVizContext.Provider value={value}>{children}</HvVizContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;AAgBO,MAAM,eAAe,cAAiC;AAAA,EAC3D,OAAO;AACT,CAAC;AA2BM,MAAM,gBAAgB,CAAC,EAAE,eAAmC;AACjE,QAAM,EAAE,aAAa,cAAc,cAAA,IAAkB,SAAS;AAExD,QAAA,QAAQ,QAAQ,MAAM;AAC1B,UAAM,YAAY,GAAG,aAAa,IAAI,YAAY;AACpC,kBAAA,WAAW,cAAc,WAAW;AAC3C,WAAA,EAAE,OAAO,WAAW,YAAY;AAAA,EACtC,GAAA,CAAC,eAAe,cAAc,WAAW,CAAC;AAE7C,SACG,oBAAA,aAAa,UAAb,EAAsB,OAAe,SAAS,CAAA;AAEnD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utils/index.ts"],"sourcesContent":["import { from, internal, table } from \"arquero\";\nimport type ColumnTable from \"arquero/dist/types/table/column-table\";\n\nimport type {\n HvBarChartMeasures,\n HvChartAxisType,\n HvChartData,\n HvChartFilter,\n HvChartFilterOperation,\n HvConfusionMatrixMeasure,\n HvDonutChartMeasure,\n HvLineChartMeasures,\n} from \"../types\";\nimport { HvChartCommonProps } from \"../types/common\";\nimport { HvChartLegendIcon } from \"../types/legend\";\nimport { HvScatterPlotMeasure } from \"../types/measures\";\n\nexport const getAxisType = (type?: HvChartAxisType) => {\n switch (type) {\n case \"categorical\":\n return \"category\";\n case \"time\":\n return \"time\";\n case \"continuous\":\n return \"value\";\n default:\n return undefined;\n }\n};\n\nexport const getGroupKey = (groupBy: HvChartCommonProps[\"groupBy\"]) =>\n Array.isArray(groupBy) ? groupBy.join(\"_\") : groupBy;\n\nexport const getLegendIcon = (icon: HvChartLegendIcon) => {\n switch (icon) {\n case \"circle\":\n return \"circle\";\n case \"square\":\n return \"path://M0,0L16,0L16,16L0,16L0,0Z\";\n case \"line\":\n default:\n return \"path://M0,0L16,0L16,2L0,2Z\";\n }\n};\n\nexport type SingleMeasure =\n | HvLineChartMeasures\n | HvBarChartMeasures\n | HvScatterPlotMeasure\n | HvDonutChartMeasure\n | HvConfusionMatrixMeasure;\n\nexport const getMeasure = (\n name: string,\n mapping: Record<string, SingleMeasure>,\n) => {\n // find the key that matches the most number of characters\n // we are not doing the first match because columns can be repeated if they use different agg functions\n let measure: SingleMeasure | undefined;\n let count = 0;\n for (const key of Object.keys(mapping)) {\n if (name.includes(key) && key.length >= count) {\n count = key.length;\n measure = mapping[key];\n }\n }\n // return the found measure in measures array or return the first one\n return measure ?? Object.values(mapping)[0];\n};\n\nexport const getFilterFunction = (\n operation: HvChartFilterOperation,\n field: HvChartFilter[\"field\"],\n value: HvChartFilter[\"value\"],\n) => {\n const valueArray = Array.isArray(value) ? value : [value];\n if (valueArray.length === 0) return () => true;\n\n switch (operation) {\n case \"is\": {\n return (row: any) => valueArray.includes(row[field]);\n }\n case \"isNot\": {\n return (row: any) => !valueArray.includes(row[field]);\n }\n case \"contains\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (String(row[field]).includes(String(val))) {\n include = true;\n }\n }\n return include;\n };\n case \"notContains\":\n return (row: any) => {\n let include = true;\n for (const val of valueArray) {\n if (String(row[field]).includes(String(val))) {\n include = false;\n }\n }\n return include;\n };\n case \"greaterThan\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (row[field] > val) {\n include = true;\n }\n }\n return include;\n };\n case \"greaterThanOrEqual\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (row[field] >= val) {\n include = true;\n }\n }\n return include;\n };\n case \"lessThan\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (row[field] < val) {\n include = true;\n }\n }\n return include;\n };\n case \"lessThanOrEqual\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (row[field] <= val) {\n include = true;\n }\n }\n return include;\n };\n case \"between\":\n return (row: any) =>\n row[field] >= valueArray[0] && row[field] <= valueArray[1];\n case \"ends\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (String(row[field]).endsWith(String(val))) {\n include = true;\n }\n }\n return include;\n };\n case \"notEnds\":\n return (row: any) => {\n let include = true;\n for (const val of valueArray) {\n if (String(row[field]).endsWith(String(val))) {\n include = false;\n }\n }\n return include;\n };\n case \"starts\":\n return (row: any) => {\n let include = false;\n for (const val of valueArray) {\n if (String(row[field]).startsWith(String(val))) {\n include = true;\n }\n }\n return include;\n };\n case \"notStarts\":\n return (row: any) => {\n let include = true;\n for (const val of valueArray) {\n if (String(row[field]).startsWith(String(val))) {\n include = false;\n }\n }\n return include;\n };\n\n default:\n throw new Error(\"Unsupported operation\");\n }\n};\n\n// Note: Exported to the users\n/**\n * Combine filter functions into a single function. Only rows that pass all filters will be included.\n * Should be used inside the `escape` function provided by Arquero.\n * */\nexport const getHvArqueroCombinedFilters = (\n row: any,\n filters: HvChartFilter[],\n) => {\n return filters.every((filter) => {\n const { field, operation, value } = filter;\n const filterFunction = Object.hasOwn(row, field)\n ? getFilterFunction(operation, field, value)\n : () => true;\n return filterFunction(row);\n });\n};\n\n/**\n * Normalizes a column name by replacing all characters that are not letters or numbers by \"__\"\n */\nexport const normalizeColumnName = (string: string) => {\n return string.replace(/[^a-zA-Z0-9]/g, \"__\");\n};\n\n/**\n * Converts data to a arquero data table and normalizes the column names for data processing.\n * @param data Chart data\n * @returns Processed data and reversed columns mapping to switch the columns to their original name\n */\nexport const processTableData = (data: HvChartData) => {\n let tableData: ColumnTable;\n if (data instanceof internal.ColumnTable) {\n tableData = data;\n } else if (Array.isArray(data)) {\n tableData = from(data);\n } else {\n tableData = table(data);\n }\n\n // Normalize the column names to remove any special character and spaces since it can lead to errors during processing\n const nameMapping: Record<string, string> = {};\n const reversedNameMapping: Record<string, string> = {};\n for (const column of tableData.columnNames()) {\n const normalizedName = normalizeColumnName(column);\n nameMapping[column] = normalizedName;\n reversedNameMapping[normalizedName] = column;\n }\n\n return {\n data: tableData.select(nameMapping),\n mapping: reversedNameMapping,\n };\n};\n"],"names":[],"mappings":";AAiBa,MAAA,cAAc,CAAC,SAA2B;AACrD,UAAQ,MAAM;AAAA,IACZ,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EAAA;AAEb;AAEa,MAAA,cAAc,CAAC,YAC1B,MAAM,QAAQ,OAAO,IAAI,QAAQ,KAAK,GAAG,IAAI;AAElC,MAAA,gBAAgB,CAAC,SAA4B;AACxD,UAAQ,MAAM;AAAA,IACZ,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL;AACS,aAAA;AAAA,EAAA;AAEb;AASa,MAAA,aAAa,CACxB,MACA,YACG;AAGC,MAAA;AACJ,MAAI,QAAQ;AACZ,aAAW,OAAO,OAAO,KAAK,OAAO,GAAG;AACtC,QAAI,KAAK,SAAS,GAAG,KAAK,IAAI,UAAU,OAAO;AAC7C,cAAQ,IAAI;AACZ,gBAAU,QAAQ,GAAG;AAAA,IAAA;AAAA,EACvB;AAGF,SAAO,WAAW,OAAO,OAAO,OAAO,EAAE,CAAC;AAC5C;AAEO,MAAM,oBAAoB,CAC/B,WACA,OACA,UACG;AACH,QAAM,aAAa,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AACxD,MAAI,WAAW,WAAW,EAAG,QAAO,MAAM;AAE1C,UAAQ,WAAW;AAAA,IACjB,KAAK,MAAM;AACT,aAAO,CAAC,QAAa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K,IAC3C,kBAAkB,WAAW,OAAO,KAAK,IACzC,MAAM;AACV,WAAO,eAAe,GAAG;AAAA,EAAA,CAC1B;AACH;AAKa,MAAA,sBAAsB,CAAC,WAAmB;AAC9C,SAAA,OAAO,QAAQ,iBAAiB,IAAI;AAC7C;AAOa,MAAA,mBAAmB,CAAC,SAAsB;AACjD,MAAA;AACA,MAAA,gBAAgB,SAAS,aAAa;AAC5B,gBAAA;AAAA,EACH,WAAA,MAAM,QAAQ,IAAI,GAAG;AAC9B,gBAAY,KAAK,IAAI;AAAA,EAAA,OAChB;AACL,gBAAY,MAAM,IAAI;AAAA,EAAA;AAIxB,QAAM,cAAsC,CAAC;AAC7C,QAAM,sBAA8C,CAAC;AAC1C,aAAA,UAAU,UAAU,eAAe;AACtC,UAAA,iBAAiB,oBAAoB,MAAM;AACjD,gBAAY,MAAM,IAAI;AACtB,wBAAoB,cAAc,IAAI;AAAA,EAAA;AAGjC,SAAA;AAAA,IACL,MAAM,UAAU,OAAO,WAAW;AAAA,IAClC,SAAS;AAAA,EACX;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerTheme.js","sources":["../../../src/utils/registerTheme.ts"],"sourcesContent":["import * as echarts from \"echarts/core\";\nimport { type HvTheme } from \"@hitachivantara/uikit-react-utils\";\n\nexport const registerTheme = (\n themeName: string,\n mode: string,\n themeStructure?: HvTheme,\n) => {\n const colors = themeStructure?.colors.modes[mode];\n // if theme & mode is invalid, exit (to use the default theme)\n if (!colors) return;\n\n const baseText = {\n color: colors?.secondary,\n fontWeight: themeStructure?.fontWeights.normal,\n fontSize: themeStructure?.fontSizes.sm,\n fontFamily: themeStructure?.fontFamily.body,\n };\n\n const customAxis = {\n nameTextStyle: {\n ...baseText,\n color: colors?.secondary_80,\n },\n axisLine: {\n show: true,\n lineStyle: {\n color: colors?.atmo3,\n },\n },\n axisTick: {\n show: true,\n lineStyle: {\n color: colors?.atmo3,\n },\n },\n axisLabel: {\n color: colors?.secondary_80,\n fontWeight: themeStructure?.fontWeights.normal,\n fontSize: themeStructure?.fontSizes.sm,\n fontFamily: themeStructure?.fontFamily.body,\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: colors?.atmo3,\n },\n },\n };\n\n echarts.registerTheme(themeName, {\n color: [\n colors?.cat1,\n colors?.cat2,\n colors?.cat3,\n colors?.cat4,\n colors?.cat5,\n colors?.cat6,\n colors?.cat7,\n colors?.cat8,\n colors?.cat9,\n colors?.cat10,\n colors?.cat11,\n colors?.cat12,\n ],\n legend: {\n textStyle: {\n ...baseText,\n },\n },\n tooltip: {\n borderWidth: 0,\n padding: 0,\n textStyle: {\n ...baseText,\n },\n axisPointer: {\n lineStyle: {\n color: colors?.secondary,\n width: 1,\n },\n },\n },\n dataZoom: {\n textStyle: { ...baseText },\n },\n categoryAxis: {\n ...customAxis,\n },\n valueAxis: {\n ...customAxis,\n },\n logAxis: {\n ...customAxis,\n },\n timeAxis: {\n ...customAxis,\n },\n line: {\n lineStyle: {\n width: 2,\n },\n },\n visualMap: {\n textStyle: {\n ...baseText,\n },\n },\n heatmap: {\n label: {\n fontWeight: baseText.fontWeight,\n fontSize: baseText.fontSize,\n fontFamily: baseText.fontFamily,\n },\n itemStyle: {\n borderColor: colors?.atmo3,\n borderWidth: 1,\n },\n },\n treemap: {\n breadcrumb: {\n itemStyle: {\n color: colors?.secondary,\n textStyle: {\n color: colors?.atmo1,\n },\n },\n },\n },\n });\n};\n"],"names":[],"mappings":";AAGO,MAAM,gBAAgB,CAC3B,WACA,MACA,mBACG;AACH,QAAM,SAAS,gBAAgB,OAAO,MAAM,IAAI;AAEhD,MAAI,CAAC,OAAQ;AAEb,QAAM,WAAW;AAAA,IACf,OAAO,QAAQ;AAAA,IACf,YAAY,gBAAgB,YAAY;AAAA,IACxC,UAAU,gBAAgB,UAAU;AAAA,IACpC,YAAY,gBAAgB,WAAW;AAAA,EACzC;AAEA,QAAM,aAAa;AAAA,IACjB,eAAe;AAAA,MACb,GAAG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