@fluentui/react-charting 5.23.53 → 5.23.54

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.
Files changed (41) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +11 -2
  3. package/dist/react-charting.d.ts +8 -3
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +4 -3
  7. package/lib/components/CommonComponents/CartesianChart.base.js +7 -2
  8. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.types.d.ts +8 -3
  10. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +7 -0
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  13. package/lib/components/HeatMapChart/HeatMapChart.base.js +5 -1
  14. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  15. package/lib/utilities/utilities.d.ts +4 -2
  16. package/lib/utilities/utilities.js +86 -36
  17. package/lib/utilities/utilities.js.map +1 -1
  18. package/lib-amd/components/CommonComponents/CartesianChart.base.js +7 -2
  19. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  20. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +8 -3
  21. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  22. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +7 -0
  23. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  24. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +5 -1
  25. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  26. package/lib-amd/utilities/utilities.d.ts +4 -2
  27. package/lib-amd/utilities/utilities.js +86 -36
  28. package/lib-amd/utilities/utilities.js.map +1 -1
  29. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +7 -2
  30. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  31. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +8 -3
  32. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  33. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +7 -0
  34. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  35. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +5 -1
  36. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  37. package/lib-commonjs/utilities/utilities.d.ts +4 -2
  38. package/lib-commonjs/utilities/utilities.js +86 -36
  39. package/lib-commonjs/utilities/utilities.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/CommonComponents/CartesianChart.types.ts +9 -3
