@fluentui/react-charting 5.23.22 → 5.23.23

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 +34 -1
  2. package/CHANGELOG.md +14 -2
  3. package/dist/react-charting.d.ts +40 -5
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +2 -0
  7. package/lib/components/DeclarativeChart/DeclarativeChart.d.ts +1 -0
  8. package/lib/components/DeclarativeChart/DeclarativeChart.js +16 -10
  9. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  10. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +9 -9
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +21 -21
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  13. package/lib/components/Legends/Legends.base.d.ts +14 -8
  14. package/lib/components/Legends/Legends.base.js +53 -34
  15. package/lib/components/Legends/Legends.base.js.map +1 -1
  16. package/lib/components/Legends/Legends.types.d.ts +40 -5
  17. package/lib/components/Legends/Legends.types.js.map +1 -1
  18. package/lib-amd/components/DeclarativeChart/DeclarativeChart.d.ts +1 -0
  19. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +18 -12
  20. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  21. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +9 -9
  22. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +21 -21
  23. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  24. package/lib-amd/components/Legends/Legends.base.d.ts +14 -8
  25. package/lib-amd/components/Legends/Legends.base.js +53 -34
  26. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  27. package/lib-amd/components/Legends/Legends.types.d.ts +40 -5
  28. package/lib-amd/components/Legends/Legends.types.js.map +1 -1
  29. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.d.ts +1 -0
  30. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +18 -11
  31. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  32. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +9 -9
  33. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +21 -21
  34. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  35. package/lib-commonjs/components/Legends/Legends.base.d.ts +14 -8
  36. package/lib-commonjs/components/Legends/Legends.base.js +53 -34
  37. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  38. package/lib-commonjs/components/Legends/Legends.types.d.ts +40 -5
  39. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  40. package/package.json +3 -3
  41. package/src/components/Legends/Legends.types.ts +42 -5
