@fluentui/react-charting 5.16.8 → 5.16.10
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 +49 -1
- package/CHANGELOG.md +23 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/AreaChart/AreaChart.base.d.ts +5 -0
- package/lib/components/AreaChart/AreaChart.base.js +71 -12
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.d.ts +1 -0
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/Legends/Legends.base.js +13 -5
- package/lib/components/Legends/Legends.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -2
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +5 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +71 -12
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.types.d.ts +1 -0
- package/lib-amd/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib-amd/components/Legends/Legends.base.js +13 -5
- package/lib-amd/components/Legends/Legends.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -2
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +5 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +71 -12
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.d.ts +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.base.js +13 -5
- package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -2
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +3 -3
- package/src/components/AreaChart/AreaChart.types.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.base.js","sourceRoot":"../src/","sources":["components/AreaChart/AreaChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAkD;AAClD,6CAA2C;AAC3C,6CAAkD;AAClD,qCAA4G;AAC5G,2DAAiG;AACjG,qCAYqB;AACrB,2DAAiE;AACjE,+CAS+B;AAC/B,0CAAoD;AACpD,uDAA8D;AAE9D,IAAM,aAAa,GAAG,8BAAkB,EAA0C,CAAC;AAEnF,8DAA8D;AAC9D,IAAM,MAAM,GAAG,mBAAQ,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC,CAAC,IAAI,CAAC;AAE9C,IAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,IAAK,mBAGJ;AAHD,WAAK,mBAAmB;IACtB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHI,mBAAmB,KAAnB,mBAAmB,QAGvB;AAyBD;IAAmC,yCAAiD;IA6BlF,uBAAmB,KAAsB;QAAzC,YACE,kBAAM,KAAK,CAAC,SAuBb;QAuFO,iBAAW,GAAG,UAAC,OAAiB;YACtC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC,CAAC;QAEM,sBAAgB,GAAG,UAAC,UA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AK,CACnB,CACJ,CAAC;YACJ,CAAC,IACD,CACH,CAAC;IACJ,CAAC;IAgOO,sCAAc,GAAtB,UAAuB,MAAc;QACnC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,MAAM,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,MAAM;aACvB,CAAC,CAAC;SACJ;IACH,CAAC;IAEO,sCAAc,GAAtB,UAAuB,MAAc;QACnC,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IAEO,sCAAc,GAAtB;QACE,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IA0RH,oBAAC;AAAD,CAAC,AA1pBD,CAAmC,KAAK,CAAC,SAAS,GA0pBjD;AA1pBY,sCAAa","sourcesContent":["import * as React from 'react';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { clientPoint } from 'd3-selection';\nimport { select as d3Select } from 'd3-selection';\nimport { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';\nimport { classNamesFunction, find, getId, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IAreaChartProps,\n IBasestate,\n ILineChartDataPoint,\n ILineChartPoints,\n IChildProps,\n IMargins,\n IAreaChartStyleProps,\n IAreaChartStyles,\n} from '../../index';\nimport { warnDeprecations } from '@fluentui/react/lib/Utilities';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfXAxislabels,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { ILegend, Legends } from '../Legends/index';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\n\nconst getClassNames = classNamesFunction<IAreaChartStyleProps, IAreaChartStyles>();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst COMPONENT_NAME = 'AREA CHART';\n\nenum InterceptVisibility {\n show = 'visibility',\n hide = 'hidden',\n}\n\nexport interface IAreaChartAreaPoint {\n xVal: string | number;\n values: IAreaChartDataSetPoint;\n}\nexport interface IAreaChartDataSetPoint {\n [key: string]: number | string;\n}\nexport interface IDPointType {\n values: { 0: number; 1: number; data: {} };\n xVal: number | Date;\n}\n\nexport interface IAreaChartState extends IBasestate {\n lineXValue: number;\n displayOfLine: InterceptVisibility;\n isCircleClicked: boolean;\n dataPointCalloutProps?: ICustomizedCalloutData;\n stackCalloutProps?: ICustomizedCalloutData;\n nearestCircleToHighlight: number | string | Date | null;\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n isShowCalloutPending: boolean;\n}\n\nexport class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartState> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _calloutPoints: any;\n private _createSet: (data: ILineChartPoints[]) => {\n colors: string[];\n opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stackedInfo: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n calloutPoints: any;\n };\n private _colors: string[];\n private _opacity: number[];\n private _uniqueIdForGraph: string;\n private _verticalLineId: string;\n private _circleId: string;\n private _uniqueCallOutID: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _stackedData: any;\n private _chart: JSX.Element[];\n private margins: IMargins;\n private _rectId: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisRectScale: any;\n // determines if the given area chart has multiple stacked bar charts\n private _isMultiStackChart: boolean;\n private _tooltipId: string;\n private _highlightedCircleId: string;\n\n public constructor(props: IAreaChartProps) {\n super(props);\n this._createSet = memoizeFunction(this._createDataSet);\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n hoverXValue: '',\n isCalloutVisible: false,\n refSelected: null,\n YValueHover: [],\n lineXValue: 0,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n nearestCircleToHighlight: null,\n isShowCalloutPending: false,\n };\n warnDeprecations(COMPONENT_NAME, props, {\n showYAxisGridLines: 'Dont use this property. Lines are drawn by default',\n });\n this._uniqueIdForGraph = getId('areaChart_');\n this._verticalLineId = getId('verticalLine_');\n this._circleId = getId('circle');\n this._rectId = getId('rectangle');\n this._tooltipId = getId('AreaChartTooltipID');\n }\n\n public componentDidUpdate() {\n if (this.state.isShowCalloutPending) {\n this.setState({\n refSelected: `#${this._highlightedCircleId}`,\n isCalloutVisible: true,\n isShowCalloutPending: false,\n });\n }\n }\n\n public render(): JSX.Element {\n const { lineChartData, chartTitle } = this.props.data;\n const points = this._addDefaultColors(lineChartData);\n const { colors, opacity, stackedInfo, calloutPoints } = this._createSet(points);\n this._calloutPoints = calloutPoints;\n const isXAxisDateType = getXAxisType(points);\n this._colors = colors;\n this._opacity = opacity;\n this._stackedData = stackedInfo.stackedData;\n const legends: JSX.Element = this._getLegendData(points);\n\n const tickParams = {\n tickValues: this.props.tickValues,\n tickFormat: this.props.tickFormat,\n };\n\n const calloutProps = {\n target: this.state.refSelected,\n isCalloutVisible: this.state.isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover: this.state.YValueHover,\n hoverXValue: this.state.hoverXValue,\n id: `toolTip${this._uniqueCallOutID}`,\n gapSpace: 15,\n isBeakVisible: false,\n setInitialFocus: true,\n onDismiss: this._closeCallout,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: this.state.xAxisCalloutAccessibilityData,\n ...this.props.calloutProps,\n };\n return (\n <CartesianChart\n {...this.props}\n chartTitle={chartTitle}\n points={points}\n chartType={ChartTypes.AreaChart}\n calloutProps={calloutProps}\n legendBars={legends}\n isCalloutForStack\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n tickParams={tickParams}\n maxOfYVal={stackedInfo.maxOfYVal}\n getGraphData={this._getGraphData}\n getmargins={this._getMargins}\n customizedCallout={this._getCustomizedCallout()}\n onChartMouseLeave={this._handleChartMouseLeave}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisRectScale = props.xScale;\n const ticks = this._xAxisRectScale.ticks();\n const width1 = this._xAxisRectScale(ticks[ticks.length - 1]);\n const rectHeight = props.containerHeight! - this.margins.top!;\n return (\n <>\n <g>\n <rect\n id={this._rectId}\n width={width1}\n height={rectHeight}\n fill={'transparent'}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n />\n </g>\n <g>{this._chart}</g>\n </>\n );\n }}\n />\n );\n }\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _onRectMouseMove = (mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>) => {\n mouseEvent.persist();\n const { data } = this.props;\n const { lineChartData } = data;\n // This will get the value of the X when mouse is on the chart\n const xOffset = this._xAxisRectScale.invert(clientPoint(document.getElementById(this._rectId)!, mouseEvent)[0]);\n const i = bisect(lineChartData![0].data, xOffset);\n const d0 = lineChartData![0].data[i - 1] as ILineChartDataPoint;\n const d1 = lineChartData![0].data[i] as ILineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let pointToHighlight: string | Date | number | null = null;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n pointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n pointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![0].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData, xAxisCalloutAccessibilityData } = lineChartData![0].data[index as number];\n const formattedDate = pointToHighlight instanceof Date ? pointToHighlight.toLocaleString() : pointToHighlight;\n const modifiedXVal = pointToHighlight instanceof Date ? pointToHighlight.getTime() : pointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(this._calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const nearestCircleToHighlight =\n axisType === XAxisTypes.DateAxis ? (pointToHighlight as Date).getTime() : pointToHighlight;\n const pointToHighlightUpdated = this.state.nearestCircleToHighlight !== nearestCircleToHighlight;\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated && !this.state.isShowCalloutPending) {\n this.setState({\n nearestCircleToHighlight: nearestCircleToHighlight,\n isCalloutVisible: false,\n isShowCalloutPending: true,\n lineXValue: this._xAxisRectScale(pointToHighlight),\n displayOfLine: InterceptVisibility.show,\n isCircleClicked: false,\n stackCalloutProps: found!,\n YValueHover: found.values,\n dataPointCalloutProps: found!,\n hoverXValue: xAxisCalloutData ? xAxisCalloutData : formattedDate,\n xAxisCalloutAccessibilityData,\n });\n } else {\n /*\n When above if condition is false but found=true, it means either\n\n 1). pointToHighlightUpdated is false.\n For this case we dont need to do anything.\n\n 2). isShowCalloutPending is true.\n For this case there will be no callout updation for the event.\n This condition has been added to prevent repeated callout flashing.\n Currently there is a fraction of second delay between hover event and subsequent callout refresh.\n In the meantime if another event is received, the callout continues to flash for the set of\n intermediate hover events.\n\n This does not cause any issue as the user interaction takes atleast a fraction of second and the final\n callout state is ultimately achieved.\n If a user performs very swift mouse maneuver, the intermediate events will be lost but the callout experience\n remains smooth.\n */\n }\n if (!found) {\n this.setState({\n isCalloutVisible: false,\n nearestCircleToHighlight: nearestCircleToHighlight,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n });\n }\n };\n /**\n * just cleaning up the state which we have set in the mouse move event\n */\n private _onRectMouseOut = () => {\n /**/\n };\n\n private _handleChartMouseLeave = () => {\n this.setState({\n refSelected: null,\n isCalloutVisible: false,\n nearestCircleToHighlight: null,\n lineXValue: 0,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n stackCalloutProps: undefined,\n dataPointCalloutProps: undefined,\n hoverXValue: undefined,\n YValueHover: [],\n });\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getStackedData = (keys: string[], dataSet: any) => {\n const stackedValues = d3Stack().keys(keys)(dataSet);\n const maxOfYVal = d3Max(stackedValues[stackedValues.length - 1], dp => dp[1])!;\n const stackedData: Array<IAreaChartDataSetPoint[]> = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stackedValues.forEach((layer: any) => {\n const currentStack: IAreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n layer.forEach((d: any) => {\n currentStack.push({\n values: d,\n xVal: d.data.xVal,\n });\n });\n stackedData.push(currentStack);\n });\n this._isMultiStackChart = stackedData && stackedData.length > 1 ? true : false;\n return {\n stackedData,\n maxOfYVal,\n };\n };\n\n private _createDataSet = (points: ILineChartPoints[]) => {\n const allChartPoints: ILineChartDataPoint[] = [];\n const dataSet: IAreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: ILineChartPoints) => {\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...singleChartPoint.data);\n });\n\n let tempArr = allChartPoints;\n while (tempArr.length) {\n const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n const filteredChartPoints: ILineChartDataPoint[] = tempArr.filter(\n (point: ILineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck,\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n filteredChartPoints.forEach((singleDataPoint: ILineChartDataPoint, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n // removing compared objects from array\n const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n tempArr = tempArr.filter(\n (point: ILineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val,\n );\n }\n\n // get keys from dataset, used to create stacked data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n const keys: string[] = [];\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n\n // Stacked Info used to draw graph\n const stackedInfo = this._getStackedData(keys, dataSet);\n\n return {\n colors,\n opacity,\n keys,\n stackedInfo,\n calloutPoints,\n };\n };\n\n private _getCustomizedCallout = () => {\n return this.props.onRenderCalloutPerStack\n ? this.props.onRenderCalloutPerStack(this.state.stackCalloutProps)\n : this.props.onRenderCalloutPerDataPoint\n ? this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n : null;\n };\n\n private _getGraphData = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xAxis: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxis: any,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n this._chart = this._drawGraph(containerHeight, xAxis, yAxis, xElement!);\n };\n\n private _onLegendClick(legend: string): void {\n if (this.state.selectedLegend === legend) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legend,\n });\n }\n }\n\n private _onLegendHover(legend: string): void {\n this.setState({\n activeLegend: legend,\n });\n }\n\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _getLegendData = (points: ILineChartPoints[]): JSX.Element => {\n const data = points;\n const actions: ILegend[] = [];\n\n data.forEach((singleChartData: ILineChartPoints) => {\n const color: string = singleChartData.color!;\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === singleChartData.legend && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: ILegend = {\n title: singleChartData.legend,\n color: color,\n action: () => {\n this._onLegendClick(singleChartData.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(singleChartData.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n return (\n <Legends\n legends={actions}\n overflowProps={this.props.legendsOverflowProps}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n {...this.props.legendProps}\n />\n );\n };\n\n private _onDataPointClick = (func: (() => void) | undefined) => {\n if (func) {\n func();\n }\n this.setState({ isCircleClicked: true });\n };\n\n private _getOpacity = (legend: string): number => {\n if (!this._isMultiStackChart) {\n return 0.7;\n } else {\n const opacity = this._legendHighlighted(legend) || this._noLegendHighlighted() ? 0.7 : 0.1;\n return opacity;\n }\n };\n\n private _getLineOpacity = (legend: string): number => {\n if (!this._isMultiStackChart) {\n return 1;\n } else {\n let opacity = 0.3;\n if (this.state.isCalloutVisible) {\n opacity = 1;\n }\n if (!this._noLegendHighlighted()) {\n opacity = this._legendHighlighted(legend) ? 0 : 0.1;\n }\n return opacity;\n }\n };\n\n private _updateCircleFillColor = (xDataPoint: number | Date, lineColor: string, circleId: string): string => {\n let fillColor = lineColor;\n if (this.state.nearestCircleToHighlight === xDataPoint) {\n this._highlightedCircleId = circleId;\n if (!this.state.isCircleClicked) {\n fillColor = this.props.theme!.palette.white;\n }\n }\n\n return fillColor;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _drawGraph = (containerHeight: number, xScale: any, yScale: any, xElement: SVGElement): JSX.Element[] => {\n const points = this._addDefaultColors(this.props.data.lineChartData);\n const { pointOptions, pointLineOptions } = this.props.data;\n const area = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((d: any) => yScale(d.values[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((d: any) => yScale(d.values[1]))\n .curve(d3CurveBasis);\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d.values[1]))\n .curve(d3CurveBasis);\n\n const graph: JSX.Element[] = [];\n let lineColor: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._stackedData.forEach((singleStackedData: Array<any>, index: number) => {\n graph.push(\n <React.Fragment key={`${index}-graph-${this._uniqueIdForGraph}`}>\n <path\n id={`${index}-line-${this._uniqueIdForGraph}`}\n d={line(singleStackedData)!}\n fill={'transparent'}\n strokeWidth={3}\n stroke={this._colors[index]}\n opacity={this._getLineOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n {...points[index]!.lineOptions}\n />\n {singleStackedData.length === 1 ? (\n <circle\n id={`${index}-graph-${this._uniqueIdForGraph}`}\n cx={xScale(singleStackedData[0].xVal)}\n cy={yScale(singleStackedData[0].values[1])}\n r={6}\n stroke={this._colors[index]}\n strokeWidth={3}\n fill={this._colors[index]}\n opacity={this._opacity[index]}\n fillOpacity={this._getOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n />\n ) : (\n <path\n id={`${index}-graph-${this._uniqueIdForGraph}`}\n d={area(singleStackedData)!}\n fill={this._colors[index]}\n opacity={this._opacity[index]}\n fillOpacity={this._getOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n />\n )}\n </React.Fragment>,\n );\n });\n\n const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._stackedData.forEach((singleStackedData: Array<any>, index: number) => {\n if (points.length === index) {\n return;\n }\n graph.push(\n <g key={`${index}-dots-${this._uniqueIdForGraph}`} d={area(singleStackedData)!} clipPath=\"url(#clip)\">\n {singleStackedData.map((singlePoint: IDPointType, pointIndex: number) => {\n const circleId = `${this._circleId}_${index * this._stackedData[0].length + pointIndex}`;\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n lineColor = points[index]!.color!;\n return (\n <circle\n key={circleId}\n id={circleId}\n data-is-focusable={true}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n visibility={this.state.nearestCircleToHighlight ? 'visibility' : 'hidden'}\n fill={this._updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n onClick={this._onDataPointClick.bind(this, points[index]!.data[pointIndex].onDataPointClick!)}\n {...pointOptions}\n r={this._getCircleRadius(xDataPoint, circleRadius)}\n />\n );\n })}\n </g>,\n );\n });\n graph.push(\n <line\n id={this._verticalLineId}\n key={this._verticalLineId}\n x1={this.state.lineXValue}\n y1={0}\n x2={this.state.lineXValue}\n y2={containerHeight}\n strokeWidth={1}\n strokeDasharray={5.5}\n stroke={lineColor!}\n opacity={0.5}\n visibility={this.state.displayOfLine}\n {...pointLineOptions}\n />,\n );\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!this.props.showXAxisLablesTooltip) {\n try {\n document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!this.props.wrapXAxisLables && this.props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale);\n try {\n document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: this._tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return graph;\n };\n\n private _getCircleRadius = (xDataPoint: number, circleRadius: number): number => {\n const { isCircleClicked, nearestCircleToHighlight } = this.state;\n if (isCircleClicked && nearestCircleToHighlight === xDataPoint) {\n return 1;\n } else if (nearestCircleToHighlight === xDataPoint) {\n return circleRadius;\n } else {\n return 0;\n }\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legend: string) => {\n return (\n this.state.selectedLegend === legend || (this.state.selectedLegend === '' && this.state.activeLegend === legend)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _addDefaultColors = (lineChartData?: ILineChartPoints[]): ILineChartPoints[] => {\n return lineChartData\n ? lineChartData.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AreaChart.base.js","sourceRoot":"../src/","sources":["components/AreaChart/AreaChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAkD;AAClD,6CAA2C;AAC3C,6CAAkD;AAClD,qCAA4G;AAC5G,2DAAiG;AACjG,qCAYqB;AACrB,2DAAiE;AACjE,+CAS+B;AAC/B,0CAAoD;AACpD,uDAA8D;AAE9D,IAAM,aAAa,GAAG,8BAAkB,EAA0C,CAAC;AAEnF,8DAA8D;AAC9D,IAAM,MAAM,GAAG,mBAAQ,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC,CAAC,IAAI,CAAC;AAE9C,IAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,IAAK,mBAGJ;AAHD,WAAK,mBAAmB;IACtB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHI,mBAAmB,KAAnB,mBAAmB,QAGvB;AA2BD;IAAmC,yCAAiD;IA6BlF,uBAAmB,KAAsB;QAAzC,YACE,kBAAM,KAAK,CAAC,SAwBb;QAsFO,iBAAW,GAAG,UAAC,OAAiB;YACtC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC,CAAC;QAEM,sBAAgB,GAAG,UAAC,UAAgF;YAC1G,UAAU,CAAC,OAAO,EAAE,CAAC;YACb,IAAA,IAAI,GAAK,KAAI,CAAC,KAAK,KAAf,CAAgB;YACpB,IAAA,aAAa,GAAK,IAAI,cAAT,CAAU;YAC/B,8DAA8D;YAC9D,IAAM,OAAO,GAAG,KAAI,CAAC,eAAe,CAAC,MAAM,CAAC,0BAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAI,CAAC,OAAO,CAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChH,IAAM,CAAC,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,cAAc,KAAK,MAAM,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC;gBACZ,cAAc,EAAE,MAAM;aACvB,CAAC,CAAC;SACJ;IACH,CAAC;IAEO,sCAAc,GAAtB,UAAuB,MAAc;QACnC,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IAEO,sCAAc,GAAtB;QACE,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IA2WH,oBAAC;AAAD,CAAC,AA5uBD,CAAmC,KAAK,CAAC,SAAS,GA4uBjD;AA5uBY,sCAAa","sourcesContent":["import * as React from 'react';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { clientPoint } from 'd3-selection';\nimport { select as d3Select } from 'd3-selection';\nimport { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';\nimport { classNamesFunction, find, getId, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IAreaChartProps,\n IBasestate,\n ILineChartDataPoint,\n ILineChartPoints,\n IChildProps,\n IMargins,\n IAreaChartStyleProps,\n IAreaChartStyles,\n} from '../../index';\nimport { warnDeprecations } from '@fluentui/react/lib/Utilities';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfXAxislabels,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { ILegend, Legends } from '../Legends/index';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\n\nconst getClassNames = classNamesFunction<IAreaChartStyleProps, IAreaChartStyles>();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst COMPONENT_NAME = 'AREA CHART';\n\nenum InterceptVisibility {\n show = 'visibility',\n hide = 'hidden',\n}\n\nexport interface IAreaChartAreaPoint {\n xVal: string | number;\n values: IAreaChartDataSetPoint;\n}\nexport interface IAreaChartDataSetPoint {\n [key: string]: number | string;\n}\nexport interface IDPointType {\n values: { 0: number; 1: number; data: {} };\n xVal: number | Date;\n}\n\nexport interface IAreaChartState extends IBasestate {\n lineXValue: number;\n displayOfLine: InterceptVisibility;\n isCircleClicked: boolean;\n dataPointCalloutProps?: ICustomizedCalloutData;\n stackCalloutProps?: ICustomizedCalloutData;\n nearestCircleToHighlight: number | string | Date | null;\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n isShowCalloutPending: boolean;\n /** focused point */\n activePoint: string;\n}\n\nexport class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartState> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _calloutPoints: any;\n private _createSet: (data: ILineChartPoints[]) => {\n colors: string[];\n opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stackedInfo: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n calloutPoints: any;\n };\n private _colors: string[];\n private _opacity: number[];\n private _uniqueIdForGraph: string;\n private _verticalLineId: string;\n private _circleId: string;\n private _uniqueCallOutID: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _stackedData: any;\n private _chart: JSX.Element[];\n private margins: IMargins;\n private _rectId: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisRectScale: any;\n // determines if the given area chart has multiple stacked bar charts\n private _isMultiStackChart: boolean;\n private _tooltipId: string;\n private _highlightedCircleId: string;\n\n public constructor(props: IAreaChartProps) {\n super(props);\n this._createSet = memoizeFunction(this._createDataSet);\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n hoverXValue: '',\n isCalloutVisible: false,\n refSelected: null,\n YValueHover: [],\n lineXValue: 0,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n nearestCircleToHighlight: null,\n isShowCalloutPending: false,\n activePoint: '',\n };\n warnDeprecations(COMPONENT_NAME, props, {\n showYAxisGridLines: 'Dont use this property. Lines are drawn by default',\n });\n this._uniqueIdForGraph = getId('areaChart_');\n this._verticalLineId = getId('verticalLine_');\n this._circleId = getId('circle');\n this._rectId = getId('rectangle');\n this._tooltipId = getId('AreaChartTooltipID');\n }\n\n public componentDidUpdate() {\n if (this.state.isShowCalloutPending) {\n this.setState({\n refSelected: `#${this._highlightedCircleId}`,\n isCalloutVisible: true,\n isShowCalloutPending: false,\n });\n }\n }\n\n public render(): JSX.Element {\n const { lineChartData, chartTitle } = this.props.data;\n const points = this._addDefaultColors(lineChartData);\n const { colors, opacity, stackedInfo, calloutPoints } = this._createSet(points);\n this._calloutPoints = calloutPoints;\n const isXAxisDateType = getXAxisType(points);\n this._colors = colors;\n this._opacity = opacity;\n this._stackedData = stackedInfo.stackedData;\n const legends: JSX.Element = this._getLegendData(points);\n\n const tickParams = {\n tickValues: this.props.tickValues,\n tickFormat: this.props.tickFormat,\n };\n\n const calloutProps = {\n target: this.state.refSelected,\n isCalloutVisible: this.state.isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover: this.state.YValueHover,\n hoverXValue: this.state.hoverXValue,\n id: `toolTip${this._uniqueCallOutID}`,\n gapSpace: 15,\n isBeakVisible: false,\n onDismiss: this._closeCallout,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: this.state.xAxisCalloutAccessibilityData,\n ...this.props.calloutProps,\n };\n return (\n <CartesianChart\n {...this.props}\n chartTitle={chartTitle}\n points={points}\n chartType={ChartTypes.AreaChart}\n calloutProps={calloutProps}\n legendBars={legends}\n isCalloutForStack\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n tickParams={tickParams}\n maxOfYVal={stackedInfo.maxOfYVal}\n getGraphData={this._getGraphData}\n getmargins={this._getMargins}\n customizedCallout={this._getCustomizedCallout()}\n onChartMouseLeave={this._handleChartMouseLeave}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisRectScale = props.xScale;\n const ticks = this._xAxisRectScale.ticks();\n const width1 = this._xAxisRectScale(ticks[ticks.length - 1]);\n const rectHeight = props.containerHeight! - this.margins.top!;\n return (\n <>\n <g>\n <rect\n id={this._rectId}\n width={width1}\n height={rectHeight}\n fill={'transparent'}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n />\n </g>\n <g>{this._chart}</g>\n </>\n );\n }}\n />\n );\n }\n\n private _getMargins = (margins: IMargins) => {\n this.margins = margins;\n };\n\n private _onRectMouseMove = (mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>) => {\n mouseEvent.persist();\n const { data } = this.props;\n const { lineChartData } = data;\n // This will get the value of the X when mouse is on the chart\n const xOffset = this._xAxisRectScale.invert(clientPoint(document.getElementById(this._rectId)!, mouseEvent)[0]);\n const i = bisect(lineChartData![0].data, xOffset);\n const d0 = lineChartData![0].data[i - 1] as ILineChartDataPoint;\n const d1 = lineChartData![0].data[i] as ILineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let pointToHighlight: string | Date | number | null = null;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n pointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n pointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![0].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData, xAxisCalloutAccessibilityData } = lineChartData![0].data[index as number];\n const formattedDate = pointToHighlight instanceof Date ? pointToHighlight.toLocaleString() : pointToHighlight;\n const modifiedXVal = pointToHighlight instanceof Date ? pointToHighlight.getTime() : pointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(this._calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const nearestCircleToHighlight =\n axisType === XAxisTypes.DateAxis ? (pointToHighlight as Date).getTime() : pointToHighlight;\n const pointToHighlightUpdated = this.state.nearestCircleToHighlight !== nearestCircleToHighlight;\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated && !this.state.isShowCalloutPending) {\n this.setState({\n nearestCircleToHighlight: nearestCircleToHighlight,\n isCalloutVisible: false,\n isShowCalloutPending: true,\n lineXValue: this._xAxisRectScale(pointToHighlight),\n displayOfLine: InterceptVisibility.show,\n isCircleClicked: false,\n stackCalloutProps: found!,\n YValueHover: found.values,\n dataPointCalloutProps: found!,\n hoverXValue: xAxisCalloutData ? xAxisCalloutData : formattedDate,\n xAxisCalloutAccessibilityData,\n activePoint: '',\n });\n } else {\n /*\n When above if condition is false but found=true, it means either\n\n 1). pointToHighlightUpdated is false.\n For this case we dont need to do anything.\n\n 2). isShowCalloutPending is true.\n For this case there will be no callout updation for the event.\n This condition has been added to prevent repeated callout flashing.\n Currently there is a fraction of second delay between hover event and subsequent callout refresh.\n In the meantime if another event is received, the callout continues to flash for the set of\n intermediate hover events.\n\n This does not cause any issue as the user interaction takes atleast a fraction of second and the final\n callout state is ultimately achieved.\n If a user performs very swift mouse maneuver, the intermediate events will be lost but the callout experience\n remains smooth.\n */\n }\n if (!found) {\n this.setState({\n isCalloutVisible: false,\n nearestCircleToHighlight: nearestCircleToHighlight,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n });\n }\n };\n /**\n * just cleaning up the state which we have set in the mouse move event\n */\n private _onRectMouseOut = () => {\n /**/\n };\n\n private _handleChartMouseLeave = () => {\n this.setState({\n refSelected: null,\n isCalloutVisible: false,\n nearestCircleToHighlight: null,\n lineXValue: 0,\n displayOfLine: InterceptVisibility.hide,\n isCircleClicked: false,\n stackCalloutProps: undefined,\n dataPointCalloutProps: undefined,\n hoverXValue: undefined,\n YValueHover: [],\n });\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getStackedData = (keys: string[], dataSet: any) => {\n const stackedValues = d3Stack().keys(keys)(dataSet);\n const maxOfYVal = d3Max(stackedValues[stackedValues.length - 1], dp => dp[1])!;\n const stackedData: Array<IAreaChartDataSetPoint[]> = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stackedValues.forEach((layer: any) => {\n const currentStack: IAreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n layer.forEach((d: any) => {\n currentStack.push({\n values: d,\n xVal: d.data.xVal,\n });\n });\n stackedData.push(currentStack);\n });\n this._isMultiStackChart = stackedData && stackedData.length > 1 ? true : false;\n return {\n stackedData,\n maxOfYVal,\n };\n };\n\n private _createDataSet = (points: ILineChartPoints[]) => {\n const allChartPoints: ILineChartDataPoint[] = [];\n const dataSet: IAreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: ILineChartPoints) => {\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...singleChartPoint.data);\n });\n\n let tempArr = allChartPoints;\n while (tempArr.length) {\n const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n const filteredChartPoints: ILineChartDataPoint[] = tempArr.filter(\n (point: ILineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck,\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n filteredChartPoints.forEach((singleDataPoint: ILineChartDataPoint, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n // removing compared objects from array\n const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n tempArr = tempArr.filter(\n (point: ILineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val,\n );\n }\n\n // get keys from dataset, used to create stacked data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n const keys: string[] = [];\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n\n // Stacked Info used to draw graph\n const stackedInfo = this._getStackedData(keys, dataSet);\n\n return {\n colors,\n opacity,\n keys,\n stackedInfo,\n calloutPoints,\n };\n };\n\n private _getCustomizedCallout = () => {\n return this.props.onRenderCalloutPerStack\n ? this.props.onRenderCalloutPerStack(this.state.stackCalloutProps)\n : this.props.onRenderCalloutPerDataPoint\n ? this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n : null;\n };\n\n private _getGraphData = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xAxis: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxis: any,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n this._chart = this._drawGraph(containerHeight, xAxis, yAxis, xElement!);\n };\n\n private _onLegendClick(legend: string): void {\n if (this.state.selectedLegend === legend) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legend,\n });\n }\n }\n\n private _onLegendHover(legend: string): void {\n this.setState({\n activeLegend: legend,\n });\n }\n\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _getLegendData = (points: ILineChartPoints[]): JSX.Element => {\n const data = points;\n const actions: ILegend[] = [];\n\n data.forEach((singleChartData: ILineChartPoints) => {\n const color: string = singleChartData.color!;\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === singleChartData.legend && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: ILegend = {\n title: singleChartData.legend,\n color: color,\n action: () => {\n this._onLegendClick(singleChartData.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(singleChartData.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n return (\n <Legends\n legends={actions}\n overflowProps={this.props.legendsOverflowProps}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n {...this.props.legendProps}\n />\n );\n };\n\n private _onDataPointClick = (func: (() => void) | undefined) => {\n if (func) {\n func();\n }\n this.setState({ isCircleClicked: true });\n };\n\n private _getOpacity = (legend: string): number => {\n if (!this._isMultiStackChart) {\n return 0.7;\n } else {\n const opacity = this._legendHighlighted(legend) || this._noLegendHighlighted() ? 0.7 : 0.1;\n return opacity;\n }\n };\n\n private _getLineOpacity = (legend: string): number => {\n if (!this._isMultiStackChart) {\n return 1;\n } else {\n let opacity = 0.3;\n if (this.state.isCalloutVisible) {\n opacity = 1;\n }\n if (!this._noLegendHighlighted()) {\n opacity = this._legendHighlighted(legend) ? 0 : 0.1;\n }\n return opacity;\n }\n };\n\n private _updateCircleFillColor = (xDataPoint: number | Date, lineColor: string, circleId: string): string => {\n let fillColor = lineColor;\n if (this.state.nearestCircleToHighlight === xDataPoint || this.state.activePoint === circleId) {\n this._highlightedCircleId = circleId;\n if (!this.state.isCircleClicked) {\n fillColor = this.props.theme!.palette.white;\n }\n }\n\n return fillColor;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _drawGraph = (containerHeight: number, xScale: any, yScale: any, xElement: SVGElement): JSX.Element[] => {\n const points = this._addDefaultColors(this.props.data.lineChartData);\n const { pointOptions, pointLineOptions } = this.props.data;\n const area = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((d: any) => yScale(d.values[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((d: any) => yScale(d.values[1]))\n .curve(d3CurveBasis);\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d.values[1]))\n .curve(d3CurveBasis);\n\n const graph: JSX.Element[] = [];\n let lineColor: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._stackedData.forEach((singleStackedData: Array<any>, index: number) => {\n graph.push(\n <React.Fragment key={`${index}-graph-${this._uniqueIdForGraph}`}>\n <path\n id={`${index}-line-${this._uniqueIdForGraph}`}\n d={line(singleStackedData)!}\n fill={'transparent'}\n strokeWidth={3}\n stroke={this._colors[index]}\n opacity={this._getLineOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n {...points[index]!.lineOptions}\n />\n {singleStackedData.length === 1 ? (\n <circle\n id={`${index}-graph-${this._uniqueIdForGraph}`}\n cx={xScale(singleStackedData[0].xVal)}\n cy={yScale(singleStackedData[0].values[1])}\n r={6}\n stroke={this._colors[index]}\n strokeWidth={3}\n fill={this._colors[index]}\n opacity={this._opacity[index]}\n fillOpacity={this._getOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n />\n ) : (\n <path\n id={`${index}-graph-${this._uniqueIdForGraph}`}\n d={area(singleStackedData)!}\n fill={this._colors[index]}\n opacity={this._opacity[index]}\n fillOpacity={this._getOpacity(points[index]!.legend)}\n onMouseMove={this._onRectMouseMove}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n {...(this.props.optimizeLargeData && {\n 'data-is-focusable': true,\n role: 'img',\n 'aria-label': `${points[index].legend}, series ${index + 1} of ${points.length} with ${\n points[index].data.length\n } data points.`,\n })}\n />\n )}\n </React.Fragment>,\n );\n });\n\n const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._stackedData.forEach((singleStackedData: Array<any>, index: number) => {\n if (points.length === index) {\n return;\n }\n\n if (!this.props.optimizeLargeData || singleStackedData.length === 1) {\n // Render circles for all data points\n graph.push(\n <g key={`${index}-dots-${this._uniqueIdForGraph}`} d={area(singleStackedData)!} clipPath=\"url(#clip)\">\n {singleStackedData.map((singlePoint: IDPointType, pointIndex: number) => {\n const circleId = `${this._circleId}_${index * this._stackedData[0].length + pointIndex}`;\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n lineColor = points[index]!.color!;\n return (\n <circle\n key={circleId}\n id={circleId}\n data-is-focusable={true}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={this._updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n onClick={this._onDataPointClick.bind(this, points[index]!.data[pointIndex].onDataPointClick!)}\n onFocus={() => this._handleFocus(index, pointIndex, circleId)}\n onBlur={this._handleBlur}\n {...pointOptions}\n r={this._getCircleRadius(xDataPoint, circleRadius, circleId)}\n role=\"img\"\n aria-label={this._getAriaLabel(index, pointIndex)}\n />\n );\n })}\n </g>,\n );\n } else {\n // Render circles for data points close to the mouse pointer only\n singleStackedData.forEach((singlePoint: IDPointType, pointIndex: number) => {\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n if (this.state.nearestCircleToHighlight === xDataPoint) {\n const circleId = `${this._circleId}_${index * this._stackedData[0].length + pointIndex}`;\n lineColor = points[index]!.color!;\n graph.push(\n <circle\n key={circleId}\n id={circleId}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={this._updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={this._onRectMouseOut}\n onMouseOver={this._onRectMouseMove}\n onClick={this._onDataPointClick.bind(this, points[index]!.data[pointIndex].onDataPointClick!)}\n {...pointOptions}\n r={this._getCircleRadius(xDataPoint, circleRadius, circleId)}\n />,\n );\n }\n });\n }\n });\n graph.push(\n <line\n id={this._verticalLineId}\n key={this._verticalLineId}\n x1={this.state.lineXValue}\n y1={0}\n x2={this.state.lineXValue}\n y2={containerHeight}\n strokeWidth={1}\n strokeDasharray={5.5}\n stroke={lineColor!}\n opacity={0.5}\n visibility={this.state.displayOfLine}\n {...pointLineOptions}\n />,\n );\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!this.props.showXAxisLablesTooltip) {\n try {\n document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!this.props.wrapXAxisLables && this.props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale);\n try {\n document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classNames.tooltip!,\n id: this._tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return graph;\n };\n\n private _getCircleRadius = (xDataPoint: number, circleRadius: number, circleId: string): number => {\n const { isCircleClicked, nearestCircleToHighlight, activePoint } = this.state;\n if (isCircleClicked && nearestCircleToHighlight === xDataPoint) {\n return 1;\n } else if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {\n return circleRadius;\n } else {\n return 0;\n }\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legend: string) => {\n return (\n this.state.selectedLegend === legend || (this.state.selectedLegend === '' && this.state.activeLegend === legend)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _addDefaultColors = (lineChartData?: ILineChartPoints[]): ILineChartPoints[] => {\n return lineChartData\n ? lineChartData.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n\n private _handleFocus = (lineIndex: number, pointIndex: number, circleId: string) => {\n const { x, y, xAxisCalloutData } = this.props.data.lineChartData![lineIndex].data[pointIndex];\n const formattedDate = x instanceof Date ? x.toLocaleString() : x;\n const modifiedXVal = x instanceof Date ? x.getTime() : x;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = this._calloutPoints.find((e: { x: string | number }) => e.x === modifiedXVal);\n // Show details in the callout for the focused point only\n found.values = found.values.filter((e: { y: number }) => e.y === y);\n\n this.setState({\n refSelected: `#${circleId}`,\n isCalloutVisible: true,\n hoverXValue: xAxisCalloutData ? xAxisCalloutData : formattedDate,\n YValueHover: found.values,\n stackCalloutProps: found,\n dataPointCalloutProps: found,\n activePoint: circleId,\n });\n };\n\n private _handleBlur = () => {\n this.setState({\n refSelected: null,\n isCalloutVisible: false,\n hoverXValue: undefined,\n YValueHover: [],\n stackCalloutProps: undefined,\n dataPointCalloutProps: undefined,\n activePoint: '',\n });\n };\n\n private _getAriaLabel = (lineIndex: number, pointIndex: number): string => {\n const line = this.props.data.lineChartData![lineIndex];\n const point = line.data[pointIndex];\n const formattedDate = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n };\n}\n"]}
|
|
@@ -29,6 +29,7 @@ export interface IAreaChartProps extends ICartesianChartProps {
|
|
|
29
29
|
* The prop used to define the culture to localized the numbers
|
|
30
30
|
*/
|
|
31
31
|
culture?: string;
|
|
32
|
+
optimizeLargeData?: boolean;
|
|
32
33
|
}
|
|
33
34
|
export interface IAreaChartStyles extends ICartesianChartStyles {
|
|
34
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.types.js","sourceRoot":"../src/","sources":["components/AreaChart/AreaChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n IChartProps,\n IRefArrayData,\n IBasestate,\n ILineChartDataPoint,\n ILineChartPoints,\n ICustomizedCalloutData,\n IMargins,\n} from '../../types/index';\nimport {\n ICartesianChartStyles,\n ICartesianChartStyleProps,\n ICartesianChartProps,\n IChildProps,\n} from '../CommonComponents/CartesianChart.types';\n\nexport type { IChildProps, IRefArrayData, IBasestate, ILineChartDataPoint, ILineChartPoints, IMargins };\nexport interface IAreaChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * This prop is used to draw Y axis grid lines on the chart. Default value will be false\n * @deprecated now lines are shown by default\n * no need to use this prop\n */\n showYAxisGridLines?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ICartesianChartStyleProps, ICartesianChartStyles>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\nexport interface IAreaChartStyles extends ICartesianChartStyles {}\n\nexport interface IAreaChartStyleProps extends ICartesianChartStyleProps {}\n"]}
|
|
1
|
+
{"version":3,"file":"AreaChart.types.js","sourceRoot":"../src/","sources":["components/AreaChart/AreaChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n IChartProps,\n IRefArrayData,\n IBasestate,\n ILineChartDataPoint,\n ILineChartPoints,\n ICustomizedCalloutData,\n IMargins,\n} from '../../types/index';\nimport {\n ICartesianChartStyles,\n ICartesianChartStyleProps,\n ICartesianChartProps,\n IChildProps,\n} from '../CommonComponents/CartesianChart.types';\n\nexport type { IChildProps, IRefArrayData, IBasestate, ILineChartDataPoint, ILineChartPoints, IMargins };\nexport interface IAreaChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * This prop is used to draw Y axis grid lines on the chart. Default value will be false\n * @deprecated now lines are shown by default\n * no need to use this prop\n */\n showYAxisGridLines?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ICartesianChartStyleProps, ICartesianChartStyles>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: IRenderFunction<ICustomizedCalloutData>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /*\n * Optimize area chart rendering for large data set.\n */\n optimizeLargeData?: boolean;\n}\n\nexport interface IAreaChartStyles extends ICartesianChartStyles {}\n\nexport interface IAreaChartStyleProps extends ICartesianChartStyleProps {}\n"]}
|
|
@@ -16,14 +16,18 @@ var LegendsBase = /** @class */ (function (_super) {
|
|
|
16
16
|
function LegendsBase(props) {
|
|
17
17
|
var _this = _super.call(this, props) || this;
|
|
18
18
|
_this._onRenderData = function (data) {
|
|
19
|
-
var _a = _this.props, overflowProps = _a.overflowProps, _b = _a.allowFocusOnLegends, allowFocusOnLegends = _b === void 0 ? true : _b;
|
|
19
|
+
var _a = _this.props, overflowProps = _a.overflowProps, _b = _a.allowFocusOnLegends, allowFocusOnLegends = _b === void 0 ? true : _b, _c = _a.canSelectMultipleLegends, canSelectMultipleLegends = _c === void 0 ? false : _c;
|
|
20
20
|
var rootStyles = {
|
|
21
21
|
root: {
|
|
22
22
|
justifyContent: _this.props.centerLegends ? 'center' : 'unset',
|
|
23
23
|
flexWrap: 'wrap',
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
-
return (React.createElement(react_focus_1.FocusZone, tslib_1.__assign({}, (allowFocusOnLegends && {
|
|
26
|
+
return (React.createElement(react_focus_1.FocusZone, tslib_1.__assign({}, (allowFocusOnLegends && {
|
|
27
|
+
role: 'listbox',
|
|
28
|
+
'aria-label': 'Legends',
|
|
29
|
+
'aria-multiselectable': canSelectMultipleLegends,
|
|
30
|
+
})),
|
|
27
31
|
React.createElement(OverflowSet_1.OverflowSet, tslib_1.__assign({ items: data.primary, overflowItems: data.overflow, onRenderItem: _this._renderButton, onRenderOverflowButton: _this._renderOverflowItems }, overflowProps, { styles: tslib_1.__assign(tslib_1.__assign({}, rootStyles), overflowProps === null || overflowProps === void 0 ? void 0 : overflowProps.styles) }))));
|
|
28
32
|
};
|
|
29
33
|
_this._onReduceData = function (currentdata) {
|
|
@@ -84,7 +88,7 @@ var LegendsBase = /** @class */ (function (_super) {
|
|
|
84
88
|
}
|
|
85
89
|
};
|
|
86
90
|
_this._onRenderCompactCard = function (expandingCard) {
|
|
87
|
-
var _a = _this.props, _b = _a.allowFocusOnLegends, allowFocusOnLegends = _b === void 0 ? true : _b, className = _a.className, styles = _a.styles, theme = _a.theme;
|
|
91
|
+
var _a = _this.props, _b = _a.allowFocusOnLegends, allowFocusOnLegends = _b === void 0 ? true : _b, className = _a.className, styles = _a.styles, theme = _a.theme, _c = _a.canSelectMultipleLegends, canSelectMultipleLegends = _c === void 0 ? false : _c;
|
|
88
92
|
var overflowHoverCardLegends = [];
|
|
89
93
|
var classNames = getClassNames(styles, {
|
|
90
94
|
theme: theme,
|
|
@@ -94,7 +98,11 @@ var LegendsBase = /** @class */ (function (_super) {
|
|
|
94
98
|
var hoverCardElement = _this._renderButton(legend, index, true);
|
|
95
99
|
overflowHoverCardLegends.push(hoverCardElement);
|
|
96
100
|
});
|
|
97
|
-
var hoverCardData = (React.createElement(react_focus_1.FocusZone, tslib_1.__assign({}, (allowFocusOnLegends && {
|
|
101
|
+
var hoverCardData = (React.createElement(react_focus_1.FocusZone, tslib_1.__assign({}, (allowFocusOnLegends && {
|
|
102
|
+
role: 'listbox',
|
|
103
|
+
'aria-label': 'Legends',
|
|
104
|
+
'aria-multiselectable': canSelectMultipleLegends,
|
|
105
|
+
}), { direction: react_focus_1.FocusZoneDirection.vertical }, _this.props.focusZonePropsInHoverCard, { className: classNames.hoverCardRoot }), overflowHoverCardLegends));
|
|
98
106
|
return hoverCardData;
|
|
99
107
|
};
|
|
100
108
|
_this._renderOverflowItems = function (legends) {
|
|
@@ -191,7 +199,7 @@ var LegendsBase = /** @class */ (function (_super) {
|
|
|
191
199
|
return (React.createElement("button", tslib_1.__assign({}, (allowFocusOnLegends && {
|
|
192
200
|
'aria-selected': _this.state.selectedLegend === legend.title,
|
|
193
201
|
role: 'option',
|
|
194
|
-
'aria-label': legend.title
|
|
202
|
+
'aria-label': "" + legend.title,
|
|
195
203
|
'aria-setsize': data['aria-setsize'],
|
|
196
204
|
'aria-posinset': data['aria-posinset'],
|
|
197
205
|
}), (data.nativeButtonProps && tslib_1.__assign({}, data.nativeButtonProps)), { key: index, className: classNames.legend, onClick: onClickHandler, onMouseOver: onHoverHandler, onMouseOut: onMouseOut, onFocus: onHoverHandler, onBlur: onMouseOut, "data-is-focusable": allowFocusOnLegends }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legends.base.js","sourceRoot":"../src/","sources":["components/Legends/Legends.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,2DAA8F;AAC9F,2DAA2G;AAC3G,+DAA8D;AAE9D,+DAAqF;AACrF,qDAAsE;AAStE,iCAAgC;AAEhC,uDAAiE;AAEjE,IAAM,aAAa,GAAG,8BAAkB,EAAqC,CAAC;AAuB9E;IAAiC,uCAA4C;IAI3E,qBAAmB,KAAoB;QAAvC,YACE,kBAAM,KAAK,CAAC,SAOb;QAuDO,mBAAa,GAAG,UAAC,IAAiD;YAClE,IAAA,KAAgD,KAAI,CAAC,KAAK,EAAxD,aAAa,mBAAA,EAAE,2BAA0B,EAA1B,mBAAmB,mBAAG,IAAI,KAAe,CAAC;YACjE,IAAM,UAAU,GAAG;gBACjB,IAAI,EAAE;oBACJ,cAAc,EAAE,KAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;oBAC7D,QAAQ,EAAE,MAAM;iBACjB;aACF,CAAC;YACF,OAAO,CACL,oBAAC,uBAAS,uBAAK,CAAC,mBAAmB,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;gBAClF,oBAAC,yBAAW,qBACV,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,aAAa,EAAE,IAAI,CAAC,QAAQ,EAC5B,YAAY,EAAE,KAAI,CAAC,aAAa,EAChC,sBAAsB,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AAI,GACnC,CACH,CAAC;IACJ,CAAC;IAEO,+BAAS,GAAjB,UAAkB,KAAa,EAAE,KAAa;QACpC,IAAA,KAAK,GAAK,IAAI,CAAC,KAAK,MAAf,CAAgB;QACrB,IAAA,OAAO,GAAK,KAAM,QAAX,CAAY;QAC3B,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;QAClG,IAAI,eAAe,EAAE;YACnB,0CAA0C;YAC1C,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBACzF,iEAAiE;gBACjE,WAAW,GAAG,KAAK,CAAC;aACrB;iBAAM;gBACL,wCAAwC;gBACxC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;aAC7B;SACF;aAAM;YACL,+BAA+B;YAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,EAAE;gBACvE;;;mBAGG;gBACH,WAAW,GAAG,KAAK,CAAC;aACrB;iBAAM;gBACL,uEAAuE;gBACvE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;aAC7B;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AA7WD,CAAiC,KAAK,CAAC,SAAS,GA6W/C;AA7WY,kCAAW","sourcesContent":["import * as React from 'react';\n\nimport { IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu';\nimport { HoverCard, HoverCardType, IExpandingCardProps } from '@fluentui/react/lib/HoverCard';\nimport { classNamesFunction, find, getNativeProps, buttonProperties } from '@fluentui/react/lib/Utilities';\nimport { ResizeGroup } from '@fluentui/react/lib/ResizeGroup';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { OverflowSet, IOverflowSetItemProps } from '@fluentui/react/lib/OverflowSet';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport {\n ILegend,\n ILegendsProps,\n LegendShape,\n ILegendsStyles,\n ILegendStyleProps,\n ILegendOverflowData,\n} from './Legends.types';\nimport { Shape } from './shape';\n\nimport { silceOrAppendToArray } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ILegendStyleProps, ILegendsStyles>();\n\n// This is an internal interface used for rendering the legends with unique key\ninterface ILegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\nexport interface ILegendState {\n selectedLegend: string;\n activeLegend: string;\n isHoverCardVisible: boolean;\n selectedLegends: string[];\n}\nexport class LegendsBase extends React.Component<ILegendsProps, ILegendState> {\n private _hoverCardRef: HTMLDivElement;\n private _classNames: IProcessedStyleSet<ILegendsStyles>;\n\n public constructor(props: ILegendsProps) {\n super(props);\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n isHoverCardVisible: false,\n selectedLegends: [],\n };\n }\n\n public render(): JSX.Element {\n const { theme, className, styles } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const dataToRender = this._generateData();\n return (\n <div className={this._classNames.root}>\n {this.props.enabledWrapLines ? (\n this._onRenderData(dataToRender)\n ) : (\n <ResizeGroup\n data={dataToRender}\n onReduceData={this._onReduceData}\n onRenderData={this._onRenderData}\n onGrowData={this._onGrowData}\n />\n )}\n </div>\n );\n }\n\n private _generateData(): ILegendOverflowData {\n const { allowFocusOnLegends = true } = this.props;\n const dataItems: ILegendItem[] = this.props.legends.map((legend: ILegend, index: number) => {\n return {\n ...(allowFocusOnLegends && {\n nativeButtonProps: getNativeProps<React.HTMLAttributes<HTMLButtonElement>>(legend, buttonProperties, [\n 'title',\n ]),\n 'aria-setsize': this.props.legends.length,\n 'aria-posinset': index + 1,\n }),\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n const result: ILegendOverflowData = {\n primary: dataItems,\n overflow: [],\n };\n return result;\n }\n\n private _onRenderData = (data: IOverflowSetItemProps | ILegendOverflowData): JSX.Element => {\n const { overflowProps, allowFocusOnLegends = true } = this.props;\n const rootStyles = {\n root: {\n justifyContent: this.props.centerLegends ? 'center' : 'unset',\n flexWrap: 'wrap',\n },\n };\n return (\n <FocusZone {...(allowFocusOnLegends && { role: 'listbox', 'aria-label': 'Legends' })}>\n <OverflowSet\n items={data.primary}\n overflowItems={data.overflow}\n onRenderItem={this._renderButton}\n onRenderOverflowButton={this._renderOverflowItems}\n {...overflowProps}\n styles={{ ...rootStyles, ...overflowProps?.styles }}\n />\n </FocusZone>\n );\n };\n\n private _onReduceData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.primary.length === 0) {\n return;\n }\n const overflow = [...currentdata.primary.slice(-1), ...currentdata.overflow];\n const primary = currentdata.primary.slice(0, -1);\n return { primary, overflow };\n };\n\n private _onGrowData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.overflow.length === 0) {\n return;\n }\n const overflow = currentdata.overflow.slice(1);\n const primary = [...currentdata.primary, ...currentdata.overflow.slice(0, 1)];\n return { primary, overflow };\n };\n\n /**\n * This function will get called when there is an ability to\n * select multiple legends\n * @param legend ILegend\n */\n private _canSelectMultipleLegends = (legend: ILegend): void => {\n const selectedLegends = silceOrAppendToArray(this.state.selectedLegends, legend.title);\n this.setState({\n //check if user selected all legends then empty it get the default behaviour\n selectedLegends: selectedLegends.length === this.props.legends.length ? [] : selectedLegends,\n });\n };\n\n /**\n * This function will get called when there is\n * ability to select only single legend\n * @param legend ILegend\n */\n\n private _canSelectOnlySingleLegend = (legend: ILegend): void => {\n if (this.state.selectedLegend === legend.title) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legend.title,\n });\n }\n };\n\n private _onClick = (legend: ILegend): void => {\n if (legend.action) {\n const { canSelectMultipleLegends = false } = this.props;\n if (canSelectMultipleLegends) {\n this._canSelectMultipleLegends(legend);\n } else {\n this._canSelectOnlySingleLegend(legend);\n }\n legend.action();\n }\n };\n\n private _onRenderCompactCard = (expandingCard: IExpandingCardProps): JSX.Element => {\n const { allowFocusOnLegends = true, className, styles, theme } = this.props;\n const overflowHoverCardLegends: JSX.Element[] = [];\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n expandingCard.renderData.forEach((legend: IOverflowSetItemProps, index: number) => {\n const hoverCardElement = this._renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const hoverCardData = (\n <FocusZone\n {...(allowFocusOnLegends && { role: 'listbox' })}\n direction={FocusZoneDirection.vertical}\n {...this.props.focusZonePropsInHoverCard}\n className={classNames.hoverCardRoot}\n >\n {overflowHoverCardLegends}\n </FocusZone>\n );\n return hoverCardData;\n };\n\n private _renderOverflowItems = (legends: ILegend[]) => {\n const { allowFocusOnLegends = true } = this.props;\n const items: IContextualMenuItem[] = [];\n legends.forEach((legend: ILegend, i: number) => {\n items.push({ key: i.toString(), name: legend.title, onClick: legend.action });\n });\n const renderOverflowData: IExpandingCardProps = { renderData: legends };\n const { theme, className, styles, overflowText } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const plainCardProps = {\n onRenderPlainCard: this._onRenderCompactCard,\n renderData: renderOverflowData,\n };\n\n const overflowString = overflowText ? overflowText : 'more';\n // execute similar to \"_onClick\" and \"_onLeave\" logic at HoverCard onCardHide event\n const onHoverCardHideHandler = () => {\n this.setState({ isHoverCardVisible: false });\n /** Unhighlight the focused legend in the hover card */\n const activeOverflowItem = find(legends, (legend: ILegend) => legend.title === this.state.activeLegend);\n if (activeOverflowItem) {\n this.setState({ activeLegend: '' });\n if (activeOverflowItem.onMouseOutAction) {\n activeOverflowItem.onMouseOutAction();\n }\n }\n };\n return (\n <HoverCard\n type={HoverCardType.plain}\n plainCardProps={plainCardProps}\n instantOpenOnClick={true}\n // eslint-disable-next-line react/jsx-no-bind\n onCardHide={onHoverCardHideHandler}\n setInitialFocus={true}\n trapFocus={true}\n onCardVisible={this._hoverCardVisible}\n styles={classNames.subComponentStyles.hoverCardStyles}\n cardDismissDelay={300}\n target={this._hoverCardRef}\n >\n <div\n className={classNames.overflowIndicationTextStyle}\n ref={(rootElem: HTMLDivElement) => (this._hoverCardRef = rootElem)}\n {...(allowFocusOnLegends && {\n role: 'button',\n 'aria-expanded': this.state.isHoverCardVisible,\n 'aria-label': `${items.length} ${overflowString}`,\n })}\n data-is-focusable={allowFocusOnLegends}\n >\n {items.length} {overflowString}\n </div>\n </HoverCard>\n );\n };\n\n private _hoverCardVisible = () => {\n this.setState({ isHoverCardVisible: true });\n };\n\n private _onHoverOverLegend = (legend: ILegend) => {\n if (legend.hoverAction) {\n this.setState({ activeLegend: legend.title });\n legend.hoverAction();\n }\n };\n\n private _onLeave = (legend: ILegend) => {\n if (legend.onMouseOutAction) {\n this.setState({ activeLegend: '' });\n legend.onMouseOutAction();\n }\n };\n\n private _renderButton = (data: IOverflowSetItemProps, index?: number, overflow?: boolean) => {\n const { allowFocusOnLegends = true } = this.props;\n const legend: ILegend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = this._getColor(legend.title, legend.color);\n const { theme, className, styles } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n colorOnSelectedState: color,\n borderColor: legend.color,\n overflow: overflow,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n });\n const onClickHandler = () => {\n this._onClick(legend);\n };\n const onHoverHandler = () => {\n this._onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n this._onLeave(legend);\n };\n const shape = this._getShape(classNames, legend, color);\n return (\n <button\n {...(allowFocusOnLegends && {\n 'aria-selected': this.state.selectedLegend === legend.title,\n role: 'option',\n 'aria-label': `${legend.title} selected`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classNames.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n data-is-focusable={allowFocusOnLegends}\n /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classNames.text}>{legend.title}</div>\n </button>\n );\n };\n\n private _getShape(\n classNames: IProcessedStyleSet<ILegendsStyles>,\n legend: ILegend,\n color: string,\n ): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classNames.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classNames.rect}\n />\n );\n }\n\n private _getColor(title: string, color: string): string {\n const { theme } = this.props;\n const { palette } = theme!;\n let legendColor = color;\n const inSelectedState = this.state.selectedLegend !== '' || this.state.selectedLegends.length > 0;\n if (inSelectedState) {\n /** if one or more legends are selected */\n if (this.state.selectedLegend === title || this.state.selectedLegends.indexOf(title) > -1) {\n /** if the given legend (title) is one of the selected legends */\n legendColor = color;\n } else {\n /** if the given legend is unselected */\n legendColor = palette.white;\n }\n } else {\n /** if no legend is selected */\n if (this.state.activeLegend === title || this.state.activeLegend === '') {\n /**\n * if the given legend is hovered\n * or none of the legends is hovered\n */\n legendColor = color;\n } else {\n /** if there is a hovered legend but the given legend is not the one */\n legendColor = palette.white;\n }\n }\n return legendColor;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Legends.base.js","sourceRoot":"../src/","sources":["components/Legends/Legends.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,2DAA8F;AAC9F,2DAA2G;AAC3G,+DAA8D;AAE9D,+DAAqF;AACrF,qDAAsE;AAStE,iCAAgC;AAEhC,uDAAiE;AAEjE,IAAM,aAAa,GAAG,8BAAkB,EAAqC,CAAC;AAuB9E;IAAiC,uCAA4C;IAI3E,qBAAmB,KAAoB;QAAvC,YACE,kBAAM,KAAK,CAAC,SAOb;QAuDO,mBAAa,GAAG,UAAC,IAAiD;YAClE,IAAA,KAAkF,KAAI,CAAC,KAAK,EAA1F,aAAa,mBAAA,EAAE,2BAA0B,EAA1B,mBAAmB,mBAAG,IAAI,KAAA,EAAE,gCAAgC,EAAhC,wBAAwB,mBAAG,KAAK,KAAe,CAAC;YACnG,IAAM,UAAU,GAAG;gBACjB,IAAI,EAAE;oBACJ,cAAc,EAAE,KAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;oBAC7D,QAAQ,EAAE,MAAM;iBACjB;aACF,CAAC;YACF,OAAO,CACL,oBAAC,uBAAS,uBACJ,CAAC,mBAAmB,IAAI;gBAC1B,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;gBACvB,sBAAsB,EAAE,wBAAwB;aACjD,CAAC;gBAEF,oBAAC,yBAAW,qBACV,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,aAAa,EAAE,IAAI,CAAC,QAAQ,EAC5B,YAAY,EAAE,KAAI,CAAC,aAAa,EA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,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,MAAM,CAAC,KAAoB,EAClC,kBAAkB,EAAE,UAAU,CAAC,IAAI,GACnC,CACH,CAAC;IACJ,CAAC;IAEO,+BAAS,GAAjB,UAAkB,KAAa,EAAE,KAAa;QACpC,IAAA,KAAK,GAAK,IAAI,CAAC,KAAK,MAAf,CAAgB;QACrB,IAAA,OAAO,GAAK,KAAM,QAAX,CAAY;QAC3B,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;QAClG,IAAI,eAAe,EAAE;YACnB,0CAA0C;YAC1C,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBACzF,iEAAiE;gBACjE,WAAW,GAAG,KAAK,CAAC;aACrB;iBAAM;gBACL,wCAAwC;gBACxC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;aAC7B;SACF;aAAM;YACL,+BAA+B;YAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,EAAE;gBACvE;;;mBAGG;gBACH,WAAW,GAAG,KAAK,CAAC;aACrB;iBAAM;gBACL,uEAAuE;gBACvE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;aAC7B;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AAvXD,CAAiC,KAAK,CAAC,SAAS,GAuX/C;AAvXY,kCAAW","sourcesContent":["import * as React from 'react';\n\nimport { IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu';\nimport { HoverCard, HoverCardType, IExpandingCardProps } from '@fluentui/react/lib/HoverCard';\nimport { classNamesFunction, find, getNativeProps, buttonProperties } from '@fluentui/react/lib/Utilities';\nimport { ResizeGroup } from '@fluentui/react/lib/ResizeGroup';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { OverflowSet, IOverflowSetItemProps } from '@fluentui/react/lib/OverflowSet';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport {\n ILegend,\n ILegendsProps,\n LegendShape,\n ILegendsStyles,\n ILegendStyleProps,\n ILegendOverflowData,\n} from './Legends.types';\nimport { Shape } from './shape';\n\nimport { silceOrAppendToArray } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ILegendStyleProps, ILegendsStyles>();\n\n// This is an internal interface used for rendering the legends with unique key\ninterface ILegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\nexport interface ILegendState {\n selectedLegend: string;\n activeLegend: string;\n isHoverCardVisible: boolean;\n selectedLegends: string[];\n}\nexport class LegendsBase extends React.Component<ILegendsProps, ILegendState> {\n private _hoverCardRef: HTMLDivElement;\n private _classNames: IProcessedStyleSet<ILegendsStyles>;\n\n public constructor(props: ILegendsProps) {\n super(props);\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n isHoverCardVisible: false,\n selectedLegends: [],\n };\n }\n\n public render(): JSX.Element {\n const { theme, className, styles } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const dataToRender = this._generateData();\n return (\n <div className={this._classNames.root}>\n {this.props.enabledWrapLines ? (\n this._onRenderData(dataToRender)\n ) : (\n <ResizeGroup\n data={dataToRender}\n onReduceData={this._onReduceData}\n onRenderData={this._onRenderData}\n onGrowData={this._onGrowData}\n />\n )}\n </div>\n );\n }\n\n private _generateData(): ILegendOverflowData {\n const { allowFocusOnLegends = true } = this.props;\n const dataItems: ILegendItem[] = this.props.legends.map((legend: ILegend, index: number) => {\n return {\n ...(allowFocusOnLegends && {\n nativeButtonProps: getNativeProps<React.HTMLAttributes<HTMLButtonElement>>(legend, buttonProperties, [\n 'title',\n ]),\n 'aria-setsize': this.props.legends.length,\n 'aria-posinset': index + 1,\n }),\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n };\n });\n const result: ILegendOverflowData = {\n primary: dataItems,\n overflow: [],\n };\n return result;\n }\n\n private _onRenderData = (data: IOverflowSetItemProps | ILegendOverflowData): JSX.Element => {\n const { overflowProps, allowFocusOnLegends = true, canSelectMultipleLegends = false } = this.props;\n const rootStyles = {\n root: {\n justifyContent: this.props.centerLegends ? 'center' : 'unset',\n flexWrap: 'wrap',\n },\n };\n return (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n >\n <OverflowSet\n items={data.primary}\n overflowItems={data.overflow}\n onRenderItem={this._renderButton}\n onRenderOverflowButton={this._renderOverflowItems}\n {...overflowProps}\n styles={{ ...rootStyles, ...overflowProps?.styles }}\n />\n </FocusZone>\n );\n };\n\n private _onReduceData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.primary.length === 0) {\n return;\n }\n const overflow = [...currentdata.primary.slice(-1), ...currentdata.overflow];\n const primary = currentdata.primary.slice(0, -1);\n return { primary, overflow };\n };\n\n private _onGrowData = (currentdata: IOverflowSetItemProps): {} | void => {\n if (currentdata.overflow.length === 0) {\n return;\n }\n const overflow = currentdata.overflow.slice(1);\n const primary = [...currentdata.primary, ...currentdata.overflow.slice(0, 1)];\n return { primary, overflow };\n };\n\n /**\n * This function will get called when there is an ability to\n * select multiple legends\n * @param legend ILegend\n */\n private _canSelectMultipleLegends = (legend: ILegend): void => {\n const selectedLegends = silceOrAppendToArray(this.state.selectedLegends, legend.title);\n this.setState({\n //check if user selected all legends then empty it get the default behaviour\n selectedLegends: selectedLegends.length === this.props.legends.length ? [] : selectedLegends,\n });\n };\n\n /**\n * This function will get called when there is\n * ability to select only single legend\n * @param legend ILegend\n */\n\n private _canSelectOnlySingleLegend = (legend: ILegend): void => {\n if (this.state.selectedLegend === legend.title) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legend.title,\n });\n }\n };\n\n private _onClick = (legend: ILegend): void => {\n if (legend.action) {\n const { canSelectMultipleLegends = false } = this.props;\n if (canSelectMultipleLegends) {\n this._canSelectMultipleLegends(legend);\n } else {\n this._canSelectOnlySingleLegend(legend);\n }\n legend.action();\n }\n };\n\n private _onRenderCompactCard = (expandingCard: IExpandingCardProps): JSX.Element => {\n const { allowFocusOnLegends = true, className, styles, theme, canSelectMultipleLegends = false } = this.props;\n const overflowHoverCardLegends: JSX.Element[] = [];\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n expandingCard.renderData.forEach((legend: IOverflowSetItemProps, index: number) => {\n const hoverCardElement = this._renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const hoverCardData = (\n <FocusZone\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n direction={FocusZoneDirection.vertical}\n {...this.props.focusZonePropsInHoverCard}\n className={classNames.hoverCardRoot}\n >\n {overflowHoverCardLegends}\n </FocusZone>\n );\n return hoverCardData;\n };\n\n private _renderOverflowItems = (legends: ILegend[]) => {\n const { allowFocusOnLegends = true } = this.props;\n const items: IContextualMenuItem[] = [];\n legends.forEach((legend: ILegend, i: number) => {\n items.push({ key: i.toString(), name: legend.title, onClick: legend.action });\n });\n const renderOverflowData: IExpandingCardProps = { renderData: legends };\n const { theme, className, styles, overflowText } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n const plainCardProps = {\n onRenderPlainCard: this._onRenderCompactCard,\n renderData: renderOverflowData,\n };\n\n const overflowString = overflowText ? overflowText : 'more';\n // execute similar to \"_onClick\" and \"_onLeave\" logic at HoverCard onCardHide event\n const onHoverCardHideHandler = () => {\n this.setState({ isHoverCardVisible: false });\n /** Unhighlight the focused legend in the hover card */\n const activeOverflowItem = find(legends, (legend: ILegend) => legend.title === this.state.activeLegend);\n if (activeOverflowItem) {\n this.setState({ activeLegend: '' });\n if (activeOverflowItem.onMouseOutAction) {\n activeOverflowItem.onMouseOutAction();\n }\n }\n };\n return (\n <HoverCard\n type={HoverCardType.plain}\n plainCardProps={plainCardProps}\n instantOpenOnClick={true}\n // eslint-disable-next-line react/jsx-no-bind\n onCardHide={onHoverCardHideHandler}\n setInitialFocus={true}\n trapFocus={true}\n onCardVisible={this._hoverCardVisible}\n styles={classNames.subComponentStyles.hoverCardStyles}\n cardDismissDelay={300}\n target={this._hoverCardRef}\n >\n <div\n className={classNames.overflowIndicationTextStyle}\n ref={(rootElem: HTMLDivElement) => (this._hoverCardRef = rootElem)}\n {...(allowFocusOnLegends && {\n role: 'button',\n 'aria-expanded': this.state.isHoverCardVisible,\n 'aria-label': `${items.length} ${overflowString}`,\n })}\n data-is-focusable={allowFocusOnLegends}\n >\n {items.length} {overflowString}\n </div>\n </HoverCard>\n );\n };\n\n private _hoverCardVisible = () => {\n this.setState({ isHoverCardVisible: true });\n };\n\n private _onHoverOverLegend = (legend: ILegend) => {\n if (legend.hoverAction) {\n this.setState({ activeLegend: legend.title });\n legend.hoverAction();\n }\n };\n\n private _onLeave = (legend: ILegend) => {\n if (legend.onMouseOutAction) {\n this.setState({ activeLegend: '' });\n legend.onMouseOutAction();\n }\n };\n\n private _renderButton = (data: IOverflowSetItemProps, index?: number, overflow?: boolean) => {\n const { allowFocusOnLegends = true } = this.props;\n const legend: ILegend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = this._getColor(legend.title, legend.color);\n const { theme, className, styles } = this.props;\n const classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n colorOnSelectedState: color,\n borderColor: legend.color,\n overflow: overflow,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n });\n const onClickHandler = () => {\n this._onClick(legend);\n };\n const onHoverHandler = () => {\n this._onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n this._onLeave(legend);\n };\n const shape = this._getShape(classNames, legend, color);\n return (\n <button\n {...(allowFocusOnLegends && {\n 'aria-selected': this.state.selectedLegend === legend.title,\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classNames.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n data-is-focusable={allowFocusOnLegends}\n /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classNames.text}>{legend.title}</div>\n </button>\n );\n };\n\n private _getShape(\n classNames: IProcessedStyleSet<ILegendsStyles>,\n legend: ILegend,\n color: string,\n ): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classNames.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classNames.rect}\n />\n );\n }\n\n private _getColor(title: string, color: string): string {\n const { theme } = this.props;\n const { palette } = theme!;\n let legendColor = color;\n const inSelectedState = this.state.selectedLegend !== '' || this.state.selectedLegends.length > 0;\n if (inSelectedState) {\n /** if one or more legends are selected */\n if (this.state.selectedLegend === title || this.state.selectedLegends.indexOf(title) > -1) {\n /** if the given legend (title) is one of the selected legends */\n legendColor = color;\n } else {\n /** if the given legend is unselected */\n legendColor = palette.white;\n }\n } else {\n /** if no legend is selected */\n if (this.state.activeLegend === title || this.state.activeLegend === '') {\n /**\n * if the given legend is hovered\n * or none of the legends is hovered\n */\n legendColor = color;\n } else {\n /** if there is a hovered legend but the given legend is not the one */\n legendColor = palette.white;\n }\n }\n return legendColor;\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export interface IVerticalBarChartState extends IBasestate {
|
|
|
10
10
|
hoverXValue?: string | number | null;
|
|
11
11
|
callOutAccessibilityData?: IAccessibilityProps;
|
|
12
12
|
calloutLegend: string;
|
|
13
|
+
emptyChart?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare class VerticalBarChartBase extends React.Component<IVerticalBarChartProps, IVerticalBarChartState> {
|
|
15
16
|
private _points;
|
|
@@ -29,6 +30,7 @@ export declare class VerticalBarChartBase extends React.Component<IVerticalBarCh
|
|
|
29
30
|
private _calloutAnchorPoint;
|
|
30
31
|
private _domainMargin;
|
|
31
32
|
constructor(props: IVerticalBarChartProps);
|
|
33
|
+
componentDidMount(): void;
|
|
32
34
|
render(): JSX.Element;
|
|
33
35
|
private _createLine;
|
|
34
36
|
private _checkForLine;
|
|
@@ -318,6 +318,7 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
318
318
|
YValueHover: [],
|
|
319
319
|
hoverXValue: '',
|
|
320
320
|
calloutLegend: '',
|
|
321
|
+
emptyChart: false,
|
|
321
322
|
};
|
|
322
323
|
_this._isHavingLine = _this._checkForLine();
|
|
323
324
|
_this._calloutId = Utilities_1.getId('callout');
|
|
@@ -330,6 +331,14 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
330
331
|
_this._domainMargin = MIN_DOMAIN_MARGIN;
|
|
331
332
|
return _this;
|
|
332
333
|
}
|
|
334
|
+
VerticalBarChartBase.prototype.componentDidMount = function () {
|
|
335
|
+
var isChartEmpty = this.state.emptyChart ||
|
|
336
|
+
this._points.length === 0 ||
|
|
337
|
+
(d3_array_1.max(this._points, function (point) { return point.y; }) <= 0 && !this._isHavingLine);
|
|
338
|
+
if (this.state.emptyChart !== isChartEmpty) {
|
|
339
|
+
this.setState({ emptyChart: isChartEmpty });
|
|
340
|
+
}
|
|
341
|
+
};
|
|
333
342
|
VerticalBarChartBase.prototype.render = function () {
|
|
334
343
|
var _this = this;
|
|
335
344
|
this._adjustProps();
|
|
@@ -348,14 +357,14 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
348
357
|
tickValues: this.props.tickValues,
|
|
349
358
|
tickFormat: this.props.tickFormat,
|
|
350
359
|
};
|
|
351
|
-
return (React.createElement(index_1.CartesianChart, tslib_1.__assign({}, this.props, { points: this._points, chartType: index_2.ChartTypes.VerticalBarChart, xAxisType: this._xAxisType, calloutProps: calloutProps, tickParams: tickParams }, (this._isHavingLine && { isCalloutForStack: true }), { legendBars: legendBars, datasetForXAxisDomain: this._xAxisLabels, barwidth: this._barWidth, focusZoneDirection: react_focus_1.FocusZoneDirection.horizontal, customizedCallout: this._getCustomizedCallout(), getmargins: this._getMargins, getGraphData: this._getGraphData, getAxisData: this._getAxisData, onChartMouseLeave: this._handleChartMouseLeave, getDomainMargins: this._getDomainMargins }, (this._xAxisType !== index_2.XAxisTypes.NumericAxis && { xAxisInnerPadding: 2 / 3, xAxisOuterPadding: 0 }), {
|
|
360
|
+
return !this.state.emptyChart ? (React.createElement(index_1.CartesianChart, tslib_1.__assign({}, this.props, { points: this._points, chartType: index_2.ChartTypes.VerticalBarChart, xAxisType: this._xAxisType, calloutProps: calloutProps, tickParams: tickParams }, (this._isHavingLine && { isCalloutForStack: true }), { legendBars: legendBars, datasetForXAxisDomain: this._xAxisLabels, barwidth: this._barWidth, focusZoneDirection: react_focus_1.FocusZoneDirection.horizontal, customizedCallout: this._getCustomizedCallout(), getmargins: this._getMargins, getGraphData: this._getGraphData, getAxisData: this._getAxisData, onChartMouseLeave: this._handleChartMouseLeave, getDomainMargins: this._getDomainMargins }, (this._xAxisType !== index_2.XAxisTypes.NumericAxis && { xAxisInnerPadding: 2 / 3, xAxisOuterPadding: 0 }), {
|
|
352
361
|
/* eslint-disable react/jsx-no-bind */
|
|
353
362
|
// eslint-disable-next-line react/no-children-prop
|
|
354
363
|
children: function (props) {
|
|
355
364
|
return (React.createElement(React.Fragment, null,
|
|
356
365
|
React.createElement("g", null, _this._bars),
|
|
357
366
|
_this._isHavingLine && (React.createElement("g", null, _this._createLine(props.xScale, props.yScale, props.containerHeight, props.containerWidth)))));
|
|
358
|
-
} })));
|
|
367
|
+
} }))) : (React.createElement("div", { id: Utilities_1.getId('_VBC_'), role: 'alert', style: { opacity: '0' }, "aria-label": 'Graph has no data to display' }));
|
|
359
368
|
};
|
|
360
369
|
VerticalBarChartBase.prototype._adjustProps = function () {
|
|
361
370
|
this._points = this.props.data || [];
|