@fluentui/react-charting 5.24.22 → 5.24.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +37 -1
- package/CHANGELOG.md +21 -2
- package/dist/react-charting.d.ts +6 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +3 -2
- package/lib/components/CommonComponents/CartesianChart.base.js +1 -0
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +2 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +2 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.d.ts +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.styles.js +1 -8
- package/lib/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +66 -13
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/utilities/utilities.d.ts +10 -10
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +2 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +4 -3
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/FunnelChart/funnelGeometry.js +5 -6
- package/lib-amd/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js +1 -8
- package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-amd/components/ResponsiveContainer/withResponsiveContainer.js +1 -2
- package/lib-amd/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -4
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +64 -11
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +2 -3
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/scatterpolar-utils.js +2 -3
- package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +10 -10
- package/lib-amd/utilities/utilities.js +39 -39
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +4 -3
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +5 -6
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.styles.js +1 -8
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +1 -2
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -4
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +64 -11
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +2 -3
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +2 -3
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +10 -10
- package/lib-commonjs/utilities/utilities.js +39 -40
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
- package/src/components/HeatMapChart/HeatMapChart.types.ts +2 -2
- package/src/components/ScatterChart/ScatterChart.types.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";;;;IAgDA,IAAM,aAAa,GAAG,IAAA,0BAAkB,GAAgD,CAAC;IAEzF,8FAA8F;IAC9F;;;OAGG;IACU,QAAA,gBAAgB,GAAgD,KAAK,CAAC,UAAU,CAG3F,UAAC,KAAK,EAAE,YAAY;;QACpB,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,QAAQ,CAAC,EAAf,CAAe,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAM,SAAS,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,UAAU,CAAC,EAAjB,CAAiB,EAAE,EAAE,CAAC,CAAC;QACrE,IAAM,aAAa,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,cAAc,CAAC,EAArB,CAAqB,EAAE,EAAE,CAAC,CAAC;QAC7E,IAAM,UAAU,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,wBAAwB,CAAC,EAA/B,CAA+B,EAAE,EAAE,CAAC,CAAC;QACpF,IAAM,wBAAwB,GAAG,IAAI,CAAC;QACtC,IAAM,aAAa,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,qBAAqB,CAAC,EAA5B,CAA4B,EAAE,EAAE,CAAC,CAAC;QACpF,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAC1B,sCAAsC,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CACpE,CAAC;QACF,8DAA8D;QAC9D,IAAI,cAAc,GA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E,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;wBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;YACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n getDomainPaddingForMarkers,\n isScatterPolarSeries,\n isTextMode,\n YAxisType,\n isPlottable,\n getRangeForScatterMarkerSize,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfNumericForAreaLineScatterCharts,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { ILineChartPoints } from '../../types/IDataPoint';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n const _isScatterPolarRef = React.useRef(false);\n const _isTextMode = React.useRef(false);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForAreaLineScatterCharts(\n points,\n domainMargins,\n width,\n isRTL,\n props.xScaleType,\n true,\n );\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n domainMargins,\n width,\n isRTL,\n tickValues! as Date[],\n _chartType,\n );\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [props.xScaleType],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n const _legendHighlighted = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n const _createPlot = React.useCallback(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis\n ? getRangeForScatterMarkerSize({\n data: _points.current,\n xScale: _xAxisScale.current,\n yScalePrimary: _yAxisScale.current,\n xScaleType: props.xScaleType,\n yScaleType: props.yScaleType,\n })\n : 0;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const xPoint = _xAxisScale.current?.(x);\n const yPoint = _yAxisScale.current?.(y);\n if (!isPlottable(xPoint, yPoint)) {\n continue;\n }\n\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n if (!_isTextMode.current) {\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={xPoint + _xBandwidth.current}\n cy={yPoint}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n </>,\n );\n }\n if (_isTextMode && text) {\n pointsForSeries.push(\n <text\n key={`${circleId}-label`}\n x={xPoint + _xBandwidth.current}\n y={yPoint + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>,\n );\n }\n }\n\n if (_isScatterPolarRef.current) {\n pointsForSeries.push(\n ...renderScatterPolarCategoryLabels({\n xAxisScale: _xAxisScale.current,\n yAxisScale: _yAxisScale.current,\n className: classNames.markerLabel || '',\n lineOptions: (_points.current?.[i] as Partial<ILineChartPoints>)?.lineOptions,\n }),\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n props.xScaleType,\n props.yScaleType,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n _isScatterPolarRef.current = isScatterPolarSeries(_points.current);\n _isTextMode.current = isTextMode(_points.current);\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n const _getNumericMinMaxOfY = React.useCallback(\n (points: IScatterChartPoints[], yAxisType?: YAxisType): { startValue: number; endValue: number } => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType, undefined, props.yScaleType);\n const yPadding = getDomainPaddingForMarkers(startValue, endValue, props.yScaleType);\n\n return {\n startValue: startValue - yPadding.start,\n endValue: endValue + yPadding.end,\n };\n },\n [props.yScaleType],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend && !_isTextMode.current) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getNumericMinMaxOfY}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n {...(_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {})}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
1
|
+
{"version":3,"file":"Sc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ACtC,kDAAkD;YAClD,QAAQ,EAAE,UAAC,UAAuB;gBAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;gBACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;gBAChD,OAAO,CACL;oBACE;wBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;wBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;YACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n getDomainPaddingForMarkers,\n isScatterPolarSeries,\n isTextMode,\n YAxisType,\n isPlottable,\n getRangeForScatterMarkerSize,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfNumericForAreaLineScatterCharts,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { ILineChartPoints } from '../../types/IDataPoint';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n const _isScatterPolarRef = React.useRef(false);\n const _isTextMode = React.useRef(false);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n // Detect y axis type (numeric or string)\n const _yAxisType: YAxisType =\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData[0].data &&\n props.data.scatterChartData[0].data.length > 0\n ? typeof props.data.scatterChartData[0].data[0].y === 'string'\n ? YAxisType.StringAxis\n : YAxisType.NumericAxis\n : YAxisType.NumericAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _getOrderedYAxisLabels() {\n const shouldOrderYAxisLabelsByCategoryOrder =\n _yAxisType === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n if (!shouldOrderYAxisLabelsByCategoryOrder) {\n // Collect all unique string y values from all data points in all series, in reverse order\n const yLabelsSet = new Set<string>();\n for (let i = _points.current.length - 1; i >= 0; i--) {\n const point = _points.current[i];\n if (point.data && Array.isArray(point.data)) {\n for (const d of point.data) {\n if (typeof d.y === 'string') {\n yLabelsSet.add(d.y);\n }\n }\n }\n }\n return Array.from(yLabelsSet);\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.yAxisCategoryOrder);\n }\n\n function _mapCategoryToValues() {\n const categoryToValues: Record<string, number[]> = {};\n _points.current.forEach(point => {\n if (point.data && Array.isArray(point.data)) {\n point.data.forEach(d => {\n if (typeof d.y === 'string') {\n if (!categoryToValues[d.y]) {\n categoryToValues[d.y] = [];\n }\n if (typeof d.x === 'number') {\n categoryToValues[d.y].push(d.x);\n }\n }\n });\n }\n });\n return categoryToValues;\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForAreaLineScatterCharts(\n points,\n domainMargins,\n width,\n isRTL,\n props.xScaleType,\n true,\n );\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n domainMargins,\n width,\n isRTL,\n tickValues! as Date[],\n _chartType,\n );\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [props.xScaleType],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n const _legendHighlighted = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n const _createPlot = React.useCallback(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis && _yAxisType !== YAxisType.StringAxis\n ? getRangeForScatterMarkerSize({\n data: _points.current,\n xScale: _xAxisScale.current,\n yScalePrimary: _yAxisScale.current,\n xScaleType: props.xScaleType,\n yScaleType: props.yScaleType,\n })\n : 0;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const xPoint = _xAxisScale.current?.(x);\n // Use string y axis scale if needed\n const yPoint =\n _yAxisType === YAxisType.StringAxis\n ? _yAxisScale.current?.(y) + (_yAxisScale.current?.bandwidth ? _yAxisScale.current.bandwidth() / 2 : 0)\n : _yAxisScale.current?.(y);\n if (!isPlottable(xPoint, yPoint)) {\n continue;\n }\n\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n if (!_isTextMode.current) {\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={xPoint + _xBandwidth.current}\n cy={yPoint}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n </>,\n );\n }\n if (_isTextMode && text) {\n pointsForSeries.push(\n <text\n key={`${circleId}-label`}\n x={xPoint + _xBandwidth.current}\n y={yPoint + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>,\n );\n }\n }\n\n if (_isScatterPolarRef.current) {\n pointsForSeries.push(\n ...renderScatterPolarCategoryLabels({\n xAxisScale: _xAxisScale.current,\n yAxisScale: _yAxisScale.current,\n className: classNames.markerLabel || '',\n lineOptions: (_points.current?.[i] as Partial<ILineChartPoints>)?.lineOptions,\n }),\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n _yAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n props.xScaleType,\n props.yScaleType,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n _isScatterPolarRef.current = isScatterPolarSeries(_points.current);\n _isTextMode.current = isTextMode(_points.current);\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n const _getNumericMinMaxOfY = React.useCallback(\n (points: IScatterChartPoints[], yAxisType?: YAxisType): { startValue: number; endValue: number } => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType, undefined, props.yScaleType);\n const yPadding = getDomainPaddingForMarkers(startValue, endValue, props.yScaleType);\n\n return {\n startValue: startValue - yPadding.start,\n endValue: endValue + yPadding.end,\n };\n },\n [props.yScaleType],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend && !_isTextMode.current) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n // Compute unique y axis labels for string y axis\n const _yAxisLabels: string[] = _getOrderedYAxisLabels();\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getNumericMinMaxOfY}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n // Pass stringDatasetForYAxisDomain only if y axis is string\n {...(_yAxisType === YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {})}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n {...(_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {})}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
@@ -28,6 +28,10 @@ export interface IScatterChartProps extends ICartesianChartProps {
|
|
|
28
28
|
* The prop used to define the culture to localized the numbers
|
|
29
29
|
*/
|
|
30
30
|
culture?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The prop used to define the y axis labels tooltip visibility
|
|
33
|
+
*/
|
|
34
|
+
showYAxisLablesTooltip?: boolean;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* Scatter Chart styles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.types.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { IRenderFunction } from '@fluentui/react/lib/Utilities';\nimport {\n IChartProps,\n ILineChartPoints,\n IMargins,\n IBasestate,\n IRefArrayData,\n ICustomizedCalloutData,\n} from '../../types/index';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n} from '../CommonComponents/index';\nimport { IStyle } from '@fluentui/react';\n\nexport type { IChildProps, ILineChartPoints, IMargins, IBasestate, IRefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface IScatterChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IScatterChartStyles;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: ICustomizedCalloutData) => string | undefined;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\n/**\n * Scatter Chart styles\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyles extends ICartesianChartStyles {\n /**\n * Style for the marker label\n */\n markerLabel?: IStyle;\n}\n\n/**\n * Scatter Chart style properties\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyleProps extends ICartesianChartStyleProps {}\n"]}
|
|
1
|
+
{"version":3,"file":"ScatterChart.types.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { IRenderFunction } from '@fluentui/react/lib/Utilities';\nimport {\n IChartProps,\n ILineChartPoints,\n IMargins,\n IBasestate,\n IRefArrayData,\n ICustomizedCalloutData,\n} from '../../types/index';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IChildProps,\n} from '../CommonComponents/index';\nimport { IStyle } from '@fluentui/react';\n\nexport type { IChildProps, ILineChartPoints, IMargins, IBasestate, IRefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface IScatterChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IScatterChartStyles;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: ICustomizedCalloutData) => string | undefined;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * The prop used to define the y axis labels tooltip visibility\n */\n showYAxisLablesTooltip?: boolean;\n}\n\n/**\n * Scatter Chart styles\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyles extends ICartesianChartStyles {\n /**\n * Style for the marker label\n */\n markerLabel?: IStyle;\n}\n\n/**\n * Scatter Chart style properties\n * {@docCategory ScatterChart}\n */\nexport interface IScatterChartStyleProps extends ICartesianChartStyleProps {}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
define(["require", "exports", "tslib", "d3-selection", "./index", "../components/Legends/Legends.styles"], function (require, exports, tslib_1, d3_selection_1, index_1, Legends_styles_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.toImage = toImage;
|
|
5
|
+
exports.cloneLegendsToSVG = cloneLegendsToSVG;
|
|
5
6
|
function toImage(chartContainer, legendsToSvgCallback, isRTL, opts) {
|
|
6
7
|
if (isRTL === void 0) { isRTL = false; }
|
|
7
8
|
if (opts === void 0) { opts = {}; }
|
|
@@ -37,7 +38,6 @@ define(["require", "exports", "tslib", "d3-selection", "./index", "../components
|
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
exports.toImage = toImage;
|
|
41
41
|
var SVG_STYLE_PROPERTIES = [
|
|
42
42
|
'display',
|
|
43
43
|
'fill',
|
|
@@ -210,7 +210,6 @@ define(["require", "exports", "tslib", "d3-selection", "./index", "../components
|
|
|
210
210
|
height: legendY,
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
exports.cloneLegendsToSVG = cloneLegendsToSVG;
|
|
214
213
|
function svgToPng(svgDataUrl, opts) {
|
|
215
214
|
if (opts === void 0) { opts = {}; }
|
|
216
215
|
return new Promise(function (resolve, reject) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-export-utils.js","sourceRoot":"../src/","sources":["utilities/image-export-utils.ts"],"names":[],"mappings":";;;;IAeA,SAAgB,OAAO,CACrB,cAA8C,EAC9C,oBAAgD,EAChD,KAAsB,EACtB,IAA8B;QAD9B,sBAAA,EAAA,aAAsB;QACtB,qBAAA,EAAA,SAA8B;QAE9B,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,IAAI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KAAK,GAAG,EAAE,CAAC;gBAChB,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;oBAC9B,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;oBACvC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;wBAClD,KAAK,IAAI,CAAC,CAAC;wBACX,SAAS;oBACX,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;oBACnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;wBAClD,KAAK,IAAI,CAAC,CAAC;wBACX,SAAS;oBACX,CAAC;gBACH,CAAC;YACH,CAAC;YACD,MAAM,IAAI,GAAG,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC","sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';\nimport { IImageExportOptions } from '../types/index';\nimport { ILegend, ILegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/Legends.styles';\n\nexport function toImage(\n chartContainer: HTMLElement | null | undefined,\n legendsToSvgCallback?: ILegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: IImageExportOptions = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n\n const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);\n if (!svg.node) {\n return reject(new Error('SVG node is null'));\n }\n\n let svgData = new XMLSerializer().serializeToString(svg.node);\n // This node is already detached from the DOM, so there's no need to call remove() on it.\n // Just clear the reference.\n svg.node = null;\n\n let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgData = null as any;\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgDataUrl = null as any;\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\n\nfunction toSVG(\n chartContainer: HTMLElement,\n legendsToSvgCallback: ILegendContainer['toSVG'] | undefined,\n isRTL: boolean,\n background: string,\n) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup =\n typeof legendsToSvgCallback === 'function'\n ? legendsToSvgCallback(svgWidth, isRTL)\n : { node: null, width: 0, height: 0 };\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n if (legendGroup.node) {\n d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg\n .attr('width', w1)\n .attr('height', h1)\n .attr('viewBox', `0 0 ${w1} ${h1}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n const result = {\n node: clonedSvg.node(),\n width: w1,\n height: h1,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: ILegend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n) {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: IImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"image-export-utils.js","sourceRoot":"../src/","sources":["utilities/image-export-utils.ts"],"names":[],"mappings":";;;IAeA,0BA0CC;IAuGD,8CAwGC;IAzPD,SAAgB,OAAO,CACrB,cAA8C,EAC9C,oBAAgD,EAChD,KAAsB,EACtB,IAA8B;QAD9B,sBAAA,EAAA,aAAsB;QACtB,qBAAA,EAAA,SAA8B;QAE9B,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;YAC7D,CAAC;YAED,IAAI,CAAC;gBACH,IAAM,UAAU,GACd,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAA,2BAAmB,EAAC,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,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AQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;wBAClD,KAAK,IAAI,CAAC,CAAC;wBACX,SAAS;oBACX,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;oBACnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBACpB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;wBAClD,KAAK,IAAI,CAAC,CAAC;wBACX,SAAS;oBACX,CAAC;gBACH,CAAC;YACH,CAAC;YACD,MAAM,IAAI,GAAG,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC","sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';\nimport { IImageExportOptions } from '../types/index';\nimport { ILegend, ILegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/Legends.styles';\n\nexport function toImage(\n chartContainer: HTMLElement | null | undefined,\n legendsToSvgCallback?: ILegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: IImageExportOptions = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n\n const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);\n if (!svg.node) {\n return reject(new Error('SVG node is null'));\n }\n\n let svgData = new XMLSerializer().serializeToString(svg.node);\n // This node is already detached from the DOM, so there's no need to call remove() on it.\n // Just clear the reference.\n svg.node = null;\n\n let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgData = null as any;\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgDataUrl = null as any;\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\n\nfunction toSVG(\n chartContainer: HTMLElement,\n legendsToSvgCallback: ILegendContainer['toSVG'] | undefined,\n isRTL: boolean,\n background: string,\n) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup =\n typeof legendsToSvgCallback === 'function'\n ? legendsToSvgCallback(svgWidth, isRTL)\n : { node: null, width: 0, height: 0 };\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n if (legendGroup.node) {\n d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg\n .attr('width', w1)\n .attr('height', h1)\n .attr('viewBox', `0 0 ${w1} ${h1}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n const result = {\n node: clonedSvg.node(),\n width: w1,\n height: h1,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: ILegend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n) {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: IImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
define(["require", "exports", "react"], function (require, exports, React) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.renderScatterPolarCategoryLabels = renderScatterPolarCategoryLabels;
|
|
5
|
+
exports.extractMaybeLineOptions = extractMaybeLineOptions;
|
|
5
6
|
/**
|
|
6
7
|
* Helper to render categorical labels for scatterpolar charts with improved overlap logic across all series
|
|
7
8
|
* Now places labels at equal angles for all unique texts, regardless of data positions.
|
|
@@ -34,7 +35,6 @@ define(["require", "exports", "react"], function (require, exports, React) {
|
|
|
34
35
|
});
|
|
35
36
|
return renderedLabels;
|
|
36
37
|
}
|
|
37
|
-
exports.renderScatterPolarCategoryLabels = renderScatterPolarCategoryLabels;
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
39
|
function extractMaybeLineOptions(lineOptions) {
|
|
40
40
|
return lineOptions
|
|
@@ -48,6 +48,5 @@ define(["require", "exports", "react"], function (require, exports, React) {
|
|
|
48
48
|
}
|
|
49
49
|
: undefined;
|
|
50
50
|
}
|
|
51
|
-
exports.extractMaybeLineOptions = extractMaybeLineOptions;
|
|
52
51
|
});
|
|
53
52
|
//# sourceMappingURL=scatterpolar-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scatterpolar-utils.js","sourceRoot":"../src/","sources":["utilities/scatterpolar-utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scatterpolar-utils.js","sourceRoot":"../src/","sources":["utilities/scatterpolar-utils.tsx"],"names":[],"mappings":";;;IAOA,4EAyDC;IAED,0DAmBC;IAlFD;;;OAGG;IACH,SAAgB,gCAAgC,CAAC,EAahD;;YAZC,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA;QAShB,IAAM,gBAAgB,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;QAE9D,8DAA8D;QAC9D,IAAM,WAAW,GAAa,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,mCAAI,EAAE,CAAC;QAEhE,+BAA+B;QAC/B,IAAM,cAAc,GAAwB,EAAE,CAAC;QAC/C,IAAM,eAAe,GAA+B,EAAE,CAAC;QACvD,IAAM,WAAW,GAAG,GAAG,CAAC,CAAC,iDAAiD;QAC1E,IAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC;QAErC,kEAAkE;QAClE,IAAM,aAAa,GAAG,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,MAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAM,WAAW,GAAG,CAAC,CAAC,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,mCAAI,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;QAExE,WAAW,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,CAAC;YAC1B,IAAM,KAAK,GAAG,WAAW,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC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,WAAW,CAAC,SAAS,KAAK,WAAW,IAAI,WAAW,CAAC,SAAS,KAAK,kBAAkB;oBACnF,CAAC,CAAC,WAAW,CAAC,SAAS;oBACvB,CAAC,CAAC,SAAS;gBACf,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;aACpF;YACH,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC","sourcesContent":["import * as React from 'react';\nimport { ScaleLinear } from 'd3-scale';\n\n/**\n * Helper to render categorical labels for scatterpolar charts with improved overlap logic across all series\n * Now places labels at equal angles for all unique texts, regardless of data positions.\n */\nexport function renderScatterPolarCategoryLabels({\n xAxisScale,\n yAxisScale,\n className,\n lineOptions,\n minPixelGap = 40,\n}: {\n xAxisScale: ScaleLinear<number, number>;\n yAxisScale: ScaleLinear<number, number>;\n className: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n lineOptions?: any;\n minPixelGap?: number;\n}): React.JSX.Element[] {\n const maybeLineOptions = extractMaybeLineOptions(lineOptions);\n\n // Always use axisLabel from lineOptions to display the labels\n const uniqueTexts: string[] = maybeLineOptions?.axisLabel ?? [];\n\n // Place labels at equal angles\n const renderedLabels: React.JSX.Element[] = [];\n const placedPositions: { x: number; y: number }[] = [];\n const labelRadius = 0.7; // You can adjust this value for more/less offset\n const numLabels = uniqueTexts.length;\n\n // Respect schema or prop rotation and direction (default ccw, 0°)\n const dirMultiplier = maybeLineOptions?.direction === 'clockwise' ? -1 : 1;\n const rotationRad = ((maybeLineOptions?.rotation ?? 0) * Math.PI) / 180;\n\n uniqueTexts.forEach((text, i) => {\n const angle = rotationRad + dirMultiplier * ((2 * Math.PI) / numLabels) * i;\n const originXOffset = maybeLineOptions?.originXOffset || 0;\n const x = xAxisScale(labelRadius * Math.cos(angle) - originXOffset / 2);\n const y = yAxisScale(labelRadius * Math.sin(angle));\n\n // Check distance from all previously placed labels\n const isFarEnough = placedPositions.every(pos => Math.sqrt((x - pos.x) ** 2 + (y - pos.y) ** 2) >= minPixelGap);\n\n if (renderedLabels.length === 0 || isFarEnough) {\n renderedLabels.push(\n <text\n key={`scatterpolar-label-${text}`}\n x={x}\n y={y}\n className={className}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n opacity={1}\n >\n {text}\n </text>,\n );\n placedPositions.push({ x, y });\n }\n });\n\n return renderedLabels;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function extractMaybeLineOptions(lineOptions: any):\n | {\n originXOffset?: number;\n direction?: 'clockwise' | 'counterclockwise';\n rotation?: number;\n axisLabel?: string[];\n }\n | undefined {\n return lineOptions\n ? {\n originXOffset: lineOptions.originXOffset,\n direction:\n lineOptions.direction === 'clockwise' || lineOptions.direction === 'counterclockwise'\n ? lineOptions.direction\n : undefined,\n rotation: lineOptions.rotation,\n axisLabel: Array.isArray(lineOptions.axisLabel) ? lineOptions.axisLabel : undefined,\n }\n : undefined;\n}\n"]}
|
|
@@ -191,12 +191,12 @@ export declare function calloutData(values: ((ILineChartPoints | IScatterChartPo
|
|
|
191
191
|
legend: string;
|
|
192
192
|
y: number;
|
|
193
193
|
color: string;
|
|
194
|
-
xAxisCalloutData?: string
|
|
194
|
+
xAxisCalloutData?: string;
|
|
195
195
|
yAxisCalloutData?: string | {
|
|
196
196
|
[id: string]: number;
|
|
197
|
-
}
|
|
198
|
-
callOutAccessibilityData?: IAccessibilityProps
|
|
199
|
-
index?: number
|
|
197
|
+
};
|
|
198
|
+
callOutAccessibilityData?: IAccessibilityProps;
|
|
199
|
+
index?: number;
|
|
200
200
|
}[];
|
|
201
201
|
}[];
|
|
202
202
|
export declare function getUnique(arr: {
|
|
@@ -439,7 +439,7 @@ export declare const getAccessibleDataObject: (accessibleData?: IAccessibilityPr
|
|
|
439
439
|
export declare function rotateXAxisLabels(rotateLabelProps: IRotateLabelProps): number | undefined;
|
|
440
440
|
export declare function wrapTextInsideDonut(selectorClass: string, maxWidth: number): void;
|
|
441
441
|
export declare function formatScientificLimitWidth(value: number): string;
|
|
442
|
-
export declare const getBarWidth: (barWidthProp: number |
|
|
442
|
+
export declare const getBarWidth: (barWidthProp: number | "default" | "auto" | undefined, maxBarWidthProp: number | undefined, adjustedValue?: number, modeProp?: string) => number;
|
|
443
443
|
export declare const getScalePadding: (prop: number | undefined, shorthandProp?: number, defaultValue?: number) => number;
|
|
444
444
|
export declare const isScalePaddingDefined: (prop: number | undefined, shorthandProp?: number) => boolean;
|
|
445
445
|
export declare function getSecureProps(props?: Record<string, any>): Record<string, any>;
|
|
@@ -482,9 +482,9 @@ export declare const getRangeForScatterMarkerSize: ({ data, xScale, yScalePrimar
|
|
|
482
482
|
data: ILineChartPoints[] | IScatterChartPoints[];
|
|
483
483
|
xScale: IScaleContinuousNumeric<number, number> | IScaleTime<number, number>;
|
|
484
484
|
yScalePrimary: IScaleContinuousNumeric<number, number>;
|
|
485
|
-
yScaleSecondary?: IScaleContinuousNumeric<number, number
|
|
486
|
-
useSecondaryYScale?: boolean
|
|
487
|
-
xScaleType?: AxisScaleType
|
|
488
|
-
yScaleType?: AxisScaleType
|
|
489
|
-
secondaryYScaleType?: AxisScaleType
|
|
485
|
+
yScaleSecondary?: IScaleContinuousNumeric<number, number>;
|
|
486
|
+
useSecondaryYScale?: boolean;
|
|
487
|
+
xScaleType?: AxisScaleType;
|
|
488
|
+
yScaleType?: AxisScaleType;
|
|
489
|
+
secondaryYScaleType?: AxisScaleType;
|
|
490
490
|
}) => number;
|