@@ -1 +1 @@
1
- {"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/PlotlySchemaAdapter.ts"],"names":[],"mappings":";;;;AAMA,qCAAwH;AACxH,qCAAwD;AACxD,uCAAmF;AAmBnF,iDAAsD;AAKtD,IAAM,MAAM,GAAG,UAAC,KAAU,IAAc,OAAA,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAzB,CAAyB,CAAC;AAClE,IAAM,QAAQ,GAAG,UAAC,KAAU,IAAc,OAAA,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAA5C,CAA4C,CAAC;AAChF,IAAM,WAAW,GAAG,UAAC,KAAY,IAAc,OAAA,mBAAmB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAjD,CAAiD,CAAC;AAA3F,QAAA,WAAW,eAAgF;AACjG,IAAM,aAAa,GAAG,UAAC,KAAY,IAAc,OAAA,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AI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;SACnD;KACF;AACH,CAAC","sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { 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 = (legendLabel: string, colorMap: React.MutableRefObject<Map<string, string>>): string => {\n if (!colorMap.current.has(legendLabel)) {\n const nextColor = getNextColor(colorMap.current.size + 1);\n colorMap.current.set(legendLabel, nextColor);\n return nextColor;\n }\n\n return colorMap.current.get(legendLabel) as string;\n};\n\nexport const transformPlotlyJsonToDonutProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IDonutChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const donutData = firstData.labels?.map((label: string, index: number): IChartDataPoint => {\n const color = getColor(label, colorMap);\n return {\n legend: label,\n data: firstData.values?.[index],\n color,\n };\n });\n\n const width: number = layout?.width || 440;\n const height: number = layout?.height || 220;\n const hideLabels = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;\n const donutMarginHorizontal = hideLabels ? 0 : 80;\n const donutMarginVertical = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n\n const styles: IDonutChartProps['styles'] = {\n root: {\n '[class^=\"arcLabel\"]': {\n fontSize: firstData.textfont?.size,\n },\n },\n };\n\n return {\n data: {\n chartTitle: layout?.title,\n chartData: donutData,\n },\n hideLegend: layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,\n styles,\n };\n};\n\nexport const transformPlotlyJsonToVSBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IVerticalStackedBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: { [key: string]: IVerticalStackedChartProps } = {};\n let yMaxValue = 0;\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };\n }\n const legend: string = series.name || `Series ${index1 + 1}`;\n if (series.type === 'bar') {\n const color = getColor(legend, colorMap);\n mapXToDataPoints[x].chartData.push({\n legend,\n data: series.y?.[index2],\n color,\n });\n } else if (series.type === 'line') {\n const color = getColor(legend, colorMap);\n mapXToDataPoints[x].lineData!.push({\n legend,\n y: series.y?.[index2],\n color,\n });\n }\n\n yMaxValue = Math.max(yMaxValue, series.y?.[index2]);\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barWidth: 'auto',\n yMaxValue,\n };\n};\n\nexport const transformPlotlyJsonToGVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IGroupedVerticalBarChartProps => {\n const { data, layout } = jsonObj;\n const mapXToDataPoints: Record<string, IGroupedVerticalBarChartData> = {};\n\n data.forEach((series: any, index1: number) => {\n series.x?.forEach((x: string | number, index2: number) => {\n if (!mapXToDataPoints[x]) {\n mapXToDataPoints[x] = { name: x.toString(), series: [] };\n }\n if (series.type === 'bar') {\n const legend: string = series.name || `Series ${index1 + 1}`;\n const color = getColor(legend, colorMap);\n\n mapXToDataPoints[x].series.push({\n key: legend,\n data: series.y?.[index2],\n color,\n legend,\n });\n }\n });\n });\n\n return {\n data: Object.values(mapXToDataPoints),\n chartTitle: layout?.title,\n // width: layout?.width,\n // height: layout?.height,\n barwidth: 'auto',\n };\n};\n\nexport const transformPlotlyJsonToVBCProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\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 = series.name || `Series ${index + 1}`;\n const color = getColor(legend, colorMap);\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: 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): ILineChartProps | IAreaChartProps => {\n const { data, layout } = jsonObj;\n\n const chartData: ILineChartPoints[] = data.map((series: any, index: number) => {\n const xValues = series.x;\n const isString = typeof xValues[0] === 'string';\n const isXDate = isDateArray(xValues);\n const isXNumber = isNumberArray(xValues);\n const legend = series.name || `Series ${index + 1}`;\n const lineColor = getColor(legend, colorMap);\n\n return {\n legend,\n data: xValues.map((x: string | number, i: number) => ({\n x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x as string) : x) : x,\n y: series.y[i],\n })),\n color: lineColor,\n };\n });\n\n const chartProps: IChartProps = {\n chartTitle: layout.title || '',\n lineChartData: chartData,\n };\n\n if (isAreaChart) {\n return {\n data: chartProps,\n 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): IHorizontalBarChartWithAxisProps => {\n const { data, layout } = jsonObj;\n\n const chartData: IHorizontalBarChartWithAxisDataPoint[] = data\n .map((series: any, index: number) => {\n return series.y.map((yValue: string, i: number) => {\n const color = getColor(yValue, colorMap);\n return {\n x: series.x[i],\n y: yValue,\n legend: yValue,\n color,\n };\n });\n })\n .flat();\n\n const chartHeight = layout.height || 350;\n const margin = layout.margin?.l || 0;\n const padding = layout.margin?.pad || 0;\n const availableHeight = chartHeight - margin - padding;\n const numberOfBars = data[0].y.length;\n const gapFactor = 0.5;\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n return {\n data: chartData,\n chartTitle: layout.title || '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: layout.width || 600,\n },\n },\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n firstData.x?.forEach((xVal: any, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = firstData.z?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: layout.xaxis?.type === 'date' ? new Date(xVal) : xVal,\n y: layout.yaxis?.type === 'date' ? new Date(yVal) : yVal,\n value: zVal,\n });\n\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: firstData.name || '',\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Convert normalized values to actual values\n const domainValuesForColorScale: number[] = firstData.colorscale?.map((arr: any) => arr[0] * (zMax - zMin) + zMin);\n const rangeValuesForColorScale: string[] = firstData.colorscale?.map((arr: any) => arr[1]);\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): ISankeyChartProps => {\n const { data, layout } = jsonObj;\n const { link, node } = data[0];\n const validLinks = link.value\n .map((val: number, index: number) => ({\n value: val,\n source: link.source[index],\n target: link.target[index],\n }))\n // eslint-disable-next-line @typescript-eslint/no-shadow\n //@ts-expect-error Dynamic link object. Ignore for now.\n .filter(x => x.source !== x.target); // Filter out self-references (circular links)\n\n const sankeyChartData = {\n nodes: node.label.map((label: string, index: number) => {\n const color = getColor(label, colorMap);\n\n return {\n nodeId: index,\n name: label,\n color,\n };\n }),\n links: validLinks.map((validLink: any, index: number) => {\n return {\n ...validLink,\n };\n }),\n };\n\n const width: number = layout?.width || 440;\n const height: number = layout?.height || 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n fontSize: layout.font?.size,\n },\n };\n const shouldResize: number = width + height;\n return {\n data: {\n chartTitle: layout?.title,\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n): IGaugeChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n\n const segments = firstData.gauge?.steps?.map((step: any, index: number): IGaugeChartSegment => {\n const legend = step.name || `Segment ${index + 1}`;\n const color = getColor(legend, colorMap);\n return {\n legend,\n size: step.range?.[1] - step.range?.[0],\n color,\n };\n });\n\n let sublabel: string | undefined;\n let sublabelColor: string | undefined;\n if (typeof firstData.delta?.reference === 'number') {\n const diff = firstData.value - firstData.delta.reference;\n if (diff >= 0) {\n sublabel = `\\u25B2 ${diff}`;\n const color = getColor(firstData.delta.increasing?.color || '', colorMap);\n sublabelColor = color;\n } else {\n sublabel = `\\u25BC ${Math.abs(diff)}`;\n const color = getColor(firstData.delta.decreasing?.color || '', colorMap);\n sublabelColor = color;\n }\n }\n\n const styles: IGaugeChartProps['styles'] = {\n sublabel: {\n fill: sublabelColor,\n },\n };\n\n return {\n segments,\n chartValue: firstData.value,\n chartTitle: firstData.title?.text,\n sublabel,\n // range values can be null\n minValue: firstData.gauge?.axis?.range?.[0] ?? undefined,\n maxValue: firstData.gauge?.axis?.range?.[1] ?? undefined,\n chartValueFormat: () => firstData.value,\n width: layout?.width,\n height: layout?.height,\n hideLegend: true,\n styles,\n };\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nfunction isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n for (const attribute of arrayAttributes) {\n console.log(attribute);\n }\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlotlySchemaAdapter.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/PlotlySchemaAdapter.ts"],"names":[],"mappings":";;;;AAMA,qCAAwH;AACxH,qCAAwD;AACxD,uCAAmF;AAmBnF,iDAAsD;AAKtD,IAAM,MAAM,GAAG,UAAC,KAAU,IAAc,OAAA,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAzB,CAAyB,CAAC;AAClE,IAAM,QAAQ,GAAG,UAAC,KAAU,IAAc,OAAA,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAA5C,CAA4C,CAAC;AAChF,IAAM,WAAW,GAAG,UAAC,KAAY,IAAc,OAAA,mBAAmB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAjD,CAAiD,CAAC;AAA3F,QAAA,WAAW,eAAgF;AACjG,IAAM,aAAa,GAAG,UAAC,KAAY,IAAc,OAAA,mBAAmB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAnD,CAAmD,CAAC;AAA/F,QAA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AAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;qBACjE;iBACF;aACF;SACF;aAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE;YAC9B,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;SACnD;KACF;AACH,CAAC","sourcesContent":["/* eslint-disable one-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-var */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { 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 = layout?.width || 440;\n const height: number = layout?.height || 220;\n const hideLabels = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;\n const donutMarginHorizontal = hideLabels ? 0 : 80;\n const donutMarginVertical = 40 + (hideLabels ? 0 : 40);\n const innerRadius: number = firstData.hole\n ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)\n : 0;\n\n const styles: IDonutChartProps['styles'] = {\n root: {\n '[class^=\"arcLabel\"]': {\n fontSize: firstData.textfont?.size,\n },\n },\n };\n\n return {\n data: {\n chartTitle: layout?.title,\n chartData: donutData,\n },\n hideLegend: layout?.showlegend === false ? true : false,\n width,\n height,\n innerRadius,\n hideLabels,\n showLabelsInPercent: firstData.textinfo ? firstData.textinfo === 'percent' : true,\n styles,\n };\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 = series.name || `Series ${index + 1}`;\n const color = 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: 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 = 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: 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 = layout.height || 350;\n const margin = layout.margin?.l || 0;\n const padding = layout.margin?.pad || 0;\n const availableHeight = chartHeight - margin - padding;\n const numberOfBars = data[0].y.length;\n const gapFactor = 0.5;\n const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));\n\n return {\n data: chartData,\n chartTitle: layout.title || '',\n barHeight,\n showYAxisLables: true,\n styles: {\n root: {\n height: chartHeight,\n width: layout.width || 600,\n },\n },\n };\n};\n\nexport const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartProps => {\n const { data, layout } = jsonObj;\n const firstData = data[0];\n const heatmapDataPoints: IHeatMapChartDataPoint[] = [];\n let zMin = Number.POSITIVE_INFINITY;\n let zMax = Number.NEGATIVE_INFINITY;\n\n firstData.x?.forEach((xVal: any, xIdx: number) => {\n firstData.y?.forEach((yVal: any, yIdx: number) => {\n const zVal = firstData.z?.[yIdx]?.[xIdx];\n\n heatmapDataPoints.push({\n x: layout.xaxis?.type === 'date' ? new Date(xVal) : xVal,\n y: layout.yaxis?.type === 'date' ? new Date(yVal) : yVal,\n value: zVal,\n });\n\n zMin = Math.min(zMin, zVal);\n zMax = Math.max(zMax, zVal);\n });\n });\n const heatmapData: IHeatMapChartData = {\n legend: firstData.name || '',\n data: heatmapDataPoints,\n value: 0,\n };\n\n // Convert normalized values to actual values\n const domainValuesForColorScale: number[] = firstData.colorscale?.map((arr: any) => arr[0] * (zMax - zMin) + zMin);\n const rangeValuesForColorScale: string[] = firstData.colorscale?.map((arr: any) => arr[1]);\n\n return {\n data: [heatmapData],\n domainValuesForColorScale,\n rangeValuesForColorScale,\n hideLegend: true,\n };\n};\n\nexport const transformPlotlyJsonToSankeyProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n 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(x => x.source !== x.target); // Filter out self-references (circular links)\n\n const sankeyChartData = {\n nodes: node.label.map((label: string, index: number) => {\n const color = getColor(label, colorMap, 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 = layout?.width || 440;\n const height: number = layout?.height || 220;\n const styles: ISankeyChartProps['styles'] = {\n root: {\n fontSize: layout.font?.size,\n },\n };\n const shouldResize: number = width + height;\n return {\n data: {\n chartTitle: layout?.title,\n SankeyChartData: sankeyChartData,\n },\n width,\n height,\n styles,\n shouldResize,\n enableReflow: true,\n };\n};\n\nexport const transformPlotlyJsonToGaugeProps = (\n jsonObj: any,\n colorMap: React.MutableRefObject<Map<string, string>>,\n 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: firstData.value,\n chartTitle: firstData.title?.text,\n sublabel,\n // range values can be null\n minValue: firstData.gauge?.axis?.range?.[0] ?? undefined,\n maxValue: firstData.gauge?.axis?.range?.[1] ?? undefined,\n chartValueFormat: () => firstData.value,\n width: layout?.width,\n height: layout?.height,\n hideLegend: true,\n styles,\n };\n};\n\nfunction isTypedArray(a: any) {\n return ArrayBuffer.isView(a) && !(a instanceof DataView);\n}\n\nfunction isArrayOrTypedArray(a: any) {\n return Array.isArray(a) || isTypedArray(a);\n}\n\nfunction isPlainObject(obj: any) {\n if (window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty')\n );\n}\n\nvar arrayAttributes: any[] = [];\nvar stack: any[] = [];\nvar isArrayStack: any[] = [];\nvar baseContainer: any, baseAttrName: any;\n/**\n * Interate iteratively through the trace object and find all the array attributes.\n * 1 trace record = 1 series of data\n * @param trace\n */\nexport function findArrayAttributes(trace: any) {\n // Init basecontainer and baseAttrName\n crawlIntoTrace(baseContainer, 0, '');\n for (const attribute of arrayAttributes) {\n console.log(attribute);\n }\n}\n\nfunction crawlIntoTrace(container: any, i: number, astrPartial: any) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if (i === stack.length - 1) {\n if (isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if (isArrayStack[i]) {\n if (Array.isArray(item)) {\n for (var j = 0; j < item.length; j++) {\n if (isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if (isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n}\n"]}
@@ -13,6 +13,7 @@ export declare class LegendsBase extends React.Component<ILegendsProps, ILegendS
13
13
  private _classNames;
