@hitachivantara/uikit-react-viz 5.15.18 → 5.15.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,8 +30,14 @@ const useColorScale = ({
30
30
  }, []);
31
31
  const max = Math.max(...flatData);
32
32
  const min = Math.min(...flatData);
33
+ const parsedColors = custom?.map(
34
+ (c) => typeof c === "string" ? colors?.[c] || c : c.color
35
+ );
33
36
  return {
34
- colorScale: custom || [colors?.base_light || "", colors?.cat3 || ""],
37
+ colorScale: parsedColors || [
38
+ colors?.base_light || "",
39
+ colors?.cat3 || ""
40
+ ],
35
41
  max,
36
42
  min
37
43
  };
@@ -1 +1 @@
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\";\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?: [string, string] | 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":";;;;;;;;;;;;;;;;AAwCA,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,I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AAAA,IACnB,GAAG;AAAA,EAAA,CACJ;AAEK,QAAA,OAAO,QAAQ,MAAM;AAClB,WAAA;AAAA,MACL;AAAA;AAAA;AAAA,MAGA,QACE,UACA,gBAAgB,KAAK,SACnB,gBAAgB,QAAQ,SACxB,gBAAgB,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
+ {"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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AAA,IAC7C,eAAe,WAAW,MAAM;AAAA,EAAA,CACjC;AAED,QAAM,YAAY,QAAQ;AAAA;AAAA,IAExB,OAAO,SAAS,OAAO,SAAY,gBAAgB,KAAK;AAAA,IACxD,QAAQ,UAAU,OAAO,SAAY,gBAAgB,KAAK;AAAA,IAC1D,GAAG,gBAAgB;AAAA,IACnB,GAAG;AAAA,EAAA,CACJ;AAEK,QAAA,OAAO,QAAQ,MAAM;AAClB,WAAA;AAAA,MACL;AAAA;AAAA;AAAA,MAGA,QACE,UACA,gBAAgB,KAAK,SACnB,gBAAgB,QAAQ,SACxB,gBAAgB,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;"}
@@ -28,8 +28,14 @@ const useColorScale = ({
28
28
  }, []);
29
29
  const max = Math.max(...flatData);
30
30
  const min = Math.min(...flatData);
31
+ const parsedColors = custom?.map(
32
+ (c) => typeof c === "string" ? colors?.[c] || c : c.color
33
+ );
31
34
  return {
32
- colorScale: custom || [colors?.base_light || "", colors?.cat3 || ""],
35
+ colorScale: parsedColors || [
36
+ colors?.base_light || "",
37
+ colors?.cat3 || ""
38
+ ],
33
39
  max,
34
40
  min
35
41
  };
@@ -1 +1 @@
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 return {\n colorScale: custom || [colors?.base_light || \"\", colors?.cat3 || \"\"],\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,\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AAA,OAAO,QAAQ,MAAM;AACzB,UAAM,QAAQ,KAAK,MAAM,SAAS,EAAE;AAC9B,UAAA,QAAQ,KAAK,cAAc,OAAO,CAAC,MAAM,MAAM,SAAS,EAAE;AAChE,UAAM,aAAa,WAAW,WAAW,cAAc,cAAc;AAE9D,WAAA;AAAA,MACL,SAAS;AAAA,QACP,QACE,kBAAkB,YACjB,oBAAoB,uBAAuB,WACxC,KACA;AAAA,QACN,KACE,kBAAkB,SACjB,oBAAoB,uBAAuB,QACxC,KACA;AAAA,QACN,GAAI,oBACF,uBAAuB,YACvB,kBAAkB,YAAY;AAAA,UAC5B,QAAQ;AAAA,QACV;AAAA,QACF,GAAI,oBACF,uBAAuB,SACvB,kBAAkB,SAAS;AAAA,UACzB,KAAK;AAAA,QACP;AAAA,QACF,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACJ,QAAQ,KAAK,IAAI,aAAa,OAAO,aAAa,CAAC;AAAA,QACnD,OAAO,KAAK,IAAI,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
+ {"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;A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AC,MAAM,MAAM,SAAS,EAAE;AAChE,UAAM,aAAa,WAAW,WAAW,cAAc,cAAc;AAE9D,WAAA;AAAA,MACL,SAAS;AAAA,QACP,QACE,kBAAkB,YACjB,oBAAoB,uBAAuB,WACxC,KACA;AAAA,QACN,KACE,kBAAkB,SACjB,oBAAoB,uBAAuB,QACxC,KACA;AAAA,QACN,GAAI,oBACF,uBAAuB,YACvB,kBAAkB,YAAY;AAAA,UAC5B,QAAQ;AAAA,QACV;AAAA,QACF,GAAI,oBACF,uBAAuB,SACvB,kBAAkB,SAAS;AAAA,UACzB,KAAK;AAAA,QACP;AAAA,QACF,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACJ,QAAQ,KAAK,IAAI,aAAa,OAAO,aAAa,CAAC;AAAA,QACnD,OAAO,KAAK,IAAI,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;"}
@@ -348,7 +348,7 @@ export declare interface HvConfusionMatrixProps extends Omit<HvChartCommonProps,
348
348
  * An array of objects can also be used to create a custom scale.
349
349
  * If `delta` is not provided, a default color scale is used when `colorScale` is not defined: `[base-light, cat3]`.
350
350
  */
351
- colorScale?: [string, string] | HvConfusionMatrixColorScale[];
351
+ colorScale?: [HvColorAny, HvColorAny] | HvConfusionMatrixColorScale[];
352
352
  }
353
353
 
354
354
  export declare interface HvConfusionMatrixValuesProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-viz",
3
- "version": "5.15.18",
3
+ "version": "5.15.19",
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 || ^18.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@hitachivantara/uikit-react-utils": "^0.2.25",
37
- "@hitachivantara/uikit-styles": "^5.41.3"
36
+ "@hitachivantara/uikit-react-utils": "^0.2.26",
37
+ "@hitachivantara/uikit-styles": "^5.42.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": "16c8c47610601f54711ae92dc4e0db946e3caac4",
46
+ "gitHead": "aa4abe1847a1621258a0ed5dd721c7fd39f6c276",
47
47
  "exports": {
48
48
  ".": {
49
49
  "types": "./dist/types/index.d.ts",