@@ -1 +1 @@
1
- {"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/PlotlySchemaAdapter.ts"],"names":[],"mappings":";;;;AAKA,qCAAwH;AACxH,qCAAwD;AACxD,uCAAmF;AAoBnF,iDAAyF;AACzF,6CAA8F;AAG9F,uDAAiE;AAGjE,iDAA2C;AAO3C,IAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACtG,IAAM,WAAW,GAAG;IAClB,GAAG,EAAE;QACH,eAAe,EAAE,MAAM;QACvB,aAAa,EAAE,OAAO;QACtB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,MAAM;QACvB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,OAAO;QACxB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB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ACH,CAAC;QACH,CAAC;aAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { bin as d3Bin, extent as d3Extent, sum as d3Sum, min as d3Min, max as d3Max, merge as d3Merge } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format, precisionFixed as d3PrecisionFixed } from 'd3-format';\nimport { IDonutChartProps } from '../DonutChart/index';\nimport {\n IChartDataPoint,\n IChartProps,\n IHorizontalBarChartWithAxisDataPoint,\n ILineChartPoints,\n IVerticalStackedChartProps,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IGroupedVerticalBarChartData,\n IVerticalBarChartDataPoint,\n ISankeyChartData,\n} from '../../types/IDataPoint';\nimport { ISankeyChartProps } from '../SankeyChart/index';\nimport { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';\nimport { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';\nimport { ILineChartProps } from '../LineChart/index';\nimport { IAreaChartProps } from '../AreaChart/index';\nimport { IHeatMapChartProps } from '../HeatMapChart/index';\nimport { DataVizPalette, getColorFromToken, getNextColor } from '../../utilities/colors';\nimport { GaugeChartVariant, IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index';\nimport { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';\nimport { IVerticalBarChartProps } from '../VerticalBarChart/index';\nimport { findNumericMinMaxOfY } from '../../utilities/utilities';\nimport { Layout, PlotlySchema, PieData, PlotData, SankeyData } from './PlotlySchema';\nimport type { Datum, TypedArray } from './PlotlySchema';\nimport { timeParse } from 'd3-time-format';\n\ninterface ISecondaryYAxisValues {\n secondaryYAxistitle?: string;\n secondaryYScaleOptions?: { yMinValue?: number; yMaxValue?: number };\n}\n\nconst SUPPORTED_PLOT_TYPES = ['pie', 'bar', 'scatter', 'heatmap', 'sankey', 'indicator', 'histogram'];\nconst dashOptions = {\n dot: {\n strokeDasharray: '1, 5',\n strokeLinecap: 'round',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dash: {\n strokeDasharray: '5, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdash: {\n strokeDasharray: '10, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dashdot: {\n strokeDasharray: '5, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdashdot: {\n strokeDasharray: '10, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n solid: {\n strokeDasharray: '0',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n} as const;\nconst isDate = (value: any): boolean => {\n const parsedDate = new Date(Date.parse(value));\n if (isNaN(parsedDate.getTime())) {\n return false;\n }\n const parsedYear = parsedDate.getFullYear();\n const yearInString = /\\b\\d{4}\\b/.test(value);\n if (!yearInString && (parsedYear === 2000 || parsedYear === 2001)) {\n return false;\n }\n return true;\n};\n\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\n\nconst isMonth = (possiblyMonthValue: any): boolean => {\n const parseFullMonth = timeParse('%B');\n const parseShortMonth = timeParse('%b');\n return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;\n};\n\nconst isArrayOfType = (\n plotCoordinates: Datum[] | Datum[][] | TypedArray | undefined,\n typeCheck: (datum: any, ...args: any[]) => boolean,\n ...args: any[]\n): boolean => {\n if (!isArrayOrTypedArray(plotCoordinates)) {\n return false;\n }\n\n if (plotCoordinates!.length === 0) {\n return false;\n }\n\n if (Array.isArray(plotCoordinates![0])) {\n // Handle 2D array\n return (plotCoordinates as Datum[][]).every(innerArray => innerArray.every(datum => typeCheck(datum, ...args)));\n } else {\n // Handle 1D array\n return (plotCoordinates as Datum[]).every(datum => typeCheck(datum, ...args));\n }\n};\n\nexport const isDateArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isDate);\n};\n\nexport const isNumberArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isNumber);\n};\n\nexport const isMonthArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isMonth);\n};\n\nexport const isLineData = (data: Partial<PlotData>): boolean => {\n return (\n !SUPPORTED_PLOT_TYPES.includes(`${data.type}`) &&\n Array.isArray(data.x) &&\n isArrayOfType(data.y, (value: any) => typeof value === 'number') &&\n data.x.length > 0 &&\n data.x.length === data.y!.length\n );\n};\n\nconst invalidate2Dseries = (series: PlotData, chartType: string): void => {\n if (series.x?.length > 0 && Array.isArray(series.x[0])) {\n throw new Error(`transform to ${chartType}:: 2D x array not supported`);\n }\n if (series.y?.length > 0 && Array.isArray(series.y[0])) {\n throw new Error(`transform to ${chartType}:: 2D y array not supported`);\n }\n};\n\nconst getLegend = (series: PlotData, index: number): string => {\n return series.name || `Series ${index + 1}`;\n};\n\nfunction getTitles(layout: Partial<Layout> | undefined) {\n const titles = {\n chartTitle: typeof layout?.title === 'string' ? layout.title : layout?.title?.text ?? '',\n xAxisTitle: typeof layout?.xaxis?.title === 'string' ? layout?.xaxis?.title : layout?.xaxis?.title?.text ?? '',\n yAxisTitle: typeof layout?.yaxis?.title === 'string' ? layout?.yaxis?.title : layout?.yaxis?.title?.text ?? '',\n };\n return titles;\n}\n\nexport const updateXValues = (xValues: Datum[] | Datum[][] | TypedArray): any[] => {\n const presentYear = new Date().getFullYear();\n if (xValues.length > 0 && Array.isArray(xValues[0])) {\n throw new Error('updateXValues:: 2D array not supported');\n }\n const dates = (xValues as Datum[]).map(possiblyMonthValue => {\n const parsedDate = `${possiblyMonthValue} 01, ${presentYear}`;\n return isDate(parsedDate) ? new Date(parsedDate) : null;\n });\n for (let i = dates.length - 1; i > 0; i--) {\n const currentMonth = dates[i]!.getMonth();\n const previousMonth = dates[i - 1]!.getMonth();\n const currentYear = dates[i]!.getFullYear();\n const previousYear = dates[i - 1]!.getFullYear();\n if (previousMonth >= currentMonth) {\n dates[i - 1]!.setFullYear(dates[i]!.getFullYear() - 1);\n } else if (previousYear > currentYear) {\n dates[i - 1]!.setFullYear(currentYear);\n }\n }\n xValues = (xValues as Datum[]).map((month, index) => {\n return `${month} 01, ${dates[index]!.getFullYear()}`;\n });\n return xValues;\n};\n\nexport const getColor = (\n legendLabel: string,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): string => {\n if (!colorMap.current.has(legendLabel)) {\n const nextColor = getNextColor(colorMap.current.size + 1, 0, isDarkTheme);\n colorMap.current.set(legendLabel, nextColor);\n return nextColor;\n }\n\n return colorMap.current.get(legendLabel) as string;\n};\n\nconst getSecondaryYAxisValues = (series: PlotData, layout: Partial<Layout> | undefined) => {\n const secondaryYAxisValues: ISecondaryYAxisValues = {};\n if (layout && layout.yaxis2 && series.yaxis === 'y2') {\n secondaryYAxisValues.secondaryYAxistitle =\n typeof layout.yaxis2.title === 'string'\n ? layout.yaxis2.title\n : typeof layout.yaxis2.title?.text === 'string'\n ? layout.yaxis2.title.text\n : '';\n if (layout.yaxis2.range) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: layout.yaxis2.range[0],\n yMaxValue: layout.yaxis2.range[1],\n };\n } else {\n const yValues = series.y as number[];\n if (yValues) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: Math.min(...yValues),\n yMaxValue: Math.max(...yValues),\n };\n }\n }\n }\n secondaryYAxisValues.secondaryYAxistitle =\n secondaryYAxisValues.secondaryYAxistitle !== '' ? secondaryYAxisValues.secondaryYAxistitle : undefined;\n secondaryYAxisValues.secondaryYScaleOptions =\n secondaryYAxisValues.secondaryYScaleOptions && Object.keys(secondaryYAxisValues.secondaryYScaleOptions).length !== 0\n ? secondaryYAxisValues.secondaryYScaleOptions\n : undefined;\n return secondaryYAxisValues;\n};\n\nexport const transformPlotlyJsonToDonutProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IDonutChartProps => {\n const firstData = input.data[0] as PieData;\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap, isDarkTheme);\n return {\n legend: label,\n data: firstData.values?.[index] as number, //ToDo how to handle string data?\n color,\n };\n });\n\n const width: number = input.layout?.width ?? 440;\n const height: number = input.layout?.height ?? 220;\n const hideLabels: boolean = firstData.textinfo\n ? !['value', 'percent', 'label+percent'].includes(firstData.textinfo)\n : false;\n const donutMarginHorizontal: number = hideLabels ? 0 : 80;\n const donutMarginVertical: number = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n const { chartTitle } = getTitles(input.layout);\n\n return {\n data: {\n chartTitle,\n chartData: donutData,\n },\n hideLegend: input.layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n fallbackVSBC?: boolean,\n): IVerticalStackedBarChartProps => {\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n input.data.forEach((series: PlotData, index1: number) => {\n invalidate2Dseries(series, 'VSBC');\n\n if (!isNumberArray(series.y)) {\n throw new Error('transform to VSBC:: y values should be numeric');\n }\n\n (series.x as Datum[])?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = getLegend(series, index1);\n const yVal: number = (series.y?.[index2] as number) ?? 0;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: yVal,\n color,\n });\n } else if (series.type === 'scatter' || isLineData(series) || !!fallbackVSBC) {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].lineData!.push({\n legend,\n ...(series.line?.dash && dashOptions[series.line.dash]\n ? { lineOptions: { ...dashOptions[series.line.dash] } }\n : {}),\n y: yVal,\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, yVal);\n });\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: Object.values(mapXToDataPoints),\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n };\n};\n\nexport const transformPlotlyJsonToGVBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGroupedVerticalBarChartProps => {\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n input.data.forEach((series: PlotData, index1: number) => {\n invalidate2Dseries(series, 'GVBC');\n\n if (!isNumberArray(series.y)) {\n throw new Error('transform to GVBC:: y values should be numeric');\n }\n\n (series.x as Datum[])?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = getLegend(series, index1);\n const color = getColor(legend, colorMap, isDarkTheme);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: (series.y?.[index2] as number) ?? 0,\n xAxisCalloutData: x as string,\n color,\n legend,\n });\n }\n });\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: Object.values(mapXToDataPoints),\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalBarChartProps => {\n const vbcData: IVerticalBarChartDataPoint[] = [];\n\n input.data.forEach((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'VBC');\n\n if (!series.x) {\n return;\n }\n\n const scale = d3ScaleLinear()\n .domain(d3Extent<number>(series.x as number[]) as [number, number])\n .nice();\n let [xMin, xMax] = scale.domain();\n\n xMin = typeof series.xbins?.start === 'number' ? series.xbins.start : xMin;\n xMax = typeof series.xbins?.end === 'number' ? series.xbins.end : xMax;\n\n const bin = d3Bin().domain([xMin, xMax]);\n\n if (typeof series.xbins?.size === 'number') {\n const thresholds: number[] = [];\n let th = xMin;\n const precision = d3PrecisionFixed(series.xbins.size);\n const format = d3Format(`.${precision}f`);\n\n while (th < xMax + series.xbins.size) {\n thresholds.push(parseFloat(format(th)));\n th += series.xbins.size;\n }\n\n xMin = thresholds[0];\n xMax = thresholds[thresholds.length - 1];\n bin.domain([xMin, xMax]).thresholds(thresholds);\n }\n\n const buckets = bin(series.x as number[]);\n // If the start or end of xbins is specified, then the number of datapoints may become less than x.length\n const totalDataPoints = d3Merge(buckets).length;\n\n buckets.forEach(bucket => {\n const legend: string = getLegend(series, index);\n const color: string = getColor(legend, colorMap, isDarkTheme);\n let y = bucket.length;\n\n if (series.histnorm === 'percent') {\n y = (bucket.length / totalDataPoints) * 100;\n } else if (series.histnorm === 'probability') {\n y = bucket.length / totalDataPoints;\n } else if (series.histnorm === 'density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (bucket.x1! - bucket.x0!);\n } else if (series.histnorm === 'probability density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (totalDataPoints * (bucket.x1! - bucket.x0!));\n } else if (series.histfunc === 'sum') {\n y = d3Sum(bucket);\n } else if (series.histfunc === 'avg') {\n y = bucket.length === 0 ? 0 : d3Sum(bucket) / bucket.length;\n } else if (series.histfunc === 'min') {\n y = d3Min(bucket)!;\n } else if (series.histfunc === 'max') {\n y = d3Max(bucket)!;\n }\n\n vbcData.push({\n x: (bucket.x1! + bucket.x0!) / 2,\n y,\n legend,\n color,\n xAxisCalloutData: `[${bucket.x0} - ${bucket.x1})`,\n });\n });\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: vbcData,\n // width: layout?.width,\n // height: layout?.height,\n supportNegativeData: true,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n input: PlotlySchema,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ILineChartProps | IAreaChartProps => {\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n let mode: string = 'tonexty';\n const chartData: ILineChartPoints[] = input.data.map((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'Scatter');\n const xValues = series.x as Datum[];\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend: string = getLegend(series, index);\n const lineColor = getColor(legend, colorMap, isDarkTheme);\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';\n\n return {\n legend,\n ...(series.line?.dash && dashOptions[series.line.dash]\n ? { lineOptions: { ...dashOptions[series.line.dash] } }\n : {}),\n data: xValues.map((x, i: number) => ({\n x: isString ? (isXDate ? new Date(x as string) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n } as ILineChartPoints;\n });\n\n const yMinMaxValues = findNumericMinMaxOfY(chartData);\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n const chartProps: IChartProps = {\n chartTitle,\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n supportNegativeData: true,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n mode,\n } as IAreaChartProps;\n } else {\n return {\n data: chartProps,\n supportNegativeData: true,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n roundedTicks: true,\n yMinValue: yMinMaxValues.startValue,\n yMaxValue: yMinMaxValues.endValue,\n } as ILineChartProps;\n }\n};\n\nexport const transformPlotlyJsonToHorizontalBarWithAxisProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IHorizontalBarChartWithAxisProps => {\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = input.data\n .map((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'HBC');\n\n return (series.y as Datum[]).map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap, isDarkTheme);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n } as IHorizontalBarChartWithAxisDataPoint;\n });\n })\n .flat()\n //reversing the order to invert the Y bars order as required by plotly.\n .reverse();\n\n const chartHeight: number = input.layout?.height ?? 450;\n const margin: number = input.layout?.margin?.l ?? 0;\n const padding: number = input.layout?.margin?.pad ?? 0;\n const availableHeight: number = chartHeight - margin - padding;\n const numberOfBars = (input.data[0] as PlotData).y.length;\n const scalingFactor = 0.01;\n const gapFactor = 1 / (1 + scalingFactor * numberOfBars);\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: chartData,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle:\n typeof input.layout?.yaxis2?.title === 'string'\n ? input.layout?.yaxis2?.title\n : input.layout?.yaxis2?.title?.text || '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: input.layout?.width ?? 600,\n },\n },\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (input: PlotlySchema): IHeatMapChartProps => {\n const firstData = input.data[0] as PlotData;\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n (firstData.x as Datum[])?.forEach((xVal, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = (firstData.z as number[][])?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: input.layout?.xaxis?.type === 'date' ? (xVal as Date) : xVal ?? 0,\n y: input.layout?.yaxis?.type === 'date' ? (yVal as Date) : yVal,\n value: zVal,\n rectText: zVal,\n });\n\n if (typeof zVal === 'number') {\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n }\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: firstData.name,\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Initialize domain and range to default values\n const defaultDomain = [zMin, (zMax + zMin) / 2, zMax];\n const defaultRange = [\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color2),\n getColorFromToken(DataVizPalette.color3),\n ];\n const domainValuesForColorScale: number[] = Array.isArray(firstData.colorscale)\n ? (firstData.colorscale as Array<[number, string]>).map(arr => arr[0] * (zMax - zMin) + zMin)\n : defaultDomain;\n\n const rangeValuesForColorScale: string[] = Array.isArray(firstData.colorscale)\n ? (firstData.colorscale as Array<[number, string]>).map(arr => arr[1])\n : defaultRange;\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n showYAxisLables: true,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n sortOrder: 'none',\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ISankeyChartProps => {\n const { link, node } = input.data[0] as SankeyData;\n const validLinks = (link?.value ?? [])\n .map((val: number, index: number) => ({\n value: val,\n source: link?.source![index],\n target: link?.target![index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n // Filter out negative nodes, unequal nodes and self-references (circular links)\n .filter(x => x.source >= 0 && x.target >= 0 && x.source !== x.target);\n\n const sankeyChartData = {\n nodes: node.label?.map((label: string, index: number) => {\n const color = getColor(label, colorMap, isDarkTheme);\n\n return {\n nodeId: index,\n name: label,\n color,\n };\n }),\n links: validLinks.map((validLink: any, index: number) => {\n return {\n ...validLink,\n };\n }),\n } as ISankeyChartData;\n\n const width: number = input.layout?.width ?? 440;\n const height: number = input.layout?.height ?? 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n ...(input.layout?.font?.size ? { fontSize: input.layout.font?.size } : {}),\n },\n };\n const shouldResize: number = width + height;\n\n const { chartTitle } = getTitles(input.layout);\n\n return {\n data: {\n chartTitle,\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGaugeChartProps => {\n const firstData = input.data[0] as PlotData;\n\n const segments = firstData.gauge?.steps?.length\n ? firstData.gauge.steps.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n })\n : [\n {\n legend: 'Current',\n size: firstData.value ?? 0 - (firstData.gauge?.axis?.range?.[0] ?? 0),\n color: getColor('Current', colorMap, isDarkTheme),\n },\n {\n legend: 'Target',\n size: (firstData.gauge?.axis?.range?.[1] ?? 100) - (firstData.value ?? 0),\n color: DataVizPalette.disabled,\n },\n ];\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (firstData.delta?.reference) {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColorFromToken(DataVizPalette.success, isDarkTheme);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColorFromToken(DataVizPalette.error, isDarkTheme);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n const { chartTitle } = getTitles(input.layout);\n\n return {\n segments,\n chartValue: firstData.value ?? 0,\n chartTitle,\n sublabel,\n // range values can be null\n minValue: typeof firstData.gauge?.axis?.range?.[0] === 'number' ? firstData.gauge?.axis?.range?.[0] : undefined,\n maxValue: typeof firstData.gauge?.axis?.range?.[1] === 'number' ? firstData.gauge?.axis?.range?.[1] : undefined,\n chartValueFormat: () => firstData.value?.toString() ?? '',\n width: input.layout?.width ?? 440,\n height: input.layout?.height ?? 220,\n styles,\n variant: firstData.gauge?.steps?.length ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment,\n };\n};\n\nconst MAX_DEPTH = 15;\nexport const sanitizeJson = (jsonObject: any, depth: number = 0): any => {\n if (depth > MAX_DEPTH) {\n throw new Error('Maximum json depth exceeded');\n }\n\n if (typeof jsonObject === 'object' && jsonObject !== null) {\n for (const key in jsonObject) {\n if (jsonObject.hasOwnProperty(key)) {\n if (typeof jsonObject[key] === 'string') {\n jsonObject[key] = jsonObject[key].replace(/</g, '&lt;').replace(/>/g, '&gt;');\n } else {\n jsonObject[key] = sanitizeJson(jsonObject[key], depth + 1);\n }\n }\n }\n }\n\n return jsonObject;\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nexport function isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/PlotlySchemaAdapter.ts"],"names":[],"mappings":";;;;AAKA,qCAAwH;AACxH,qCAAwD;AACxD,uCAAmF;AAoBnF,iDAAyF;AACzF,6CAA8F;AAG9F,uDAAiE;AAGjE,iDAA2C;AAO3C,IAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACtG,IAAM,WAAW,GAAG;IAClB,GAAG,EAAE;QACH,eAAe,EAAE,MAAM;QACvB,aAAa,EAAE,OAAO;QACtB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,MAAM;QACvB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,OAAO;QACxB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,OAAO,EAAE;QACP,eAAe,EAAE,YAAY;QAC7B,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,WAAW,EAAE;QACX,eAAe,EAAE,aAAa;QAC9B,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;IACD,KAAK,EAAE;QACL,eAAe,EAAE,GAAG;QACpB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE,GAAG;KACrB;CACO,CAAC;AACX,IAAM,MAAM,GAAG,UAAC,KAAU;IACxB,IAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,IAAI,KAAK,C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,CAAC;AAHD,kDAGC;AAED,SAAS,cAAc,CAAC,SAAc,EAAE,CAAS,EAAE,WAAgB;IACjE,IAAI,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,cAAc,GAAG,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,eAAe,CAAC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACrC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC3B,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;oBAClE,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { bin as d3Bin, extent as d3Extent, sum as d3Sum, min as d3Min, max as d3Max, merge as d3Merge } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format, precisionFixed as d3PrecisionFixed } from 'd3-format';\nimport { IDonutChartProps } from '../DonutChart/index';\nimport {\n IChartDataPoint,\n IChartProps,\n IHorizontalBarChartWithAxisDataPoint,\n ILineChartPoints,\n IVerticalStackedChartProps,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n IGroupedVerticalBarChartData,\n IVerticalBarChartDataPoint,\n ISankeyChartData,\n} from '../../types/IDataPoint';\nimport { ISankeyChartProps } from '../SankeyChart/index';\nimport { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';\nimport { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';\nimport { ILineChartProps } from '../LineChart/index';\nimport { IAreaChartProps } from '../AreaChart/index';\nimport { IHeatMapChartProps } from '../HeatMapChart/index';\nimport { DataVizPalette, getColorFromToken, getNextColor } from '../../utilities/colors';\nimport { GaugeChartVariant, IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index';\nimport { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';\nimport { IVerticalBarChartProps } from '../VerticalBarChart/index';\nimport { findNumericMinMaxOfY } from '../../utilities/utilities';\nimport { Layout, PlotlySchema, PieData, PlotData, SankeyData } from './PlotlySchema';\nimport type { Datum, TypedArray } from './PlotlySchema';\nimport { timeParse } from 'd3-time-format';\n\ninterface ISecondaryYAxisValues {\n secondaryYAxistitle?: string;\n secondaryYScaleOptions?: { yMinValue?: number; yMaxValue?: number };\n}\n\nconst SUPPORTED_PLOT_TYPES = ['pie', 'bar', 'scatter', 'heatmap', 'sankey', 'indicator', 'histogram'];\nconst dashOptions = {\n dot: {\n strokeDasharray: '1, 5',\n strokeLinecap: 'round',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dash: {\n strokeDasharray: '5, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdash: {\n strokeDasharray: '10, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n dashdot: {\n strokeDasharray: '5, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n longdashdot: {\n strokeDasharray: '10, 5, 1, 5',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n solid: {\n strokeDasharray: '0',\n strokeLinecap: 'butt',\n strokeWidth: '2',\n lineBorderWidth: '4',\n },\n} as const;\nconst isDate = (value: any): boolean => {\n const parsedDate = new Date(Date.parse(value));\n if (isNaN(parsedDate.getTime())) {\n return false;\n }\n const parsedYear = parsedDate.getFullYear();\n const yearInString = /\\b\\d{4}\\b/.test(value);\n if (!yearInString && (parsedYear === 2000 || parsedYear === 2001)) {\n return false;\n }\n return true;\n};\n\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\n\nconst isMonth = (possiblyMonthValue: any): boolean => {\n const parseFullMonth = timeParse('%B');\n const parseShortMonth = timeParse('%b');\n return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;\n};\n\nconst isArrayOfType = (\n plotCoordinates: Datum[] | Datum[][] | TypedArray | undefined,\n typeCheck: (datum: any, ...args: any[]) => boolean,\n ...args: any[]\n): boolean => {\n if (!isArrayOrTypedArray(plotCoordinates)) {\n return false;\n }\n\n if (plotCoordinates!.length === 0) {\n return false;\n }\n\n if (Array.isArray(plotCoordinates![0])) {\n // Handle 2D array\n return (plotCoordinates as Datum[][]).every(innerArray => innerArray.every(datum => typeCheck(datum, ...args)));\n } else {\n // Handle 1D array\n return (plotCoordinates as Datum[]).every(datum => typeCheck(datum, ...args));\n }\n};\n\nexport const isDateArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isDate);\n};\n\nexport const isNumberArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isNumber);\n};\n\nexport const isMonthArray = (data: Datum[] | Datum[][] | TypedArray): boolean => {\n return isArrayOfType(data, isMonth);\n};\n\nexport const isLineData = (data: Partial<PlotData>): boolean => {\n return (\n !SUPPORTED_PLOT_TYPES.includes(`${data.type}`) &&\n Array.isArray(data.x) &&\n isArrayOfType(data.y, (value: any) => typeof value === 'number') &&\n data.x.length > 0 &&\n data.x.length === data.y!.length\n );\n};\n\nconst invalidate2Dseries = (series: PlotData, chartType: string): void => {\n if (series.x?.length > 0 && Array.isArray(series.x[0])) {\n throw new Error(`transform to ${chartType}:: 2D x array not supported`);\n }\n if (series.y?.length > 0 && Array.isArray(series.y[0])) {\n throw new Error(`transform to ${chartType}:: 2D y array not supported`);\n }\n};\n\nconst getLegend = (series: PlotData, index: number): string => {\n return series.name || `Series ${index + 1}`;\n};\n\nfunction getTitles(layout: Partial<Layout> | undefined) {\n const titles = {\n chartTitle: typeof layout?.title === 'string' ? layout.title : layout?.title?.text ?? '',\n xAxisTitle: typeof layout?.xaxis?.title === 'string' ? layout?.xaxis?.title : layout?.xaxis?.title?.text ?? '',\n yAxisTitle: typeof layout?.yaxis?.title === 'string' ? layout?.yaxis?.title : layout?.yaxis?.title?.text ?? '',\n };\n return titles;\n}\n\nexport const updateXValues = (xValues: Datum[] | Datum[][] | TypedArray): any[] => {\n const presentYear = new Date().getFullYear();\n if (xValues.length > 0 && Array.isArray(xValues[0])) {\n throw new Error('updateXValues:: 2D array not supported');\n }\n const dates = (xValues as Datum[]).map(possiblyMonthValue => {\n const parsedDate = `${possiblyMonthValue} 01, ${presentYear}`;\n return isDate(parsedDate) ? new Date(parsedDate) : null;\n });\n for (let i = dates.length - 1; i > 0; i--) {\n const currentMonth = dates[i]!.getMonth();\n const previousMonth = dates[i - 1]!.getMonth();\n const currentYear = dates[i]!.getFullYear();\n const previousYear = dates[i - 1]!.getFullYear();\n if (previousMonth >= currentMonth) {\n dates[i - 1]!.setFullYear(dates[i]!.getFullYear() - 1);\n } else if (previousYear > currentYear) {\n dates[i - 1]!.setFullYear(currentYear);\n }\n }\n xValues = (xValues as Datum[]).map((month, index) => {\n return `${month} 01, ${dates[index]!.getFullYear()}`;\n });\n return xValues;\n};\n\nexport const getColor = (\n legendLabel: string,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): string => {\n if (!colorMap.current.has(legendLabel)) {\n const nextColor = getNextColor(colorMap.current.size + 1, 0, isDarkTheme);\n colorMap.current.set(legendLabel, nextColor);\n return nextColor;\n }\n\n return colorMap.current.get(legendLabel) as string;\n};\n\nconst getSecondaryYAxisValues = (series: PlotData, layout: Partial<Layout> | undefined) => {\n const secondaryYAxisValues: ISecondaryYAxisValues = {};\n if (layout && layout.yaxis2 && series.yaxis === 'y2') {\n secondaryYAxisValues.secondaryYAxistitle =\n typeof layout.yaxis2.title === 'string'\n ? layout.yaxis2.title\n : typeof layout.yaxis2.title?.text === 'string'\n ? layout.yaxis2.title.text\n : '';\n if (layout.yaxis2.range) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: layout.yaxis2.range[0],\n yMaxValue: layout.yaxis2.range[1],\n };\n } else {\n const yValues = series.y as number[];\n if (yValues) {\n secondaryYAxisValues.secondaryYScaleOptions = {\n yMinValue: Math.min(...yValues),\n yMaxValue: Math.max(...yValues),\n };\n }\n }\n }\n secondaryYAxisValues.secondaryYAxistitle =\n secondaryYAxisValues.secondaryYAxistitle !== '' ? secondaryYAxisValues.secondaryYAxistitle : undefined;\n secondaryYAxisValues.secondaryYScaleOptions =\n secondaryYAxisValues.secondaryYScaleOptions && Object.keys(secondaryYAxisValues.secondaryYScaleOptions).length !== 0\n ? secondaryYAxisValues.secondaryYScaleOptions\n : undefined;\n return secondaryYAxisValues;\n};\n\nexport const transformPlotlyJsonToDonutProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IDonutChartProps => {\n const firstData = input.data[0] as PieData;\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap, isDarkTheme);\n return {\n legend: label,\n data: firstData.values?.[index] as number, //ToDo how to handle string data?\n color,\n };\n });\n\n const width: number = input.layout?.width ?? 440;\n const height: number = input.layout?.height ?? 220;\n const hideLabels: boolean = firstData.textinfo\n ? !['value', 'percent', 'label+percent'].includes(firstData.textinfo)\n : false;\n const donutMarginHorizontal: number = hideLabels ? 0 : 80;\n const donutMarginVertical: number = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n const { chartTitle } = getTitles(input.layout);\n\n return {\n data: {\n chartTitle,\n chartData: donutData,\n },\n hideLegend: input.layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n fallbackVSBC?: boolean,\n): IVerticalStackedBarChartProps => {\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n input.data.forEach((series: PlotData, index1: number) => {\n invalidate2Dseries(series, 'VSBC');\n\n if (!isNumberArray(series.y)) {\n throw new Error('transform to VSBC:: y values should be numeric');\n }\n\n (series.x as Datum[])?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = getLegend(series, index1);\n const yVal: number = (series.y?.[index2] as number) ?? 0;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: yVal,\n color,\n });\n } else if (series.type === 'scatter' || isLineData(series) || !!fallbackVSBC) {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].lineData!.push({\n legend,\n ...(series.line?.dash && dashOptions[series.line.dash]\n ? { lineOptions: { ...dashOptions[series.line.dash] } }\n : {}),\n y: yVal,\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, yVal);\n });\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: Object.values(mapXToDataPoints),\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToGVBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGroupedVerticalBarChartProps => {\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n input.data.forEach((series: PlotData, index1: number) => {\n invalidate2Dseries(series, 'GVBC');\n\n if (!isNumberArray(series.y)) {\n throw new Error('transform to GVBC:: y values should be numeric');\n }\n\n (series.x as Datum[])?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = getLegend(series, index1);\n const color = getColor(legend, colorMap, isDarkTheme);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: (series.y?.[index2] as number) ?? 0,\n xAxisCalloutData: x as string,\n color,\n legend,\n });\n }\n });\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: Object.values(mapXToDataPoints),\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalBarChartProps => {\n const vbcData: IVerticalBarChartDataPoint[] = [];\n\n input.data.forEach((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'VBC');\n\n if (!series.x) {\n return;\n }\n\n const scale = d3ScaleLinear()\n .domain(d3Extent<number>(series.x as number[]) as [number, number])\n .nice();\n let [xMin, xMax] = scale.domain();\n\n xMin = typeof series.xbins?.start === 'number' ? series.xbins.start : xMin;\n xMax = typeof series.xbins?.end === 'number' ? series.xbins.end : xMax;\n\n const bin = d3Bin().domain([xMin, xMax]);\n\n if (typeof series.xbins?.size === 'number') {\n const thresholds: number[] = [];\n let th = xMin;\n const precision = d3PrecisionFixed(series.xbins.size);\n const format = d3Format(`.${precision}f`);\n\n while (th < xMax + series.xbins.size) {\n thresholds.push(parseFloat(format(th)));\n th += series.xbins.size;\n }\n\n xMin = thresholds[0];\n xMax = thresholds[thresholds.length - 1];\n bin.domain([xMin, xMax]).thresholds(thresholds);\n }\n\n const buckets = bin(series.x as number[]);\n // If the start or end of xbins is specified, then the number of datapoints may become less than x.length\n const totalDataPoints = d3Merge(buckets).length;\n\n buckets.forEach(bucket => {\n const legend: string = getLegend(series, index);\n const color: string = getColor(legend, colorMap, isDarkTheme);\n let y = bucket.length;\n\n if (series.histnorm === 'percent') {\n y = (bucket.length / totalDataPoints) * 100;\n } else if (series.histnorm === 'probability') {\n y = bucket.length / totalDataPoints;\n } else if (series.histnorm === 'density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (bucket.x1! - bucket.x0!);\n } else if (series.histnorm === 'probability density') {\n y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (totalDataPoints * (bucket.x1! - bucket.x0!));\n } else if (series.histfunc === 'sum') {\n y = d3Sum(bucket);\n } else if (series.histfunc === 'avg') {\n y = bucket.length === 0 ? 0 : d3Sum(bucket) / bucket.length;\n } else if (series.histfunc === 'min') {\n y = d3Min(bucket)!;\n } else if (series.histfunc === 'max') {\n y = d3Max(bucket)!;\n }\n\n vbcData.push({\n x: (bucket.x1! + bucket.x0!) / 2,\n y,\n legend,\n color,\n xAxisCalloutData: `[${bucket.x0} - ${bucket.x1})`,\n });\n });\n });\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: vbcData,\n // width: layout?.width,\n // height: layout?.height,\n supportNegativeData: true,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n mode: 'plotly',\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n input: PlotlySchema,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ILineChartProps | IAreaChartProps => {\n let secondaryYAxisValues: ISecondaryYAxisValues = {};\n let mode: string = 'tonexty';\n const chartData: ILineChartPoints[] = input.data.map((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'Scatter');\n const xValues = series.x as Datum[];\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend: string = getLegend(series, index);\n const lineColor = getColor(legend, colorMap, isDarkTheme);\n secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);\n mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';\n\n return {\n legend,\n ...(series.line?.dash && dashOptions[series.line.dash]\n ? { lineOptions: { ...dashOptions[series.line.dash] } }\n : {}),\n data: xValues.map((x, i: number) => ({\n x: isString ? (isXDate ? new Date(x as string) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n } as ILineChartPoints;\n });\n\n const yMinMaxValues = findNumericMinMaxOfY(chartData);\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n const chartProps: IChartProps = {\n chartTitle,\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n supportNegativeData: true,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n mode,\n hideTickOverlap: true,\n } as IAreaChartProps;\n } else {\n return {\n data: chartProps,\n supportNegativeData: true,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,\n secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,\n roundedTicks: true,\n yMinValue: yMinMaxValues.startValue,\n yMaxValue: yMinMaxValues.endValue,\n hideTickOverlap: true,\n } as ILineChartProps;\n }\n};\n\nexport const transformPlotlyJsonToHorizontalBarWithAxisProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IHorizontalBarChartWithAxisProps => {\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = input.data\n .map((series: PlotData, index: number) => {\n invalidate2Dseries(series, 'HBC');\n\n return (series.y as Datum[]).map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap, isDarkTheme);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n } as IHorizontalBarChartWithAxisDataPoint;\n });\n })\n .flat()\n //reversing the order to invert the Y bars order as required by plotly.\n .reverse();\n\n const chartHeight: number = input.layout?.height ?? 450;\n const margin: number = input.layout?.margin?.l ?? 0;\n const padding: number = input.layout?.margin?.pad ?? 0;\n const availableHeight: number = chartHeight - margin - padding;\n const numberOfBars = (input.data[0] as PlotData).y.length;\n const scalingFactor = 0.01;\n const gapFactor = 1 / (1 + scalingFactor * numberOfBars);\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: chartData,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n secondaryYAxistitle:\n typeof input.layout?.yaxis2?.title === 'string'\n ? input.layout?.yaxis2?.title\n : input.layout?.yaxis2?.title?.text || '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: input.layout?.width ?? 600,\n },\n },\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (input: PlotlySchema): IHeatMapChartProps => {\n const firstData = input.data[0] as PlotData;\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n (firstData.x as Datum[])?.forEach((xVal, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = (firstData.z as number[][])?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: input.layout?.xaxis?.type === 'date' ? (xVal as Date) : xVal ?? 0,\n y: input.layout?.yaxis?.type === 'date' ? (yVal as Date) : yVal,\n value: zVal,\n rectText: zVal,\n });\n\n if (typeof zVal === 'number') {\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n }\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: firstData.name,\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Initialize domain and range to default values\n const defaultDomain = [zMin, (zMax + zMin) / 2, zMax];\n const defaultRange = [\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color2),\n getColorFromToken(DataVizPalette.color3),\n ];\n const domainValuesForColorScale: number[] = Array.isArray(firstData.colorscale)\n ? (firstData.colorscale as Array<[number, string]>).map(arr => arr[0] * (zMax - zMin) + zMin)\n : defaultDomain;\n\n const rangeValuesForColorScale: string[] = Array.isArray(firstData.colorscale)\n ? (firstData.colorscale as Array<[number, string]>).map(arr => arr[1])\n : defaultRange;\n\n const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n showYAxisLables: true,\n chartTitle,\n xAxisTitle,\n yAxisTitle,\n sortOrder: 'none',\n hideTickOverlap: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ISankeyChartProps => {\n const { link, node } = input.data[0] as SankeyData;\n const validLinks = (link?.value ?? [])\n .map((val: number, index: number) => ({\n value: val,\n source: link?.source![index],\n target: link?.target![index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n // Filter out negative nodes, unequal nodes and self-references (circular links)\n .filter(x => x.source >= 0 && x.target >= 0 && x.source !== x.target);\n\n const sankeyChartData = {\n nodes: node.label?.map((label: string, index: number) => {\n const color = getColor(label, colorMap, isDarkTheme);\n\n return {\n nodeId: index,\n name: label,\n color,\n };\n }),\n links: validLinks.map((validLink: any, index: number) => {\n return {\n ...validLink,\n };\n }),\n } as ISankeyChartData;\n\n const width: number = input.layout?.width ?? 440;\n const height: number = input.layout?.height ?? 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n ...(input.layout?.font?.size ? { fontSize: input.layout.font?.size } : {}),\n },\n };\n const shouldResize: number = width + height;\n\n const { chartTitle } = getTitles(input.layout);\n\n return {\n data: {\n chartTitle,\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n input: PlotlySchema,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGaugeChartProps => {\n const firstData = input.data[0] as PlotData;\n\n const segments = firstData.gauge?.steps?.length\n ? firstData.gauge.steps.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n })\n : [\n {\n legend: 'Current',\n size: firstData.value ?? 0 - (firstData.gauge?.axis?.range?.[0] ?? 0),\n color: getColor('Current', colorMap, isDarkTheme),\n },\n {\n legend: 'Target',\n size: (firstData.gauge?.axis?.range?.[1] ?? 100) - (firstData.value ?? 0),\n color: DataVizPalette.disabled,\n },\n ];\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (firstData.delta?.reference) {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColorFromToken(DataVizPalette.success, isDarkTheme);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColorFromToken(DataVizPalette.error, isDarkTheme);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n const { chartTitle } = getTitles(input.layout);\n\n return {\n segments,\n chartValue: firstData.value ?? 0,\n chartTitle,\n sublabel,\n // range values can be null\n minValue: typeof firstData.gauge?.axis?.range?.[0] === 'number' ? firstData.gauge?.axis?.range?.[0] : undefined,\n maxValue: typeof firstData.gauge?.axis?.range?.[1] === 'number' ? firstData.gauge?.axis?.range?.[1] : undefined,\n chartValueFormat: () => firstData.value?.toString() ?? '',\n width: input.layout?.width ?? 440,\n height: input.layout?.height ?? 220,\n styles,\n variant: firstData.gauge?.steps?.length ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment,\n };\n};\n\nconst MAX_DEPTH = 15;\nexport const sanitizeJson = (jsonObject: any, depth: number = 0): any => {\n if (depth > MAX_DEPTH) {\n throw new Error('Maximum json depth exceeded');\n }\n\n if (typeof jsonObject === 'object' && jsonObject !== null) {\n for (const key in jsonObject) {\n if (jsonObject.hasOwnProperty(key)) {\n if (typeof jsonObject[key] === 'string') {\n jsonObject[key] = jsonObject[key].replace(/</g, '&lt;').replace(/>/g, '&gt;');\n } else {\n jsonObject[key] = sanitizeJson(jsonObject[key], depth + 1);\n }\n }\n }\n }\n\n return jsonObject;\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nexport function isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"]}
@@ -519,9 +519,13 @@ var HeatMapChartBase = /** @class */ (function (_super) {
519
519
  var chartHoverProps = tslib_1.__assign(tslib_1.__assign({}, (this.state.ratio && {
520
520
  ratio: this.state.ratio,
521
521
  })), { descriptionMessage: this.state.descriptionMessage });
522
+ var tickParams = {
523
+ tickValues: this.props.tickValues,
524
+ tickFormat: this.props.tickFormat,
525
+ };
522
526
  return !this._isChartEmpty() ? (React.createElement(index_1.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: data, chartType: utilities_1.ChartTypes.HeatMapChart, xAxisType: utilities_1.XAxisTypes.StringAxis, yAxisType: utilities_1.YAxisType.StringAxis, calloutProps: calloutProps, createYAxis: utilities_1.createNumericYAxis, chartHoverProps: chartHoverProps, styles: this._classNames.subComponentStyles.cartesianStyles, datasetForXAxisDomain: this._stringXAxisDataPoints, stringDatasetForYAxisDomain: this._stringYAxisDataPoints, createStringYAxis: utilities_1.createStringYAxis, getDomainNRangeValues: this._getDomainNRangeValues, getMinMaxOfYAxis: this._getMinMaxOfYAxis, getmargins: this._getMargins, xAxisTickCount: this._stringXAxisDataPoints.length, xAxistickSize: 0, xAxisPadding: 0.02, yAxisPadding: 0.02, svgFocusZoneProps: {
523
527
  direction: react_focus_1.FocusZoneDirection.bidirectional,
524
- }, legendBars: this._createLegendBars(), onChartMouseLeave: this._handleChartMouseLeave, ref: this._cartesianChartRef,
528
+ }, legendBars: this._createLegendBars(), onChartMouseLeave: this._handleChartMouseLeave, ref: this._cartesianChartRef, tickParams: tickParams,
525
529
  /* eslint-disable react/jsx-no-bind */
526
530
  // eslint-disable-next-line react/no-children-prop
527
531
  children: function (props) {
@@ -1 +1 @@
1
- {"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;AAAA,iEAAoH;AAEpH,qCAAwD;AACxD,2DAAmH;AACnH,qDAA2D;AAC3D,uDAA8D;AAE9D,6BAA+B;AAE/B,0CAAoD;AACpD,2DAAoE;AACpE,uDAYmC;AAEnC,uCAA+C;AAC/C,iDAA4D;AAC5D,iDAA0D;AA+D1D,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;AACzF;IAAsC,4CAAuD;IA8B3F,0BAAmB,KAAyB;;QAC1C,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAbf;;;WAGG;QACK,mBAAa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GAAtB,UAAuB,WAAmB;QACxC,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,yCAAc,GAAtB;QACE,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IACD;;;;;OAKG;IACK,yCAAc,GAAtB,UAAuB,WAAmB;QACxC;;;;WAIG;QACH,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,WAAW;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAmTO,wCAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IAOH,uBAAC;AAAD,CAAC,AA7tBD,CAAsC,KAAK,CAAC,SAAS,GA6tBpD;AA7tBY,4CAAgB","sourcesContent":["import { CartesianChart, IChildProps, IModifiedCartesianChartProps } from '../../components/CommonComponents/index';\nimport { IAccessibilityProps, IChart, IHeatMapChartData, IHeatMapChartDataPoint } from '../../types/IDataPoint';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { classNamesFunction, getId, initializeComponentRef, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, Legends } from '../Legends/index';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport {\n ChartTypes,\n createNumericYAxis,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n resolveCSSVariables,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { getColorContrast } from '../../utilities/colors';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> implements IChart {\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n private margins: IMargins;\n private _cartesianChartRef: React.RefObject<IChart>;\n\n public constructor(props: IHeatMapChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: props.legendProps?.selectedLegend ?? '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n this._cartesianChartRef = React.createRef();\n }\n\n public componentDidUpdate(prevProps: IHeatMapChartProps): void {\n if (prevProps.legendProps?.selectedLegend !== this.props.legendProps?.selectedLegend) {\n this.setState({\n selectedLegend: this.props.legendProps?.selectedLegend ?? '',\n });\n }\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n chartTitle={this._getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={this._getDomainNRangeValues}\n getMinMaxOfYAxis={this._getMinMaxOfYAxis}\n getmargins={this._getMargins}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n ref={this._cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScale;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._cartesianChartRef.current?.chartContainer || null;\n }\n\n private _getMinMaxOfYAxis = () => {\n return { startValue: 0, endValue: 0 };\n };\n\n private _getDomainNRangeValues = (\n points: IHeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) => {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(this.margins, width, isRTL);\n }\n return domainNRangeValue;\n };\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _getInvertedTextColor = (color: string): string => {\n return color === this.props.theme!.semanticColors.bodyText\n ? this.props.theme!.semanticColors.bodyBackground\n : this.props.theme!.semanticColors.bodyText;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n this._stringXAxisDataPoints.forEach((xAxisDataPoint: string) => {\n let rectElement: JSX.Element;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n this._dataSet[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof this._dataSet[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = this._dataSet[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = this.props.theme!.semanticColors.bodyText;\n if (this.chartContainer) {\n styleRules = resolveCSSVariables(this.chartContainer!, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, this._colorScale(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = this._getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._legendHighlighted(dataPointObject.legend) || this._noLegendHighlighted()}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n fill={foregroundColor}\n >\n {convertToLocaleString(dataPointObject.rectText, this.props.culture)}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._noLegendHighlighted()}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this.props.theme!.semanticColors.bodyBackground}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick(legendTitle: string): void {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item]\n .sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return this.props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n })\n .forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n\n private _getChartTitle = (): string => {\n const { chartTitle } = this.props;\n const numDataPoints = this.props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n}\n"]}
1
+ {"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;AAAA,iEAAoH;AAEpH,qCAAwD;AACxD,2DAAmH;AACnH,qDAA2D;AAC3D,uDAA8D;AAE9D,6BAA+B;AAE/B,0CAAoD;AACpD,2DAAoE;AACpE,uDAYmC;AAEnC,uCAA+C;AAC/C,iDAA4D;AAC5D,iDAA0D;AA+D1D,IAAM,aAAa,GAAG,IAAA,8BAA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C,aAAa,EACtB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBACX,8BAA8B,GAC1C,CACH,CAAC;IACJ,CAAC;IAED,sBAAW,4CAAc;aAAzB;;YACE,OAAO,CAAA,MAAA,IAAI,CAAC,kBAAkB,CAAC,OAAO,0CAAE,cAAc,KAAI,IAAI,CAAC;QACjE,CAAC;;;OAAA;IAoND;;;;;OAKG;IACK,yCAAc,GAAtB,UAAuB,WAAmB;QACxC,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,yCAAc,GAAtB;QACE,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IACD;;;;;OAKG;IACK,yCAAc,GAAtB,UAAuB,WAAmB;QACxC;;;;WAIG;QACH,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,WAAW;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAmTO,wCAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IAOH,uBAAC;AAAD,CAAC,AAluBD,CAAsC,KAAK,CAAC,SAAS,GAkuBpD;AAluBY,4CAAgB","sourcesContent":["import { CartesianChart, IChildProps, IModifiedCartesianChartProps } from '../../components/CommonComponents/index';\nimport { IAccessibilityProps, IChart, IHeatMapChartData, IHeatMapChartDataPoint } from '../../types/IDataPoint';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { classNamesFunction, getId, initializeComponentRef, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, Legends } from '../Legends/index';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport {\n ChartTypes,\n createNumericYAxis,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n resolveCSSVariables,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { getColorContrast } from '../../utilities/colors';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> implements IChart {\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n private margins: IMargins;\n private _cartesianChartRef: React.RefObject<IChart>;\n\n public constructor(props: IHeatMapChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: props.legendProps?.selectedLegend ?? '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n this._cartesianChartRef = React.createRef();\n }\n\n public componentDidUpdate(prevProps: IHeatMapChartProps): void {\n if (prevProps.legendProps?.selectedLegend !== this.props.legendProps?.selectedLegend) {\n this.setState({\n selectedLegend: this.props.legendProps?.selectedLegend ?? '',\n });\n }\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n const tickParams = {\n tickValues: this.props.tickValues,\n tickFormat: this.props.tickFormat,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n chartTitle={this._getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={this._getDomainNRangeValues}\n getMinMaxOfYAxis={this._getMinMaxOfYAxis}\n getmargins={this._getMargins}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n ref={this._cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScale;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._cartesianChartRef.current?.chartContainer || null;\n }\n\n private _getMinMaxOfYAxis = () => {\n return { startValue: 0, endValue: 0 };\n };\n\n private _getDomainNRangeValues = (\n points: IHeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) => {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(this.margins, width, isRTL);\n }\n return domainNRangeValue;\n };\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: Number.isNaN(data.value)\n ? this.props.theme!.semanticColors.bodyText\n : this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _getInvertedTextColor = (color: string): string => {\n return color === this.props.theme!.semanticColors.bodyText\n ? this.props.theme!.semanticColors.bodyBackground\n : this.props.theme!.semanticColors.bodyText;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n this._stringXAxisDataPoints.forEach((xAxisDataPoint: string) => {\n let rectElement: JSX.Element;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n this._dataSet[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof this._dataSet[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = this._dataSet[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = this.props.theme!.semanticColors.bodyText;\n if (this.chartContainer) {\n styleRules = resolveCSSVariables(this.chartContainer!, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, this._colorScale(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = this._getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._legendHighlighted(dataPointObject.legend) || this._noLegendHighlighted()}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n fill={foregroundColor}\n >\n {convertToLocaleString(dataPointObject.rectText, this.props.culture)}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={this._noLegendHighlighted()}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this.props.theme!.semanticColors.bodyBackground}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick(legendTitle: string): void {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item]\n .sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return this.props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n })\n .forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return this.props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n\n private _getChartTitle = (): string => {\n const { chartTitle } = this.props;\n const numDataPoints = this.props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n}\n"]}
@@ -77,9 +77,11 @@ export interface IXAxisParams {
77
77
  xAxisOuterPadding?: number;
78
78
  margins: IMargins;
79
79
  containerHeight: number;
80
+ containerWidth: number;
81
+ hideTickOverlap?: boolean;
80
82
  }
81
83
  export interface ITickParams {
82
- tickValues?: Date[] | number[];
84
+ tickValues?: Date[] | number[] | string[];
83
85
  tickFormat?: string;
84
86
  }
85
87
  export interface IYAxisParams {
@@ -106,7 +108,7 @@ export interface IYAxisParams {
106
108
  * @export
107
109
  * @param {IXAxisParams} xAxisParams
108
110
  */
109
- export declare function createNumericXAxis(xAxisParams: IXAxisParams, chartType: ChartTypes, culture?: string): {
111
+ export declare function createNumericXAxis(xAxisParams: IXAxisParams, tickParams: ITickParams, chartType: ChartTypes, culture?: string): {
110
112
  xScale: import("d3-scale").ScaleLinear<number, number, never>;
111
113
  tickValues: string[];
112
114
  };