14
14
  /** Boolean variable to check if one or more legends are selected */
15
15
  private _isLegendSelected;
16
+ static getDerivedStateFromProps(newProps: ILegendsProps, prevState: ILegendState): ILegendState;
16
17
  constructor(props: ILegendsProps);
17
18
  render(): JSX.Element;
18
19
  private _generateData;
@@ -20,17 +21,22 @@ export declare class LegendsBase extends React.Component<ILegendsProps, ILegendS
20
21
  private _onReduceData;
21
22
  private _onGrowData;
22
23
  /**
23
- * This function will get called when there is an ability to
24
- * select multiple legends
25
- * @param legend ILegend
24
+ * Determine whether the component is in "controlled" mode for selections, where the selected legend(s) are
25
+ * determined entirely by props passed in from the parent component.
26
26
  */
27
- private _canSelectMultipleLegends;
27
+ private _isInControlledMode;
28
28
  /**
29
- * This function will get called when there is
30
- * ability to select only single legend
31
- * @param legend ILegend
29
+ * Get the new selected legends based on the legend that was clicked when multi-select is enabled.
30
+ * @param legend The legend that was clicked
31
+ * @returns An object with the new selected legend(s) state data.
32
32
  */
33
- private _canSelectOnlySingleLegend;
33
+ private _getNewSelectedLegendsForMultiselect;
34
+ /**
35
+ * Get the new selected legends based on the legend that was clicked when single-select is enabled.
36
+ * @param legend The legend that was clicked
37
+ * @returns An object with the new selected legend state data.
38
+ */
39
+ private _getNewSelectedLegendsForSingleSelect;
34
40
  private _onClick;
35
41
  private _onRenderCompactCard;
36
42
  private _renderOverflowItems;
