@fluentui/react-charting 5.23.29 → 5.23.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.d.ts +1 -0
- package/lib/components/DonutChart/Arc/Arc.js +13 -8
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.d.ts +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.d.ts +4 -2
- package/lib/components/DonutChart/DonutChart.base.js +46 -25
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.d.ts +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +8 -3
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.d.ts +1 -0
- package/lib-amd/components/DonutChart/Arc/Arc.js +13 -8
- package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.types.d.ts +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.d.ts +4 -2
- package/lib-amd/components/DonutChart/DonutChart.base.js +46 -25
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/Pie/Pie.types.d.ts +1 -1
- package/lib-amd/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +8 -3
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.d.ts +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +13 -8
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.d.ts +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +4 -2
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +46 -25
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.d.ts +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +8 -3
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DonutChart/Arc/Arc.types.ts +1 -1
- package/src/components/DonutChart/Pie/Pie.types.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeCh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QACtC,cAAc,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IAHD,kDAGC;IAED,SAAS,cAAc,CAAC,SAAc,EAAE,CAAS,EAAE,WAAgB;QACjE,IAAI,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,cAAc,GAAG,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,eAAe,CAAC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBACrC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC3B,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;wBAClE,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,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} from '../../types/IDataPoint';\nimport { ISankeyChartProps } from '../SankeyChart/index';\nimport { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';\nimport { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';\nimport { ILineChartProps } from '../LineChart/index';\nimport { IAreaChartProps } from '../AreaChart/index';\nimport { IHeatMapChartProps } from '../HeatMapChart/index';\nimport { getNextColor } from '../../utilities/colors';\nimport { IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index';\nimport { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';\nimport { IVerticalBarChartProps } from '../VerticalBarChart/index';\n\nconst isDate = (value: any): boolean => !isNaN(Date.parse(value));\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\nexport const isDateArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isDate);\nexport const isNumberArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isNumber);\n\nexport const getColor = (\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\nexport const transformPlotlyJsonToDonutProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IDonutChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap, isDarkTheme);\n return {\n legend: label,\n data: firstData.values?.[index],\n color,\n };\n });\n\n const width: number = typeof layout?.width === 'number' ? layout?.width : 440;\n const height: number = typeof layout?.height === 'number' ? layout?.height : 220;\n const hideLabels: boolean = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : 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\n const styles: IDonutChartProps['styles'] = {\n root: {\n '[class^=\"arcLabel\"]': {\n ...(typeof firstData.textfont?.size === 'number' ? { fontSize: firstData.textfont.size } : {}),\n },\n },\n };\n\n return {\n data: {\n chartTitle: layout?.title,\n chartData: donutData,\n },\n hideLegend: layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,\n styles,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalStackedBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = series.name || `Series ${index1 + 1}`;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: series.y?.[index2],\n color,\n });\n } else if (series.type === 'line') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].lineData!.push({\n legend,\n y: series.y?.[index2],\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, series.y?.[index2]);\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n };\n};\n\nexport const transformPlotlyJsonToGVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGroupedVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = series.name || `Series ${index1 + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: series.y?.[index2],\n color,\n legend,\n });\n }\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const vbcData: IVerticalBarChartDataPoint[] = [];\n\n data.forEach((series: any, index: number) => {\n if (!series.x) {\n return;\n }\n\n const scale = d3ScaleLinear()\n .domain(d3Extent<number>(series.x) 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);\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 = series.name || `Series ${index + 1}`;\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 return {\n data: vbcData,\n chartTitle: typeof layout?.title === 'string' ? layout?.title : '',\n // width: layout?.width,\n // height: layout?.height,\n hideLegend: true,\n barWidth: 24,\n supportNegativeData: true,\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n jsonObj: any,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ILineChartProps | IAreaChartProps => {\n const { data, layout } = jsonObj;\n\n const chartData: ILineChartPoints[] = data.map((series: any, index: number) => {\n const xValues = series.x;\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend: string = series.name || `Series ${index + 1}`;\n const lineColor = getColor(legend, colorMap, isDarkTheme);\n\n return {\n legend,\n data: xValues.map((x: string | number, i: number) => ({\n x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n };\n });\n\n const chartProps: IChartProps = {\n chartTitle: typeof layout.title === 'string' ? layout.title : '',\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n supportNegativeData: true,\n } as IAreaChartProps;\n } else {\n return {\n data: chartProps,\n supportNegativeData: true,\n } as ILineChartProps;\n }\n};\n\nexport const transformPlotlyJsonToHorizontalBarWithAxisProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IHorizontalBarChartWithAxisProps => {\n const { data, layout } = jsonObj;\n\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = data\n .map((series: any, index: number) => {\n return series.y.map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap, isDarkTheme);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n };\n });\n })\n .flat();\n\n const chartHeight: number = typeof layout.height === 'number' ? layout.height : 450;\n const margin: number = typeof layout.margin?.l === 'number' ? layout.margin?.l : 0;\n const padding: number = typeof layout.margin?.pad === 'number' ? layout.margin?.pad : 0;\n const availableHeight: number = chartHeight - margin - padding;\n const numberOfBars = data[0].y.length;\n const scalingFactor = 0.01;\n const gapFactor = 1 / (1 + scalingFactor * numberOfBars);\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n return {\n data: chartData,\n chartTitle: typeof layout.title === 'string' ? layout.title : '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: typeof layout.width === 'number' ? layout.width : 600,\n },\n },\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n firstData.x?.forEach((xVal: any, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = firstData.z?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: layout.xaxis?.type === 'date' ? new Date(xVal) : xVal,\n y: layout.yaxis?.type === 'date' ? new Date(yVal) : yVal,\n value: zVal,\n });\n\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: typeof firstData.name === 'string' ? firstData.name : '',\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Convert normalized values to actual values\n const domainValuesForColorScale: number[] = firstData.colorscale\n ? firstData.colorscale.map((arr: any) => arr[0] * (zMax - zMin) + zMin)\n : [];\n const rangeValuesForColorScale: string[] = firstData.colorscale ? firstData.colorscale.map((arr: any) => arr[1]) : [];\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ISankeyChartProps => {\n const { data, layout } = jsonObj;\n const { link, node } = data[0];\n const validLinks = link.value\n .map((val: number, index: number) => ({\n value: val,\n source: link.source[index],\n target: link.target[index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n //@ts-expect-error Dynamic link object. Ignore for now.\n // Filter 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 };\n\n const width: number = typeof layout?.width === 'number' ? layout?.width : 440;\n const height: number = typeof layout?.height === 'number' ? layout?.height : 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n ...(typeof layout.font?.size === 'number' ? { fontSize: layout.font?.size } : {}),\n },\n };\n const shouldResize: number = width + height;\n return {\n data: {\n chartTitle: typeof layout?.title === 'string' ? layout?.title : '',\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGaugeChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const segments = firstData.gauge?.steps?.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n });\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (typeof firstData.delta?.reference === 'number') {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColor(firstData.delta.increasing?.color || '', colorMap, isDarkTheme);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColor(firstData.delta.decreasing?.color || '', colorMap, isDarkTheme);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n return {\n segments,\n chartValue: typeof firstData.value === 'number' ? firstData.value : 0,\n chartTitle: typeof firstData.title?.text === 'string' ? firstData.title?.text : '',\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,\n width: typeof layout?.width === 'number' ? layout?.width : 0,\n height: typeof layout?.height === 'number' ? layout?.height : 0,\n hideLegend: true,\n styles,\n };\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nfunction isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n}\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":";;;;IA+BA,IA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;IACvC,CAAC;IAHD,kDAGC;IAED,SAAS,cAAc,CAAC,SAAc,EAAE,CAAS,EAAE,WAAgB;QACjE,IAAI,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,cAAc,GAAG,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,eAAe,CAAC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBACrC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;4BAC3B,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;wBAClE,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;IACH,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} from '../../types/IDataPoint';\nimport { ISankeyChartProps } from '../SankeyChart/index';\nimport { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index';\nimport { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index';\nimport { ILineChartProps } from '../LineChart/index';\nimport { IAreaChartProps } from '../AreaChart/index';\nimport { IHeatMapChartProps } from '../HeatMapChart/index';\nimport { getNextColor } from '../../utilities/colors';\nimport { IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index';\nimport { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index';\nimport { IVerticalBarChartProps } from '../VerticalBarChart/index';\n\nconst isDate = (value: any): boolean => !isNaN(Date.parse(value));\nconst isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value);\nexport const isDateArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isDate);\nexport const isNumberArray = (array: any[]): boolean => isArrayOrTypedArray(array) && array.every(isNumber);\n\nexport const getColor = (\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\nexport const transformPlotlyJsonToDonutProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IDonutChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap, isDarkTheme);\n return {\n legend: label,\n data: firstData.values?.[index],\n color,\n };\n });\n\n const width: number = typeof layout?.width === 'number' ? layout?.width : 440;\n const height: number = typeof layout?.height === 'number' ? layout?.height : 220;\n const hideLabels: boolean = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : 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\n const styles: IDonutChartProps['styles'] = {\n root: {\n '[class^=\"arcLabel\"]': {\n ...(typeof firstData.textfont?.size === 'number' ? { fontSize: firstData.textfont.size } : {}),\n },\n },\n };\n\n return {\n data: {\n chartTitle: layout?.title,\n chartData: donutData,\n },\n hideLegend: layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,\n styles,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalStackedBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = series.name || `Series ${index1 + 1}`;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: series.y?.[index2],\n color,\n });\n } else if (series.type === 'line') {\n const color = getColor(legend, colorMap, isDarkTheme);\n mapXToDataPoints[x].lineData!.push({\n legend,\n y: series.y?.[index2],\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, series.y?.[index2]);\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n };\n};\n\nexport const transformPlotlyJsonToGVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGroupedVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = series.name || `Series ${index1 + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: series.y?.[index2],\n color,\n legend,\n });\n }\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const vbcData: IVerticalBarChartDataPoint[] = [];\n\n data.forEach((series: any, index: number) => {\n if (!series.x) {\n return;\n }\n\n const scale = d3ScaleLinear()\n .domain(d3Extent<number>(series.x) 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);\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 = series.name || `Series ${index + 1}`;\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 return {\n data: vbcData,\n chartTitle: typeof layout?.title === 'string' ? layout?.title : '',\n // width: layout?.width,\n // height: layout?.height,\n // hideLegend: true,\n barWidth: 24,\n supportNegativeData: true,\n };\n};\n\nexport const transformPlotlyJsonToScatterChartProps = (\n jsonObj: any,\n isAreaChart: boolean,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ILineChartProps | IAreaChartProps => {\n const { data, layout } = jsonObj;\n\n const chartData: ILineChartPoints[] = data.map((series: any, index: number) => {\n const xValues = series.x;\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend: string = series.name || `Series ${index + 1}`;\n const lineColor = getColor(legend, colorMap, isDarkTheme);\n\n return {\n legend,\n data: xValues.map((x: string | number, i: number) => ({\n x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n };\n });\n\n const chartProps: IChartProps = {\n chartTitle: typeof layout.title === 'string' ? layout.title : '',\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n supportNegativeData: true,\n } as IAreaChartProps;\n } else {\n return {\n data: chartProps,\n supportNegativeData: true,\n } as ILineChartProps;\n }\n};\n\nexport const transformPlotlyJsonToHorizontalBarWithAxisProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IHorizontalBarChartWithAxisProps => {\n const { data, layout } = jsonObj;\n\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = data\n .map((series: any, index: number) => {\n return series.y.map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap, isDarkTheme);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n };\n });\n })\n .flat();\n\n const chartHeight: number = typeof layout.height === 'number' ? layout.height : 450;\n const margin: number = typeof layout.margin?.l === 'number' ? layout.margin?.l : 0;\n const padding: number = typeof layout.margin?.pad === 'number' ? layout.margin?.pad : 0;\n const availableHeight: number = chartHeight - margin - padding;\n const numberOfBars = data[0].y.length;\n const scalingFactor = 0.01;\n const gapFactor = 1 / (1 + scalingFactor * numberOfBars);\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n return {\n data: chartData,\n chartTitle: typeof layout.title === 'string' ? layout.title : '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: typeof layout.width === 'number' ? layout.width : 600,\n },\n },\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n firstData.x?.forEach((xVal: any, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = firstData.z?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: layout.xaxis?.type === 'date' ? new Date(xVal) : xVal,\n y: layout.yaxis?.type === 'date' ? new Date(yVal) : yVal,\n value: zVal,\n });\n\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: typeof firstData.name === 'string' ? firstData.name : '',\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Convert normalized values to actual values\n const domainValuesForColorScale: number[] = firstData.colorscale\n ? firstData.colorscale.map((arr: any) => arr[0] * (zMax - zMin) + zMin)\n : [];\n const rangeValuesForColorScale: string[] = firstData.colorscale ? firstData.colorscale.map((arr: any) => arr[1]) : [];\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): ISankeyChartProps => {\n const { data, layout } = jsonObj;\n const { link, node } = data[0];\n const validLinks = link.value\n .map((val: number, index: number) => ({\n value: val,\n source: link.source[index],\n target: link.target[index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n //@ts-expect-error Dynamic link object. Ignore for now.\n // Filter 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 };\n\n const width: number = typeof layout?.width === 'number' ? layout?.width : 440;\n const height: number = typeof layout?.height === 'number' ? layout?.height : 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n ...(typeof layout.font?.size === 'number' ? { fontSize: layout.font?.size } : {}),\n },\n };\n const shouldResize: number = width + height;\n return {\n data: {\n chartTitle: typeof layout?.title === 'string' ? layout?.title : '',\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n isDarkTheme?: boolean,\n): IGaugeChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const segments = firstData.gauge?.steps?.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap, isDarkTheme);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n });\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (typeof firstData.delta?.reference === 'number') {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColor(firstData.delta.increasing?.color || '', colorMap, isDarkTheme);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColor(firstData.delta.decreasing?.color || '', colorMap, isDarkTheme);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n return {\n segments,\n chartValue: typeof firstData.value === 'number' ? firstData.value : 0,\n chartTitle: typeof firstData.title?.text === 'string' ? firstData.title?.text : '',\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,\n width: typeof layout?.width === 'number' ? layout?.width : 0,\n height: typeof layout?.height === 'number' ? layout?.height : 0,\n hideLegend: true,\n styles,\n };\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nfunction isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n}\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"]}
|
|
@@ -22,11 +22,16 @@ define(["require", "exports", "tslib", "react", "d3-shape", "@fluentui/react/lib
|
|
|
22
22
|
var yValue = point.yAxisCalloutData || point.data || 0;
|
|
23
23
|
return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || (legend ? "".concat(legend, ", ") : '') + "".concat(yValue, ".");
|
|
24
24
|
};
|
|
25
|
+
_this._shouldHighlightArc = function (legend) {
|
|
26
|
+
var activeArc = _this.props.activeArc;
|
|
27
|
+
// If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.
|
|
28
|
+
return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);
|
|
29
|
+
};
|
|
25
30
|
_this._renderArcLabel = function (className) {
|
|
26
|
-
var _a = _this.props, arc = _a.arc, data = _a.data, innerRadius = _a.innerRadius, outerRadius = _a.outerRadius, showLabelsInPercent = _a.showLabelsInPercent, totalValue = _a.totalValue, hideLabels = _a.hideLabels
|
|
31
|
+
var _a = _this.props, arc = _a.arc, data = _a.data, innerRadius = _a.innerRadius, outerRadius = _a.outerRadius, showLabelsInPercent = _a.showLabelsInPercent, totalValue = _a.totalValue, hideLabels = _a.hideLabels;
|
|
27
32
|
if (hideLabels ||
|
|
28
33
|
Math.abs(data.endAngle - data.startAngle) < Math.PI / 12 ||
|
|
29
|
-
(
|
|
34
|
+
!_this._shouldHighlightArc(data.data.legend)) {
|
|
30
35
|
return null;
|
|
31
36
|
}
|
|
32
37
|
var _b = arc.centroid(data), base = _b[0], perp = _b[1];
|
|
@@ -48,13 +53,13 @@ define(["require", "exports", "tslib", "react", "d3-shape", "@fluentui/react/lib
|
|
|
48
53
|
_updateChart(newProps);
|
|
49
54
|
};
|
|
50
55
|
Arc.prototype.render = function () {
|
|
51
|
-
var _a, _b, _c, _d, _e;
|
|
52
|
-
var
|
|
56
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
57
|
+
var _h = this.props, arc = _h.arc, href = _h.href, focusedArcId = _h.focusedArcId, activeArc = _h.activeArc;
|
|
53
58
|
var getClassNames = (0, Utilities_1.classNamesFunction)();
|
|
54
59
|
var id = this.props.uniqText + this.props.data.data.legend.replace(/\s+/, '') + this.props.data.data.data;
|
|
55
|
-
var opacity =
|
|
56
|
-
var startAngle = (
|
|
57
|
-
var endAngle = ((
|
|
60
|
+
var opacity = activeArc && activeArc.length > 0 ? (activeArc.includes((_a = this.props.data) === null || _a === void 0 ? void 0 : _a.data.legend) ? 1 : 0.1) : 1;
|
|
61
|
+
var startAngle = (_c = (_b = this.props.data) === null || _b === void 0 ? void 0 : _b.startAngle) !== null && _c !== void 0 ? _c : 0;
|
|
62
|
+
var endAngle = ((_e = (_d = this.props.data) === null || _d === void 0 ? void 0 : _d.endAngle) !== null && _e !== void 0 ? _e : 0) - startAngle;
|
|
58
63
|
var cornerRadius = this.props.roundCorners ? 3 : 0;
|
|
59
64
|
var classNames = getClassNames(Arc_styles_1.getStyles, {
|
|
60
65
|
solidFill: this.props.enableGradient ? 'transparent' : this.props.color,
|
|
@@ -66,7 +71,7 @@ define(["require", "exports", "tslib", "react", "d3-shape", "@fluentui/react/lib
|
|
|
66
71
|
var clipId = (0, Utilities_1.getId)('Arc_clip') + "".concat(this.props.color, "_").concat(this.props.nextColor);
|
|
67
72
|
return (React.createElement("g", { ref: this.currentRef },
|
|
68
73
|
!!focusedArcId && focusedArcId === id && (React.createElement("path", { id: id + 'focusRing', d: arc.cornerRadius(cornerRadius)(this.props.focusData), className: classNames.focusRing })),
|
|
69
|
-
React.createElement("path", { id: id, d: arc.cornerRadius(cornerRadius)(this.props.data), onFocus: this._onFocus.bind(this, this.props.data.data, id), className: classNames.root, "data-is-focusable": this.
|
|
74
|
+
React.createElement("path", { id: id, d: arc.cornerRadius(cornerRadius)(this.props.data), onFocus: this._onFocus.bind(this, this.props.data.data, id), className: classNames.root, "data-is-focusable": this._shouldHighlightArc(this.props.data.data.legend) || ((_f = this.props.activeArc) === null || _f === void 0 ? void 0 : _f.length) === 0, onMouseOver: this._hoverOn.bind(this, this.props.data.data), onMouseMove: this._hoverOn.bind(this, this.props.data.data), onMouseLeave: this._hoverOff, onBlur: this._onBlur, onClick: href ? this._redirectToUrl.bind(this, href) : (_g = this.props.data) === null || _g === void 0 ? void 0 : _g.data.onClick, "aria-label": this._getAriaLabel(), role: "img" }),
|
|
70
75
|
this._renderArcLabel(classNames.arcLabel),
|
|
71
76
|
this.props.enableGradient && (React.createElement(React.Fragment, null,
|
|
72
77
|
React.createElement("clipPath", { id: clipId },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;IAaA;QAAyB,+BAAqC;QAA9D;;YAKS,WAAK,GAAO,EAAE,CAAC;YAEd,gBAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;YAC/C,YAAM,GAAY,IAAA,kBAAM,GAAE,CAAC;YAqF3B,eAAS,GAAG;gBAClB,KAAI,CAAC,KAAK,CAAC,kBAAmB,EAAE,CAAC;YACnC,CAAC,CAAC;YAEM,aAAO,GAAG;gBAChB,KAAI,CAAC,KAAK,CAAC,cAAe,EAAE,CAAC;YAC/B,CAAC,CAAC;YAMM,mBAAa,GAAG;;gBACtB,IAAM,KAAK,GAAG,KAAI,CAAC,KAAK,CAAC,IAAK,CAAC,IAAI,CAAC;gBACpC,IAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,CAAC;gBACtD,IAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;gBACzD,OAAO,CAAA,MAAA,KAAK,CAAC,wBAAwB,0CAAE,SAAS,KAAI,CAAC,MAAM,CAAC,CAAC,CAAC,UAAG,MAAM,OAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,UAAG,MAAM,MAAG,CAAC;YACnG,CAAC,CAAC;YAEM,qBAAe,GAAG,UAAC,SAAiB;gBACpC,IAAA,KAAkG,KAAI,CAAC,KAAK,EAA1G,GAAG,SAAA,EAAE,IAAI,UAAA,EAAE,WAAW,iBAAA,EAAE,WAAW,iBAAA,EAAE,mBAAmB,yBAAA,EAAE,UAAU,gBAAA,E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AC,MAAM,EAAC,MAAM,EAAC,QAAQ,EAAE,eAAQ,MAAM,MAAG;wBACrF,6BAAK,SAAS,EAAE,UAAU,CAAC,WAAW,GAAI,CAC5B,CACf,CACJ,CACC,CACL,CAAC;QACJ,CAAC;QAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,EAAU;YAChD,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjE,CAAC;QAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,UAA4C;YAClF,UAAU,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAChD,CAAC;QAUO,4BAAc,GAAtB,UAAuB,IAAwB;YAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,CAAC;QAtGa,gBAAY,GAAuB;YAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;SACb,AAFyB,CAExB;QA6IJ,UAAC;KAAA,AAhJD,CAAyB,KAAK,CAAC,SAAS,GAgJvC;IAhJY,kBAAG;IAkJhB,SAAS,YAAY,CAAC,QAAmB;QACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatValueWithSIPrefix } from '../../../utilities/index';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n public render(): JSX.Element {\n const { arc, href, focusedArcId } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id = this.props.uniqText! + this.props.data!.data.legend!.replace(/\\s+/, '') + this.props.data!.data.data;\n const opacity: number =\n this.props.activeArc === this.props.data!.data.legend || this.props.activeArc === '' ? 1 : 0.1;\n\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={this.props.activeArc === this.props.data!.data.legend || this.props.activeArc === ''}\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels, activeArc } = this.props;\n\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n (activeArc !== data!.data.legend && activeArc !== '')\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatValueWithSIPrefix(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;IAaA;QAAyB,+BAAqC;QAA9D;;YAKS,WAAK,GAAO,EAAE,CAAC;YAEd,gBAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;YAC/C,YAAM,GAAY,IAAA,kBAAM,GAAE,CAAC;YAsF3B,eAAS,GAAG;gBAClB,KAAI,CAAC,KAAK,CAAC,kBAAmB,EAAE,CAAC;YACnC,CAAC,CAAC;YAEM,aAAO,GAAG;gBAChB,KAAI,CAAC,KAAK,CAAC,cAAe,EAAE,CAAC;YAC/B,CAAC,CAAC;YAMM,mBAAa,GAAG;;gBACtB,IAAM,KAAK,GAAG,KAAI,CAAC,KAAK,CAAC,IAAK,CAAC,IAAI,CAAC;gBACpC,IAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,CAAC;gBACtD,IAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;gBACzD,OAAO,CAAA,MAAA,KAAK,CAAC,wBAAwB,0CAAE,SAAS,KAAI,CAAC,MAAM,CAAC,CAAC,CAAC,UAAG,MAAM,OAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,UAAG,MAAM,MAAG,CAA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E,IAAA,cAAK,GAAE;SACb,AAFyB,CAExB;QAmJJ,UAAC;KAAA,AAtJD,CAAyB,KAAK,CAAC,SAAS,GAsJvC;IAtJY,kBAAG;IAwJhB,SAAS,YAAY,CAAC,QAAmB;QACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatValueWithSIPrefix } from '../../../utilities/index';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n public render(): JSX.Element {\n const { arc, href, focusedArcId, activeArc } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id = this.props.uniqText! + this.props.data!.data.legend!.replace(/\\s+/, '') + this.props.data!.data.data;\n const opacity: number =\n activeArc && activeArc.length > 0 ? (activeArc.includes(this.props.data?.data.legend!) ? 1 : 0.1) : 1;\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={\n this._shouldHighlightArc(this.props.data!.data.legend!) || this.props.activeArc?.length === 0\n }\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _shouldHighlightArc = (legend?: string): boolean => {\n const { activeArc } = this.props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels } = this.props;\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n !this._shouldHighlightArc(data!.data.legend!)\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatValueWithSIPrefix(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arc.types.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { IChartDataPoint } from '../index';\nexport interface IArcProps {\n /**\n * Theme\n */\n theme: ITheme;\n /**\n * Data to render in the Arc.\n */\n data?: IArcData;\n\n /**\n * Data to render focused Arc\n */\n focusData?: IArcData;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n /**\n * shape for Arc.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n arc?: any;\n\n /**\n * innerRadius of the Arc.\n */\n innerRadius?: number;\n\n /**\n * outerRadius of the Arc.\n */\n outerRadius?: number;\n\n /**\n * Color for the Arc.\n */\n color: string;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * Active Arc for chart\n */\n activeArc?: string;\n\n /**\n * internal prop for href\n */\n href?: string;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop used to define the sum of all arc values\n */\n totalValue?: number;\n\n /**\n * Prop to hide the arc labels\n */\n hideLabels?: boolean;\n\n /**\n * Prop to enable the gradient in the arc\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Next color stop for the gradient\n * [Only used when enableGradient is True].\n */\n nextColor: string;\n}\n\nexport interface IArcData {\n /**\n * Data to render in the chart for individual arc.\n */\n data: IChartDataPoint;\n /**\n * endAngle of the Arc\n */\n endAngle: number;\n /**\n * index of the Arc\n */\n index: number;\n /**\n * padAngle of the Arc\n */\n padAngle: number;\n /**\n * startAngle of the Arc\n */\n startAngle: number;\n /**\n * value of the Arc\n */\n value: number;\n}\n\nexport interface IArcStyleProps {\n /**\n * Theme\n */\n theme: ITheme;\n\n /**\n * internal prop for href\n */\n href: string;\n\n /**\n * solid color for the arc (when enableGradient is false)\n */\n solidFill: string;\n\n /**\n * gradient for the arc (when enableGradient is true)\n */\n gradientFill: string;\n\n /**\n * wether gradients are enabled for the arc\n */\n opacity: number;\n}\n\nexport interface IArcStyles {\n /**\n * Style set for the card header component root\n */\n root: IStyle;\n\n /**\n * Style set for the gradient arc\n */\n gradientArc: IStyle;\n\n /**\n * styles for the focus\n */\n focusRing: IStyle;\n\n /**\n * Style for the arc labels\n */\n arcLabel: IStyle;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Arc.types.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { IChartDataPoint } from '../index';\nexport interface IArcProps {\n /**\n * Theme\n */\n theme: ITheme;\n /**\n * Data to render in the Arc.\n */\n data?: IArcData;\n\n /**\n * Data to render focused Arc\n */\n focusData?: IArcData;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n /**\n * shape for Arc.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n arc?: any;\n\n /**\n * innerRadius of the Arc.\n */\n innerRadius?: number;\n\n /**\n * outerRadius of the Arc.\n */\n outerRadius?: number;\n\n /**\n * Color for the Arc.\n */\n color: string;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * Active Arc for chart\n */\n activeArc?: string[];\n\n /**\n * internal prop for href\n */\n href?: string;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop used to define the sum of all arc values\n */\n totalValue?: number;\n\n /**\n * Prop to hide the arc labels\n */\n hideLabels?: boolean;\n\n /**\n * Prop to enable the gradient in the arc\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Next color stop for the gradient\n * [Only used when enableGradient is True].\n */\n nextColor: string;\n}\n\nexport interface IArcData {\n /**\n * Data to render in the chart for individual arc.\n */\n data: IChartDataPoint;\n /**\n * endAngle of the Arc\n */\n endAngle: number;\n /**\n * index of the Arc\n */\n index: number;\n /**\n * padAngle of the Arc\n */\n padAngle: number;\n /**\n * startAngle of the Arc\n */\n startAngle: number;\n /**\n * value of the Arc\n */\n value: number;\n}\n\nexport interface IArcStyleProps {\n /**\n * Theme\n */\n theme: ITheme;\n\n /**\n * internal prop for href\n */\n href: string;\n\n /**\n * solid color for the arc (when enableGradient is false)\n */\n solidFill: string;\n\n /**\n * gradient for the arc (when enableGradient is true)\n */\n gradientFill: string;\n\n /**\n * wether gradients are enabled for the arc\n */\n opacity: number;\n}\n\nexport interface IArcStyles {\n /**\n * Style set for the card header component root\n */\n root: IStyle;\n\n /**\n * Style set for the gradient arc\n */\n gradientArc: IStyle;\n\n /**\n * styles for the focus\n */\n focusRing: IStyle;\n\n /**\n * Style for the arc labels\n */\n arcLabel: IStyle;\n}\n"]}
|
|
@@ -14,9 +14,9 @@ export interface IDonutChartState {
|
|
|
14
14
|
xCalloutValue?: string;
|
|
15
15
|
yCalloutValue?: string;
|
|
16
16
|
focusedArcId?: string;
|
|
17
|
-
selectedLegend: string;
|
|
18
17
|
dataPointCalloutProps?: IChartDataPoint;
|
|
19
18
|
callOutAccessibilityData?: IAccessibilityProps;
|
|
19
|
+
selectedLegends: string[];
|
|
20
20
|
}
|
|
21
21
|
export declare class DonutChartBase extends React.Component<IDonutChartProps, IDonutChartState> implements IChart {
|
|
22
22
|
static defaultProps: Partial<IDonutChartProps>;
|
|
@@ -37,6 +37,7 @@ export declare class DonutChartBase extends React.Component<IDonutChartProps, ID
|
|
|
37
37
|
private _elevateToMinimums;
|
|
38
38
|
private _setViewBox;
|
|
39
39
|
private _createLegends;
|
|
40
|
+
private _onLegendSelectionChange;
|
|
40
41
|
private _focusCallback;
|
|
41
42
|
private _hoverCallback;
|
|
42
43
|
private _onBlur;
|
|
@@ -48,9 +49,10 @@ export declare class DonutChartBase extends React.Component<IDonutChartProps, ID
|
|
|
48
49
|
* This function returns
|
|
49
50
|
* the selected legend if there is one
|
|
50
51
|
* or the hovered legend if none of the legends is selected.
|
|
51
|
-
* Note: This won't work in case of multiple legends selection.
|
|
52
52
|
*/
|
|
53
53
|
private _getHighlightedLegend;
|
|
54
|
+
private _isLegendHighlighted;
|
|
55
|
+
private _noLegendsHighlighted;
|
|
54
56
|
private _isChartEmpty;
|
|
55
57
|
private _addDefaultColors;
|
|
56
58
|
}
|
|
@@ -7,7 +7,6 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
7
7
|
var DonutChartBase = /** @class */ (function (_super) {
|
|
8
8
|
tslib_1.__extends(DonutChartBase, _super);
|
|
9
9
|
function DonutChartBase(props) {
|
|
10
|
-
var _a, _b;
|
|
11
10
|
var _this = _super.call(this, props) || this;
|
|
12
11
|
_this._closeCallout = function () {
|
|
13
12
|
_this.setState({
|
|
@@ -18,7 +17,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
18
17
|
_this._currentHoverElement = element;
|
|
19
18
|
_this.setState({
|
|
20
19
|
/** Show the callout if highlighted arc is focused and Hide it if unhighlighted arc is focused */
|
|
21
|
-
showHover: _this.
|
|
20
|
+
showHover: _this._noLegendsHighlighted() || _this._isLegendHighlighted(data.legend),
|
|
22
21
|
value: data.data.toString(),
|
|
23
22
|
legend: data.legend,
|
|
24
23
|
color: data.color,
|
|
@@ -41,7 +40,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
41
40
|
}
|
|
42
41
|
_this.setState({
|
|
43
42
|
/** Show the callout if highlighted arc is hovered and Hide it if unhighlighted arc is hovered */
|
|
44
|
-
showHover: _this.
|
|
43
|
+
showHover: _this._noLegendsHighlighted() || _this._isLegendHighlighted(data.legend),
|
|
45
44
|
value: data.data.toString(),
|
|
46
45
|
legend: data.legend,
|
|
47
46
|
color: color,
|
|
@@ -59,6 +58,12 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
59
58
|
_this._calloutAnchorPoint = null;
|
|
60
59
|
_this.setState({ showHover: false });
|
|
61
60
|
};
|
|
61
|
+
_this._isLegendHighlighted = function (legend) {
|
|
62
|
+
return _this._getHighlightedLegend().includes(legend);
|
|
63
|
+
};
|
|
64
|
+
_this._noLegendsHighlighted = function () {
|
|
65
|
+
return _this._getHighlightedLegend().length === 0;
|
|
66
|
+
};
|
|
62
67
|
_this._addDefaultColors = function (donutChartDataPoint) {
|
|
63
68
|
return donutChartDataPoint
|
|
64
69
|
? donutChartDataPoint.map(function (item, index) {
|
|
@@ -82,12 +87,12 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
82
87
|
legend: '',
|
|
83
88
|
_width: _this.props.width || 200,
|
|
84
89
|
_height: _this.props.height || 200,
|
|
85
|
-
activeLegend:
|
|
90
|
+
activeLegend: undefined,
|
|
86
91
|
color: '',
|
|
87
92
|
xCalloutValue: '',
|
|
88
93
|
yCalloutValue: '',
|
|
89
|
-
selectedLegend: (_b = (_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegend) !== null && _b !== void 0 ? _b : '',
|
|
90
94
|
focusedArcId: '',
|
|
95
|
+
selectedLegends: [],
|
|
91
96
|
};
|
|
92
97
|
_this._hoverCallback = _this._hoverCallback.bind(_this);
|
|
93
98
|
_this._focusCallback = _this._focusCallback.bind(_this);
|
|
@@ -186,42 +191,55 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
186
191
|
var legend = {
|
|
187
192
|
title: point.legend,
|
|
188
193
|
color: color,
|
|
189
|
-
action: function () {
|
|
190
|
-
if (_this.state.selectedLegend === point.legend) {
|
|
191
|
-
_this.setState({ selectedLegend: '' });
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
_this.setState({ selectedLegend: point.legend });
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
194
|
hoverAction: function () {
|
|
198
195
|
_this._handleChartMouseLeave();
|
|
199
196
|
_this.setState({ activeLegend: point.legend });
|
|
200
197
|
},
|
|
201
198
|
onMouseOutAction: function () {
|
|
202
|
-
_this.setState({ activeLegend:
|
|
199
|
+
_this.setState({ activeLegend: undefined });
|
|
203
200
|
},
|
|
204
201
|
};
|
|
205
202
|
return legend;
|
|
206
203
|
});
|
|
207
|
-
var legends = (React.createElement(index_1.Legends, tslib_1.__assign({ legends: legendDataItems, centerLegends: true, overflowProps: this.props.legendsOverflowProps, focusZonePropsInHoverCard: this.props.focusZonePropsForLegendsInHoverCard, overflowText: this.props.legendsOverflowText }, this.props.legendProps
|
|
204
|
+
var legends = (React.createElement(index_1.Legends, tslib_1.__assign({ legends: legendDataItems, centerLegends: true, overflowProps: this.props.legendsOverflowProps, focusZonePropsInHoverCard: this.props.focusZonePropsForLegendsInHoverCard, overflowText: this.props.legendsOverflowText }, this.props.legendProps, {
|
|
205
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
206
|
+
onChange: this._onLegendSelectionChange.bind(this) })));
|
|
208
207
|
return legends;
|
|
209
208
|
};
|
|
209
|
+
DonutChartBase.prototype._onLegendSelectionChange = function (selectedLegends, event, currentLegend) {
|
|
210
|
+
var _a, _b;
|
|
211
|
+
if (this.props.legendProps && ((_a = this.props.legendProps) === null || _a === void 0 ? void 0 : _a.canSelectMultipleLegends)) {
|
|
212
|
+
this.setState({ selectedLegends: selectedLegends });
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.setState({ selectedLegends: selectedLegends.slice(-1) });
|
|
216
|
+
}
|
|
217
|
+
if ((_b = this.props.legendProps) === null || _b === void 0 ? void 0 : _b.onChange) {
|
|
218
|
+
this.props.legendProps.onChange(selectedLegends, event, currentLegend);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
210
221
|
DonutChartBase.prototype._hoverLeave = function () {
|
|
211
222
|
/**/
|
|
212
223
|
};
|
|
213
224
|
DonutChartBase.prototype._valueInsideDonut = function (valueInsideDonut, data) {
|
|
214
225
|
var _this = this;
|
|
215
|
-
var
|
|
216
|
-
if (valueInsideDonut !== undefined && (
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
226
|
+
var highlightedLegends = this._getHighlightedLegend();
|
|
227
|
+
if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || this.state.showHover)) {
|
|
228
|
+
var pointValue = data.find(function (point) { return _this._isLegendHighlighted(point.legend); });
|
|
229
|
+
return pointValue
|
|
230
|
+
? pointValue.yAxisCalloutData
|
|
231
|
+
? pointValue.yAxisCalloutData
|
|
232
|
+
: pointValue.data
|
|
233
|
+
: valueInsideDonut;
|
|
234
|
+
}
|
|
235
|
+
else if (highlightedLegends.length > 0) {
|
|
236
|
+
var totalValue_1 = 0;
|
|
237
|
+
data.forEach(function (point) {
|
|
238
|
+
if (highlightedLegends.includes(point.legend)) {
|
|
239
|
+
totalValue_1 += point.data;
|
|
221
240
|
}
|
|
222
|
-
return;
|
|
223
241
|
});
|
|
224
|
-
return
|
|
242
|
+
return totalValue_1;
|
|
225
243
|
}
|
|
226
244
|
else {
|
|
227
245
|
return valueInsideDonut;
|
|
@@ -238,10 +256,13 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
238
256
|
* This function returns
|
|
239
257
|
* the selected legend if there is one
|
|
240
258
|
* or the hovered legend if none of the legends is selected.
|
|
241
|
-
* Note: This won't work in case of multiple legends selection.
|
|
242
259
|
*/
|
|
243
260
|
DonutChartBase.prototype._getHighlightedLegend = function () {
|
|
244
|
-
return this.state.
|
|
261
|
+
return this.state.selectedLegends.length > 0
|
|
262
|
+
? this.state.selectedLegends
|
|
263
|
+
: this.state.activeLegend
|
|
264
|
+
? [this.state.activeLegend]
|
|
265
|
+
: [];
|
|
245
266
|
};
|
|
246
267
|
DonutChartBase.prototype._isChartEmpty = function () {
|
|
247
268
|
return !(this.props.data &&
|