@@ -14,7 +14,7 @@ var LegendsBase = /** @class */ (function (_super) {
14
14
  tslib_1.__extends(LegendsBase, _super);
15
15
  function LegendsBase(props) {
16
16
  var _a;
17
- var _b;
17
+ var _b, _c, _d;
18
18
  var _this = _super.call(this, props) || this;
19
19
  /** Boolean variable to check if one or more legends are selected */
20
20
  _this._isLegendSelected = false;
@@ -50,11 +50,20 @@ var LegendsBase = /** @class */ (function (_super) {
50
50
  return { primary: primary, overflow: overflow };
51
51
  };
52
52
  /**
53
- * This function will get called when there is an ability to
54
- * select multiple legends
55
- * @param legend ILegend
53
+ * Determine whether the component is in "controlled" mode for selections, where the selected legend(s) are
54
+ * determined entirely by props passed in from the parent component.
56
55
  */
57
- _this._canSelectMultipleLegends = function (legend) {
56
+ _this._isInControlledMode = function () {
57
+ return _this.props.canSelectMultipleLegends
58
+ ? _this.props.selectedLegends !== undefined
59
+ : _this.props.selectedLegend !== undefined;
60
+ };
61
+ /**
62
+ * Get the new selected legends based on the legend that was clicked when multi-select is enabled.
63
+ * @param legend The legend that was clicked
64
+ * @returns An object with the new selected legend(s) state data.
65
+ */
66
+ _this._getNewSelectedLegendsForMultiselect = function (legend) {
58
67
  var selectedLegends = tslib_1.__assign({}, _this.state.selectedLegends);
59
68
  if (selectedLegends[legend.title]) {
60
69
  // Delete entry for the deselected legend to make
@@ -68,38 +77,27 @@ var LegendsBase = /** @class */ (function (_super) {
68
77
  selectedLegends = {};
69
78
  }
70
79
  }
71
- _this.setState({ selectedLegends: selectedLegends });
72
80
  return selectedLegends;
73
81
  };
74
82
  /**
75
- * This function will get called when there is
76
- * ability to select only single legend
77
- * @param legend ILegend
83
+ * Get the new selected legends based on the legend that was clicked when single-select is enabled.
84
+ * @param legend The legend that was clicked
85
+ * @returns An object with the new selected legend state data.
78
86
  */
79
- _this._canSelectOnlySingleLegend = function (legend) {
87
+ _this._getNewSelectedLegendsForSingleSelect = function (legend) {
80
88
  var _a;
81
- if (_this.state.selectedLegends[legend.title]) {
82
- _this.setState({ selectedLegends: {} });
83
- return false;
84
- }
85
- else {
86
- _this.setState({ selectedLegends: (_a = {}, _a[legend.title] = true, _a) });
87
- return true;
88
- }
89
+ return _this.state.selectedLegends[legend.title] ? {} : (_a = {}, _a[legend.title] = true, _a);
89
90
  };
90
91
  _this._onClick = function (legend, event) {
91
92
  var _a, _b, _c;
92
93
  var _d = _this.props.canSelectMultipleLegends, canSelectMultipleLegends = _d === void 0 ? false : _d;
93
- var selectedLegends = [];
94
- if (canSelectMultipleLegends) {
95
- var nextSelectedLegends = _this._canSelectMultipleLegends(legend);
96
- selectedLegends = Object.keys(nextSelectedLegends);
97
- }
98
- else {
99
- var isSelected = _this._canSelectOnlySingleLegend(legend);
100
- selectedLegends = isSelected ? [legend.title] : [];
94
+ var nextSelectedLegends = canSelectMultipleLegends
95
+ ? _this._getNewSelectedLegendsForMultiselect(legend)
96
+ : _this._getNewSelectedLegendsForSingleSelect(legend);
97
+ if (!_this._isInControlledMode()) {
98
+ _this.setState({ selectedLegends: nextSelectedLegends });
101
99
  }
102
- (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, selectedLegends, event, legend);
100
+ (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, Object.keys(nextSelectedLegends), event, legend);
103
101
  (_c = legend.action) === null || _c === void 0 ? void 0 : _c.call(legend);
104
102
  };
105
103
  _this._onRenderCompactCard = function (expandingCard) {
@@ -222,24 +220,45 @@ var LegendsBase = /** @class */ (function (_super) {
222
220
  shape,
223
221
  React.createElement("div", { className: classNames.text }, legend.title)));
224
222
  };
225
- var defaultSelectedLegends = {};
223
+ //let defaultSelectedLegends = {};
224
+ var initialSelectedLegends = (_b = props.selectedLegends) !== null && _b !== void 0 ? _b : props.defaultSelectedLegends;
225
+ var initialSelectedLegend = (_c = props.selectedLegend) !== null && _c !== void 0 ? _c : props.defaultSelectedLegend;
226
+ var selectedLegendsState = {};
226
227
  if (props.canSelectMultipleLegends) {
227
- defaultSelectedLegends =
228
- ((_b = props.defaultSelectedLegends) === null || _b === void 0 ? void 0 : _b.reduce(function (combinedDict, key) {
228
+ selectedLegendsState =
229
+ ((_d = (initialSelectedLegends !== null && initialSelectedLegends !== void 0 ? initialSelectedLegends : [])) === null || _d === void 0 ? void 0 : _d.reduce(
230
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
231
+ function (combineDict, key) {
229
232
  var _a;
230
- return (tslib_1.__assign((_a = {}, _a[key] = true, _a), combinedDict));
233
+ return (tslib_1.__assign((_a = {}, _a[key] = true, _a), combineDict));
231
234
  }, {})) || {};
232
235
  }
233
- else if (props.defaultSelectedLegend) {
234
- defaultSelectedLegends = (_a = {}, _a[props.defaultSelectedLegend] = true, _a);
236
+ else if (initialSelectedLegend) {
237
+ selectedLegendsState = (_a = {}, _a[initialSelectedLegend] = true, _a);
235
238
  }
236
239
  _this.state = {
237
240
  activeLegend: '',
238
241
  isHoverCardVisible: false,
239
- selectedLegends: defaultSelectedLegends,
242
+ selectedLegends: selectedLegendsState,
240
243
  };
241
244
  return _this;
242
245
  }
246
+ LegendsBase.getDerivedStateFromProps = function (newProps, prevState) {
247
+ var _a;
248
+ var selectedLegend = newProps.selectedLegend, selectedLegends = newProps.selectedLegends;
249
+ if (newProps.canSelectMultipleLegends && selectedLegends !== undefined) {
250
+ return tslib_1.__assign(tslib_1.__assign({}, prevState), { selectedLegends: selectedLegends.reduce(
251
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
252
+ function (combinedDict, key) {
253
+ var _a;
254
+ return (tslib_1.__assign((_a = {}, _a[key] = true, _a), combinedDict));
255
+ }, {}) });
256
+ }
257
+ if (!newProps.canSelectMultipleLegends && selectedLegend !== undefined) {
258
+ return tslib_1.__assign(tslib_1.__assign({}, prevState), { selectedLegends: (_a = {}, _a[selectedLegend] = true, _a) });
259
+ }
260
+ return prevState;
261
+ };
243
262
  LegendsBase.prototype.render = function () {
244
263
  var _a = this.props, theme = _a.theme, className = _a.className, styles = _a.styles;
245
264
  this._classNames = getClassNames(styles, {
@@ -1 +1 @@
1
- {"version":3,"file":"Legends.base.js","sourceRoot":"../src/","sources":["components/Legends/Legends.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,2DAA8F;AAC9F,2DAA2G;AAC3G,+DAA8D;AAE9D,+DAAqF;AACrF,qDAAiG;AASjG,iCAAgC;AAEhC,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAqC,CAAC;AAuB9E;IAAiC,uCAA4C;IAM3E,qBAAmB,KAAoB;;;QAAvC,YACE,kBAAM,KAAK,CAAC,SAcb;QAlBD,oEAAoE;QAC5D,uBAAiB,GAAG,KAAK,CAAC;QAyE1B,mBAAa,GAAG,UAAC,IAAiD;YAClE,IAAA,KAAkF,KAAI,CAAC,KAAK,EAA1F,aAAa,mBAAA,EAAE,2BAA0B,EAA1B,mBAAmB,mBAAG,IAAI,KAAA,EAAE,gCAAgC,EAAhC,wBAAwB,mBAAG,KAAK,KAAe,CAAC;YACnG,IAAM,UAAU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C,KAAK,CAAC,YAAY,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,EAAE;gBACvE,WAAW,GAAG,KAAK,CAAC;aACrB;YACD,mEAAmE;iBAC9D;gBACH,WAAW,GAAG,KAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;aACtD;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AA9YD,CAAiC,KAAK,CAAC,SAAS,GA8Y/C;AA9YY,kCAAW","sourcesContent":["import * as React from 'react';\n\nimport { IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu';\nimport { HoverCard, HoverCardType, IExpandingCardProps } from '@fluentui/react/lib/HoverCard';\nimport { classNamesFunction, find, getNativeProps, buttonProperties } from '@fluentui/react/lib/Utilities';\nimport { ResizeGroup } from '@fluentui/react/lib/ResizeGroup';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { OverflowSet, IOverflowSetItemProps } from '@fluentui/react/lib/OverflowSet';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport {\n ILegend,\n ILegendsProps,\n LegendShape,\n ILegendsStyles,\n ILegendStyleProps,\n ILegendOverflowData,\n} from './Legends.types';\nimport { Shape } from './shape';\n\nconst getClassNames = classNamesFunction<ILegendStyleProps, ILegendsStyles>();\n\n// This is an internal interface used for rendering the legends with unique key\ninterface ILegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\nexport interface ILegendState {\n activeLegend: string;\n isHoverCardVisible: boolean;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: { [key: string]: boolean };\n}\nexport class LegendsBase extends React.Component<ILegendsProps, ILegendState> {\n private _hoverCardRef: HTMLDivElement;\n private _classNames: IProcessedStyleSet<ILegendsStyles>;\n /** Boolean variable to check if one or more legends are selected */\n private _isLegendSelected = false;\n\n public constructor(props: ILegendsProps) {\n super(props);\n let defaultSelectedLegends = {};\n if (props.canSelectMultipleLegends) {\n defaultSelectedLegends =\n props.defaultSelectedLegends?.reduce((combinedDict, key) => ({ [key]: true, ...combinedDict }), {}) || {};\n } else if (props.defaultSelectedLegend) {\n defaultSelectedLegends = { [props.defaultSelectedLegend]: true };\n }\n\n this.state = {\n activeLegend: '',\n isHoverCardVisible: false,\n selectedLegends: defaultSelectedLegends,\n };\n }\n\n public render(): JSX.Element {\n const { theme, className, styles } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n this._isLegendSelected = Object.keys(this.state.selectedLegends).length > 0;\n const dataToRender = this._generateData();\n return (\n <div className={this._classNames.root}>\n {this.props.enabledWrapLines ? (\n this._onRenderData(dataToRender)\n ) : (\n <ResizeGroup\n data={dataToRender}\n onReduceData={this._onReduceData}\n onRenderData={this._onRenderData}\n onGrowData={this._onGrowData}\n />\n )}\n </div>\n );\n }\n\n private _generateData(): ILegendOverflowData {\n const { allowFocusOnLegends = true, shape } = this.props;\n const dataItems: ILegendItem[] = this.props.legends.map((legend: ILegend, index: number) => {\n return {\n ...(allowFocusOnLegends && {\n nativeButtonProps: getNativeProps<React.HTMLAttributes<HTMLButtonElement>>(legend, buttonProperties, [\n 'title',\n ]),\n 'aria-setsize': this.props.legends.length,\n 'aria-posinset': index + 1,\n }),\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n const result: ILegendOverflowData = {\n primary: dataItems,\n overflow: [],\n };\n return result;\n }\n\n private _onRenderData = (data: IOverflowSetItemProps | ILegendOverflowData): JSX.Element => {\n const { overflowProps, allowFocusOnLegends = true, canSelectMultipleLegends = false } = this.props;\n const rootStyles = {\n root: {\n justifyContent: this.props.centerLegends ? 'center' : 'unset',\n flexWrap: 'wrap',\n },\n };\n return (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n >\n <OverflowSet\n items={data.primary}\n overflowItems={data.overflow}\n onRenderItem={this._renderButton}\n onRenderOverflowButton={this._renderOverflowItems}\n {...overflowProps}\n styles={{ ...rootStyles, ...overflowProps?.styles }}\n />\n </FocusZone>\n );\n };\n\n private _onReduceData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.primary.length === 0) {\n return;\n }\n const overflow = [...currentdata.primary.slice(-1), ...currentdata.overflow];\n const primary = currentdata.primary.slice(0, -1);\n return { primary, overflow };\n };\n\n private _onGrowData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.overflow.length === 0) {\n return;\n }\n const overflow = currentdata.overflow.slice(1);\n const primary = [...currentdata.primary, ...currentdata.overflow.slice(0, 1)];\n return { primary, overflow };\n };\n\n /**\n * This function will get called when there is an ability to\n * select multiple legends\n * @param legend ILegend\n */\n private _canSelectMultipleLegends = (legend: ILegend): { [key: string]: boolean } => {\n let selectedLegends = { ...this.state.selectedLegends };\n if (selectedLegends[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete selectedLegends[legend.title];\n } else {\n selectedLegends[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(selectedLegends).length === this.props.legends.length) {\n selectedLegends = {};\n }\n }\n this.setState({ selectedLegends });\n return selectedLegends;\n };\n\n /**\n * This function will get called when there is\n * ability to select only single legend\n * @param legend ILegend\n */\n\n private _canSelectOnlySingleLegend = (legend: ILegend): boolean => {\n if (this.state.selectedLegends[legend.title]) {\n this.setState({ selectedLegends: {} });\n return false;\n } else {\n this.setState({ selectedLegends: { [legend.title]: true } });\n return true;\n }\n };\n\n private _onClick = (legend: ILegend, event: React.MouseEvent<HTMLButtonElement>): void => {\n const { canSelectMultipleLegends = false } = this.props;\n let selectedLegends: string[] = [];\n if (canSelectMultipleLegends) {\n const nextSelectedLegends = this._canSelectMultipleLegends(legend);\n selectedLegends = Object.keys(nextSelectedLegends);\n } else {\n const isSelected = this._canSelectOnlySingleLegend(legend);\n selectedLegends = isSelected ? [legend.title] : [];\n }\n this.props.onChange?.(selectedLegends, event, legend);\n legend.action?.();\n };\n\n private _onRenderCompactCard = (expandingCard: IExpandingCardProps): JSX.Element => {\n const { allowFocusOnLegends = true, className, styles, theme, canSelectMultipleLegends = false } = this.props;\n const overflowHoverCardLegends: JSX.Element[] = [];\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n expandingCard.renderData.forEach((legend: IOverflowSetItemProps, index: number) => {\n const hoverCardElement = this._renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const hoverCardData = (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n direction={FocusZoneDirection.vertical}\n handleTabKey={FocusZoneTabbableElements.all}\n isCircularNavigation={true}\n {...this.props.focusZonePropsInHoverCard}\n className={classNames.hoverCardRoot}\n >\n {overflowHoverCardLegends}\n </FocusZone>\n );\n return hoverCardData;\n };\n\n private _renderOverflowItems = (legends: ILegend[]) => {\n const { allowFocusOnLegends = true } = this.props;\n const items: IContextualMenuItem[] = [];\n legends.forEach((legend: ILegend, i: number) => {\n items.push({ key: i.toString(), name: legend.title, onClick: legend.action });\n });\n const renderOverflowData: IExpandingCardProps = { renderData: legends };\n const { theme, className, styles, overflowText } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const plainCardProps = {\n onRenderPlainCard: this._onRenderCompactCard,\n renderData: renderOverflowData,\n };\n\n const overflowString = overflowText ? overflowText : 'more';\n // execute similar to \"_onClick\" and \"_onLeave\" logic at HoverCard onCardHide event\n const onHoverCardHideHandler = () => {\n this.setState({ isHoverCardVisible: false });\n // Unhighlight the focused legend in the hover card\n const activeOverflowItem = find(legends, (legend: ILegend) => legend.title === this.state.activeLegend);\n if (activeOverflowItem) {\n this.setState({ activeLegend: '' });\n if (activeOverflowItem.onMouseOutAction) {\n activeOverflowItem.onMouseOutAction();\n }\n }\n };\n return (\n <HoverCard\n type={HoverCardType.plain}\n plainCardProps={plainCardProps}\n instantOpenOnClick={true}\n // eslint-disable-next-line react/jsx-no-bind\n onCardHide={onHoverCardHideHandler}\n setInitialFocus={true}\n trapFocus={true}\n onCardVisible={this._hoverCardVisible}\n styles={classNames.subComponentStyles.hoverCardStyles}\n cardDismissDelay={300}\n target={this._hoverCardRef}\n >\n {/* \"button\" role is not allowed as a child of parent role \"listbox\" */}\n <div role=\"option\">\n <div\n className={classNames.overflowIndicationTextStyle}\n ref={(rootElem: HTMLDivElement) => (this._hoverCardRef = rootElem)}\n {...(allowFocusOnLegends && {\n role: 'button',\n 'aria-expanded': this.state.isHoverCardVisible,\n 'aria-label': `${items.length} ${overflowString}`,\n })}\n data-is-focusable={allowFocusOnLegends}\n >\n {items.length} {overflowString}\n </div>\n </div>\n </HoverCard>\n );\n };\n\n private _hoverCardVisible = () => {\n this.setState({ isHoverCardVisible: true });\n };\n\n private _onHoverOverLegend = (legend: ILegend) => {\n if (legend.hoverAction) {\n this.setState({ activeLegend: legend.title });\n legend.hoverAction();\n }\n };\n\n private _onLeave = (legend: ILegend) => {\n if (legend.onMouseOutAction) {\n this.setState({ activeLegend: '' });\n legend.onMouseOutAction();\n }\n };\n\n private _renderButton = (data: IOverflowSetItemProps, index?: number, overflow?: boolean) => {\n const { allowFocusOnLegends = true } = this.props;\n const legend: ILegend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = this._getColor(legend.title, legend.color);\n const { theme, className, styles } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n colorOnSelectedState: color,\n borderColor: legend.color,\n overflow,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n });\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n this._onClick(legend, event);\n };\n const onHoverHandler = () => {\n this._onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n this._onLeave(legend);\n };\n const shape = this._getShape(classNames, legend, color);\n return (\n <button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!this.state.selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classNames.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n data-is-focusable={allowFocusOnLegends}\n /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classNames.text}>{legend.title}</div>\n </button>\n );\n };\n\n private _getShape(\n classNames: IProcessedStyleSet<ILegendsStyles>,\n legend: ILegend,\n color: string,\n ): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classNames.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classNames.rect}\n />\n );\n }\n\n private _getColor(title: string, color: string): string {\n const { theme } = this.props;\n let legendColor = color;\n // if one or more legends are selected\n if (this._isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (this.state.selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = theme!.semanticColors.buttonBackground;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (this.state.activeLegend === title || this.state.activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = theme!.semanticColors.buttonBackground;\n }\n }\n return legendColor;\n }\n}\n"]}
1
+ {"version":3,"file":"Legends.base.js","sourceRoot":"../src/","sources":["components/Legends/Legends.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,2DAA8F;AAC9F,2DAA2G;AAC3G,+DAA8D;AAE9D,+DAAqF;AACrF,qDAAiG;AASjG,iCAAgC;AAEhC,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAqC,CAAC;AAuB9E;IAAiC,uCAA4C;IA8B3E,qBAAmB,KAAoB;;;QAAvC,YACE,kBAAM,KAAK,CAAC,SAsBb;QAlDD,oEAAoE;QAC5D,uBAAiB,GAAG,KAAK,CAAC;QAyG1B,mBAAa,GAAG,UAAC,IAAiD;YAClE,IAAA,KAAkF,KAAI,CAAC,KAAK,EAA1F,aAAa,mBAAA,EAAE,2BAA0B,EAA1B,mBAAmB,mBAAG,IAAI,KAAA,EAAE,gCAAgC,EAAhC,wBAAwB,mBAAG,KAAK,KAAe,CAAC;YACnG,IAAM,UAAU,GAAG;gBACjB,IAAI,EAAE;oBACJ,cAAc,EAAE,KAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;oBAC7D,QAAQ,EAAE,MAAM;iBACjB;aACF,CAAC;YACF,OAAO,CACL,oBAAC,uBAAS,uBACJ,CAAC,mBAAmB,IAAI;gBAC1B,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;gBACvB,sBAAsB,EAAE,wBAAwB;aACjD,CAAC;gBAEF,oBAAC,yBAAW,qBACV,KAAK,EAAE,IAAI,CAAC,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W,GAAG,KAAK,CAAC;QACxB,sCAAsC;QACtC,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,6DAA6D;YAC7D,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;gBACrC,WAAW,GAAG,KAAK,CAAC;aACrB;YACD,oCAAoC;iBAC/B;gBACH,WAAW,GAAG,KAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;aACtD;SACF;QACD,2BAA2B;aACtB;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,EAAE;gBACvE,WAAW,GAAG,KAAK,CAAC;aACrB;YACD,mEAAmE;iBAC9D;gBACH,WAAW,GAAG,KAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;aACtD;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AAhbD,CAAiC,KAAK,CAAC,SAAS,GAgb/C;AAhbY,kCAAW","sourcesContent":["import * as React from 'react';\n\nimport { IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu';\nimport { HoverCard, HoverCardType, IExpandingCardProps } from '@fluentui/react/lib/HoverCard';\nimport { classNamesFunction, find, getNativeProps, buttonProperties } from '@fluentui/react/lib/Utilities';\nimport { ResizeGroup } from '@fluentui/react/lib/ResizeGroup';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { OverflowSet, IOverflowSetItemProps } from '@fluentui/react/lib/OverflowSet';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport {\n ILegend,\n ILegendsProps,\n LegendShape,\n ILegendsStyles,\n ILegendStyleProps,\n ILegendOverflowData,\n} from './Legends.types';\nimport { Shape } from './shape';\n\nconst getClassNames = classNamesFunction<ILegendStyleProps, ILegendsStyles>();\n\n// This is an internal interface used for rendering the legends with unique key\ninterface ILegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\nexport interface ILegendState {\n activeLegend: string;\n isHoverCardVisible: boolean;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: { [key: string]: boolean };\n}\nexport class LegendsBase extends React.Component<ILegendsProps, ILegendState> {\n private _hoverCardRef: HTMLDivElement;\n private _classNames: IProcessedStyleSet<ILegendsStyles>;\n /** Boolean variable to check if one or more legends are selected */\n private _isLegendSelected = false;\n\n public static getDerivedStateFromProps(newProps: ILegendsProps, prevState: ILegendState): ILegendState {\n const { selectedLegend, selectedLegends } = newProps;\n\n if (newProps.canSelectMultipleLegends && selectedLegends !== undefined) {\n return {\n ...prevState,\n selectedLegends: selectedLegends.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combinedDict: any, key: any) => ({ [key]: true, ...combinedDict }),\n {},\n ),\n };\n }\n\n if (!newProps.canSelectMultipleLegends && selectedLegend !== undefined) {\n return {\n ...prevState,\n selectedLegends: { [selectedLegend]: true },\n };\n }\n\n return prevState;\n }\n\n public constructor(props: ILegendsProps) {\n super(props);\n //let defaultSelectedLegends = {};\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n } else if (initialSelectedLegend) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n }\n\n this.state = {\n activeLegend: '',\n isHoverCardVisible: false,\n selectedLegends: selectedLegendsState,\n };\n }\n\n public render(): JSX.Element {\n const { theme, className, styles } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n this._isLegendSelected = Object.keys(this.state.selectedLegends).length > 0;\n const dataToRender = this._generateData();\n return (\n <div className={this._classNames.root}>\n {this.props.enabledWrapLines ? (\n this._onRenderData(dataToRender)\n ) : (\n <ResizeGroup\n data={dataToRender}\n onReduceData={this._onReduceData}\n onRenderData={this._onRenderData}\n onGrowData={this._onGrowData}\n />\n )}\n </div>\n );\n }\n\n private _generateData(): ILegendOverflowData {\n const { allowFocusOnLegends = true, shape } = this.props;\n const dataItems: ILegendItem[] = this.props.legends.map((legend: ILegend, index: number) => {\n return {\n ...(allowFocusOnLegends && {\n nativeButtonProps: getNativeProps<React.HTMLAttributes<HTMLButtonElement>>(legend, buttonProperties, [\n 'title',\n ]),\n 'aria-setsize': this.props.legends.length,\n 'aria-posinset': index + 1,\n }),\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n const result: ILegendOverflowData = {\n primary: dataItems,\n overflow: [],\n };\n return result;\n }\n\n private _onRenderData = (data: IOverflowSetItemProps | ILegendOverflowData): JSX.Element => {\n const { overflowProps, allowFocusOnLegends = true, canSelectMultipleLegends = false } = this.props;\n const rootStyles = {\n root: {\n justifyContent: this.props.centerLegends ? 'center' : 'unset',\n flexWrap: 'wrap',\n },\n };\n return (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n >\n <OverflowSet\n items={data.primary}\n overflowItems={data.overflow}\n onRenderItem={this._renderButton}\n onRenderOverflowButton={this._renderOverflowItems}\n {...overflowProps}\n styles={{ ...rootStyles, ...overflowProps?.styles }}\n />\n </FocusZone>\n );\n };\n\n private _onReduceData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.primary.length === 0) {\n return;\n }\n const overflow = [...currentdata.primary.slice(-1), ...currentdata.overflow];\n const primary = currentdata.primary.slice(0, -1);\n return { primary, overflow };\n };\n\n private _onGrowData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.overflow.length === 0) {\n return;\n }\n const overflow = currentdata.overflow.slice(1);\n const primary = [...currentdata.primary, ...currentdata.overflow.slice(0, 1)];\n return { primary, overflow };\n };\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n private _isInControlledMode = (): boolean => {\n return this.props.canSelectMultipleLegends\n ? this.props.selectedLegends !== undefined\n : this.props.selectedLegend !== undefined;\n };\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n private _getNewSelectedLegendsForMultiselect = (legend: ILegend): { [key: string]: boolean } => {\n let selectedLegends = { ...this.state.selectedLegends };\n if (selectedLegends[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete selectedLegends[legend.title];\n } else {\n selectedLegends[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(selectedLegends).length === this.props.legends.length) {\n selectedLegends = {};\n }\n }\n return selectedLegends;\n };\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n\n private _getNewSelectedLegendsForSingleSelect = (legend: ILegend): { [key: string]: boolean } => {\n return this.state.selectedLegends[legend.title] ? {} : { [legend.title]: true };\n };\n\n private _onClick = (legend: ILegend, event: React.MouseEvent<HTMLButtonElement>): void => {\n const { canSelectMultipleLegends = false } = this.props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? this._getNewSelectedLegendsForMultiselect(legend)\n : this._getNewSelectedLegendsForSingleSelect(legend);\n\n if (!this._isInControlledMode()) {\n this.setState({ selectedLegends: nextSelectedLegends });\n }\n this.props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n };\n\n private _onRenderCompactCard = (expandingCard: IExpandingCardProps): JSX.Element => {\n const { allowFocusOnLegends = true, className, styles, theme, canSelectMultipleLegends = false } = this.props;\n const overflowHoverCardLegends: JSX.Element[] = [];\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n expandingCard.renderData.forEach((legend: IOverflowSetItemProps, index: number) => {\n const hoverCardElement = this._renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const hoverCardData = (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n direction={FocusZoneDirection.vertical}\n handleTabKey={FocusZoneTabbableElements.all}\n isCircularNavigation={true}\n {...this.props.focusZonePropsInHoverCard}\n className={classNames.hoverCardRoot}\n >\n {overflowHoverCardLegends}\n </FocusZone>\n );\n return hoverCardData;\n };\n\n private _renderOverflowItems = (legends: ILegend[]) => {\n const { allowFocusOnLegends = true } = this.props;\n const items: IContextualMenuItem[] = [];\n legends.forEach((legend: ILegend, i: number) => {\n items.push({ key: i.toString(), name: legend.title, onClick: legend.action });\n });\n const renderOverflowData: IExpandingCardProps = { renderData: legends };\n const { theme, className, styles, overflowText } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const plainCardProps = {\n onRenderPlainCard: this._onRenderCompactCard,\n renderData: renderOverflowData,\n };\n\n const overflowString = overflowText ? overflowText : 'more';\n // execute similar to \"_onClick\" and \"_onLeave\" logic at HoverCard onCardHide event\n const onHoverCardHideHandler = () => {\n this.setState({ isHoverCardVisible: false });\n // Unhighlight the focused legend in the hover card\n const activeOverflowItem = find(legends, (legend: ILegend) => legend.title === this.state.activeLegend);\n if (activeOverflowItem) {\n this.setState({ activeLegend: '' });\n if (activeOverflowItem.onMouseOutAction) {\n activeOverflowItem.onMouseOutAction();\n }\n }\n };\n return (\n <HoverCard\n type={HoverCardType.plain}\n plainCardProps={plainCardProps}\n instantOpenOnClick={true}\n // eslint-disable-next-line react/jsx-no-bind\n onCardHide={onHoverCardHideHandler}\n setInitialFocus={true}\n trapFocus={true}\n onCardVisible={this._hoverCardVisible}\n styles={classNames.subComponentStyles.hoverCardStyles}\n cardDismissDelay={300}\n target={this._hoverCardRef}\n >\n {/* \"button\" role is not allowed as a child of parent role \"listbox\" */}\n <div role=\"option\">\n <div\n className={classNames.overflowIndicationTextStyle}\n ref={(rootElem: HTMLDivElement) => (this._hoverCardRef = rootElem)}\n {...(allowFocusOnLegends && {\n role: 'button',\n 'aria-expanded': this.state.isHoverCardVisible,\n 'aria-label': `${items.length} ${overflowString}`,\n })}\n data-is-focusable={allowFocusOnLegends}\n >\n {items.length} {overflowString}\n </div>\n </div>\n </HoverCard>\n );\n };\n\n private _hoverCardVisible = () => {\n this.setState({ isHoverCardVisible: true });\n };\n\n private _onHoverOverLegend = (legend: ILegend) => {\n if (legend.hoverAction) {\n this.setState({ activeLegend: legend.title });\n legend.hoverAction();\n }\n };\n\n private _onLeave = (legend: ILegend) => {\n if (legend.onMouseOutAction) {\n this.setState({ activeLegend: '' });\n legend.onMouseOutAction();\n }\n };\n\n private _renderButton = (data: IOverflowSetItemProps, index?: number, overflow?: boolean) => {\n const { allowFocusOnLegends = true } = this.props;\n const legend: ILegend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = this._getColor(legend.title, legend.color);\n const { theme, className, styles } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n colorOnSelectedState: color,\n borderColor: legend.color,\n overflow,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n });\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n this._onClick(legend, event);\n };\n const onHoverHandler = () => {\n this._onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n this._onLeave(legend);\n };\n const shape = this._getShape(classNames, legend, color);\n return (\n <button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!this.state.selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classNames.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n data-is-focusable={allowFocusOnLegends}\n /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classNames.text}>{legend.title}</div>\n </button>\n );\n };\n\n private _getShape(\n classNames: IProcessedStyleSet<ILegendsStyles>,\n legend: ILegend,\n color: string,\n ): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classNames.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classNames.rect}\n />\n );\n }\n\n private _getColor(title: string, color: string): string {\n const { theme } = this.props;\n let legendColor = color;\n // if one or more legends are selected\n if (this._isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (this.state.selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = theme!.semanticColors.buttonBackground;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (this.state.activeLegend === title || this.state.activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = theme!.semanticColors.buttonBackground;\n }\n }\n return legendColor;\n }\n}\n"]}
@@ -185,16 +185,51 @@ export interface ILegendsProps {
185
185
  */
186
186
  onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend) => void;
187
187
  /**
188
- * Keys (title) that will be initially used to set selected items.
189
- * This prop is used for multiSelect scenarios.
190
- * In other cases, defaultSelectedLegend should be used.
188
+ * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when
189
+ * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.
190
+ *
191
+ * Updating this prop does not change the selection after the component has been initialized. For controlled
192
+ * selections, use selectedLegends instead.
193
+ *
194
+ * @see selectedLegends for setting the selected legends in controlled mode.
195
+ * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.
191
196
  */
192
197
  defaultSelectedLegends?: string[];
193
198
  /**
194
- * Key that will be initially used to set selected item.
195
- * This prop is used for singleSelect scenarios.
199
+ * Key that will be initially used to set selected item. This prop is used for single-select scenarios when
200
+ * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.
201
+ *
202
+ * Updating this prop does not change the selection after the component has been initialized. For controlled
203
+ * selections, use selectedLegend instead.
204
+ *
205
+ * @see selectedLegend for setting the selected legend in controlled mode.
206
+ * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.
196
207
  */
197
208
  defaultSelectedLegend?: string;
209
+ /**
210
+ * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is
211
+ * true. For single-select, use selectedLegend.
212
+ *
213
+ * When this prop is provided, the component is controlled and does not automatically update the selection based on
214
+ * user interactions; the parent component must update the value passed to this property by handling the onChange
215
+ * event.
216
+ *
217
+ * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.
218
+ * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.
219
+ */
220
+ selectedLegends?: string[];
221
+ /**
222
+ * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is
223
+ * false or unspecified. For multi-select, use selectedLegends.
224
+ *
225
+ * When this prop is provided, the component is controlled and does not automatically update the selection based on
226
+ * user interactions; the parent component must update the value passed to this property by handling the onChange
227
+ * event.
228
+ *
229
+ * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.
230
+ * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.
231
+ */
232
+ selectedLegend?: string;
198
233
  /**
199
234
  * The shape for the legend.
200
235
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Legends.types.js","sourceRoot":"../src/","sources":["components/Legends/Legends.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IHoverCardStyleProps, IHoverCardStyles } from '@fluentui/react/lib/HoverCard';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\nexport interface ILegendOverflowData {\n primary: ILegend[];\n\n overflow?: ILegend[];\n}\n\n/**\n * @public\n * {@docCategory Legends}\n */\nexport interface ILegendSubComponentStyles {\n hoverCardStyles: IStyleFunctionOrObject<IHoverCardStyleProps, IHoverCardStyles>;\n}\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface ILegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root: IStyle;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend: IStyle;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect: IStyle;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape: IStyle;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle: IStyle;\n\n /**\n * Style for the legend text\n */\n text: IStyle;\n\n /**\n * Style for the legend text\n */\n hoverChange: IStyle;\n\n /**\n * Style for the text that indicates the no.of legends that are in hovercard due to lack of space\n */\n overflowIndicationTextStyle: IStyle;\n\n /**\n * Style for the overflow container\n */\n hoverCardRoot: IStyle;\n\n /**\n * sub component styles\n */\n subComponentStyles: ILegendSubComponentStyles;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface ILegend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface ILegendStyleProps {\n theme?: ITheme;\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface ILegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: ILegend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ILegendStyleProps, ILegendsStyles>;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * props for the overflow set component\n */\n overflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * focus zone props in hover card\n */\n focusZonePropsInHoverCard?: IFocusZoneProps;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Defines the function that is executed upon hiding of hover card\n * make sure to send prop when the prop is canSelectMultipleLegends is set to true\n * and empty the selected state legends\n */\n onLegendHoverCardLeave?: VoidFunction;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items.\n * This prop is used for multiSelect scenarios.\n * In other cases, defaultSelectedLegend should be used.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item.\n * This prop is used for singleSelect scenarios.\n */\n defaultSelectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n"]}
1
+ {"version":3,"file":"Legends.types.js","sourceRoot":"../src/","sources":["components/Legends/Legends.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IHoverCardStyleProps, IHoverCardStyles } from '@fluentui/react/lib/HoverCard';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\nexport interface ILegendOverflowData {\n primary: ILegend[];\n\n overflow?: ILegend[];\n}\n\n/**\n * @public\n * {@docCategory Legends}\n */\nexport interface ILegendSubComponentStyles {\n hoverCardStyles: IStyleFunctionOrObject<IHoverCardStyleProps, IHoverCardStyles>;\n}\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface ILegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root: IStyle;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend: IStyle;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect: IStyle;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape: IStyle;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle: IStyle;\n\n /**\n * Style for the legend text\n */\n text: IStyle;\n\n /**\n * Style for the legend text\n */\n hoverChange: IStyle;\n\n /**\n * Style for the text that indicates the no.of legends that are in hovercard due to lack of space\n */\n overflowIndicationTextStyle: IStyle;\n\n /**\n * Style for the overflow container\n */\n hoverCardRoot: IStyle;\n\n /**\n * sub component styles\n */\n subComponentStyles: ILegendSubComponentStyles;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface ILegend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface ILegendStyleProps {\n theme?: ITheme;\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface ILegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: ILegend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ILegendStyleProps, ILegendsStyles>;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * props for the overflow set component\n */\n overflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * focus zone props in hover card\n */\n focusZonePropsInHoverCard?: IFocusZoneProps;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Defines the function that is executed upon hiding of hover card\n * make sure to send prop when the prop is canSelectMultipleLegends is set to true\n * and empty the selected state legends\n */\n onLegendHoverCardLeave?: VoidFunction;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-charting",
3
- "version": "5.23.22",
3
+ "version": "5.23.23",
4
4
  "description": "React web charting controls for Microsoft fluentui system.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluentui/react-focus": "^8.9.18",
43
- "@fluentui/theme-samples": "^8.7.188",
43
+ "@fluentui/theme-samples": "^8.7.189",
44
44
  "@microsoft/load-themed-styles": "^1.10.26",
45
45
  "@types/d3-array": "^3.0.0",
46
46
  "@types/d3-axis": "^3.0.0",
@@ -66,7 +66,7 @@
66
66
  "tslib": "^2.1.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@fluentui/react": "^8.121.13",
69
+ "@fluentui/react": "^8.122.0",
70
70
  "@types/react": ">=16.8.0 <19.0.0",
71
71
  "@types/react-dom": ">=16.8.0 <19.0.0",
72
72
  "react": ">=16.8.0 <19.0.0",