@fluentui/react-charting 5.19.17 → 5.19.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGnG,OAAO,EAA6B,MAAM,IAAI,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtG,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAkD,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGjG,IAAM,aAAa,GAAG,kBAAkB,EAA8C,CAAC;AACvF,IAAM,kBAAkB,GAAG,GAAG,CAAC;AAmB/B,IAAM,kCAAkC,GAAW,SAAS,CAAC;AAC7D,IAAM,mBAAmB,GAAiB;IACxC,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IA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KAAK,CAAC;oBACd,MAAM;iBACP;aACF;SACF;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8DAA8D;IACtD,sCAAY,GAApB,UAAqB,IAAY,EAAE,eAAwB,EAAE,GAAQ,EAAE,GAAQ;QAC7E,IAAI,eAAe,EAAE;YACnB,yEAAyE;YACzE,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAC1B,GAAG;iBACA,IAAI,CAAC,IAAI,CAAC;iBACV,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;iBAC/B,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;SACxC;IACH,CAAC;IAED,8DAA8D;IACtD,sCAAY,GAApB,UAAqB,GAAQ;QAC3B,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IAEO,uCAAa,GAArB;QACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe;YAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CACjD,CAAC;IACJ,CAAC;IACH,sBAAC;AAAD,CAAC,AApyBD,CAAqC,KAAK,CAAC,SAAS,GAoyBnD","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { ISankeyChartData, ISankeyChartProps, ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { SankeyLayout, SankeyGraph, sankey as d3Sankey, sankeyRight, sankeyJustify } from 'd3-sankey';\nimport { area as d3Area, curveBumpX as d3CurveBasis } from 'd3-shape';\nimport { sum as d3Sum } from 'd3-array';\nimport { ChartHoverCard, IBasestate, IChartHoverCardProps, SLink, SNode } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { select, selectAll } from 'd3-selection';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IMargins } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\nconst PADDING_PERCENTAGE = 0.3;\n\ntype NodesInColumns = { [key: number]: SNode[] };\ntype NodeColors = { fillColor: string; borderColor: string };\n\nexport interface ISankeyChartState extends IBasestate, IChartHoverCardProps {\n containerWidth: number;\n containerHeight: number;\n selectedState: boolean;\n selectedLinks: Set<Number>;\n selectedNodes: Set<Number>;\n selectedNode?: SNode;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n selectedLink?: SLink;\n shouldOverflow: boolean;\n}\n\nconst NON_SELECTED_NODE_AND_STREAM_COLOR: string = '#757575';\nconst DEFAULT_NODE_COLORS: NodeColors[] = [\n { fillColor: '#00758F', borderColor: '#002E39' },\n { fillColor: '#77004D', borderColor: '#43002C' },\n { fillColor: '#4F6BED', borderColor: '#3B52B4' },\n { fillColor: '#937600', borderColor: '#6D5700' },\n { fillColor: '#286EA8', borderColor: '#00457E' },\n { fillColor: '#A43FB1', borderColor: '#7C158A' },\n { fillColor: '#CC3595', borderColor: '#7F215D' },\n { fillColor: '#0E7878', borderColor: '#004E4E' },\n { fillColor: '#8764B8', borderColor: '#4B3867' },\n { fillColor: '#9C663F', borderColor: '#6D4123' },\n];\n\nconst MIN_HEIGHT_FOR_DOUBLINE_TYPE = 36;\nconst MIN_HEIGHT_FOR_TYPE = 24;\nconst REST_STREAM_OPACITY: number = 1;\nconst NON_SELECTED_OPACITY: number = 1;\nconst SELECTED_STREAM_OPACITY: number = 0.3;\nconst NON_SELECTED_STREAM_BORDER_OPACITY: number = 0.5;\nconst DEFAULT_TEXT_COLOR: string = '#323130';\nconst NON_SELECTED_TEXT_COLOR: string = '#FFFFFF';\n\nexport class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> {\n private _classNames: IProcessedStyleSet<ISankeyChartStyles>;\n private chartContainer: HTMLDivElement;\n private _reqID: number;\n private _calloutId: string;\n private _linkId: string;\n private _nodesInColumn: NodesInColumns;\n private _sankey: SankeyLayout<SankeyGraph<{}, {}>, {}, {}>;\n private _margins: IMargins;\n private _isRtl: boolean = getRTL();\n private _normalizeData: (data: ISankeyChartData) => void;\n private _emptyChartId: string;\n\n constructor(props: ISankeyChartProps) {\n super(props);\n this.state = {\n containerHeight: 468,\n containerWidth: 912,\n selectedState: false,\n selectedLinks: new Set<number>(),\n selectedNodes: new Set<number>(),\n shouldOverflow: false,\n isCalloutVisible: false,\n };\n this._calloutId = getId('callout');\n this._linkId = getId('link');\n this._margins = { top: 36, right: 48, bottom: 32, left: 48 };\n this._preRenderLayout();\n this._normalizeData = memoizeFunction((data: ISankeyChartData) => this._normalizeSankeyData(data));\n this._emptyChartId = getId('_SankeyChart_empty');\n }\n public componentDidMount(): void {\n this._fitParentContainer();\n }\n\n public componentDidUpdate(prevProps: ISankeyChartProps): void {\n if (prevProps.shouldResize !== this.props.shouldResize) {\n this._fitParentContainer();\n }\n }\n public componentWillUnmount(): void {\n cancelAnimationFrame(this._reqID);\n }\n public render(): React.ReactNode {\n if (!this._isChartEmpty()) {\n const { theme, className, styles, pathColor } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: this.state.containerWidth,\n height: this.state.containerHeight,\n pathColor,\n className,\n });\n // We are using the this._margins.left and this._margins.top in sankey extent while constructing the layout\n const { height, width } = this._preRenderLayout();\n this._normalizeData(this.props.data.SankeyChartData!);\n let nodePadding = 8;\n nodePadding = this._adjustPadding(this._sankey, height - 6, this._nodesInColumn);\n\n this._sankey.nodePadding(nodePadding);\n this._sankey(this.props.data.SankeyChartData!);\n this._populateNodeActualValue(this.props.data.SankeyChartData!);\n this._assignNodeColors();\n const nodeData = this._createNodes(width);\n const linkData = this._createLinks();\n const calloutProps = {\n isCalloutVisible: this.state.isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${this._calloutId}`,\n target: this.state.refSelected,\n color: this.state.color,\n XValue: this.state.xCalloutValue,\n YValue: this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard,\n descriptionMessage: this.state.descriptionMessage,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: this._onCloseCallout,\n className: this._classNames.calloutContentRoot,\n preventDismissOnLostFocus: true,\n };\n return (\n <div\n className={this._classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (this.chartContainer = rootElem)}\n onMouseLeave={this._onCloseCallout}\n >\n <FocusZone\n direction={FocusZoneDirection.bidirectional}\n isCircularNavigation={true}\n handleTabKey={FocusZoneTabbableElements.all}\n >\n <svg width={width} height={height} id={getId('sankeyChart')}>\n <g className={this._classNames.links} strokeOpacity={1}>\n {linkData}\n </g>\n <g className={this._classNames.nodes}>{nodeData}</g>\n {calloutProps.isCalloutVisible && (\n <Callout {...calloutProps}>\n <ChartHoverCard\n XValue={calloutProps.XValue}\n YValue={calloutProps.YValue}\n color={calloutProps.color}\n descriptionMessage={calloutProps.descriptionMessage ? calloutProps.descriptionMessage : ''}\n />\n </Callout>\n )}\n </svg>\n </FocusZone>\n </div>\n );\n }\n return (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _preRenderLayout(): { height: number; width: number } {\n const width = this.state.containerWidth - this._margins.right!;\n const height =\n this.state.containerHeight - this._margins.bottom! > 0 ? this.state.containerHeight - this._margins.bottom! : 0;\n\n this._sankey = d3Sankey()\n .nodeWidth(124)\n .extent([\n [this._margins.left!, this._margins.top!],\n [width - 1, height - 6],\n ])\n .nodeAlign(this._isRtl ? sankeyRight : sankeyJustify);\n\n return { height, width };\n }\n\n /**\n * This is used for calculating the node non normalized value based on link non normalized value.\n *\n */\n private _populateNodeActualValue(data: ISankeyChartData) {\n data.links.forEach((link: SLink) => {\n if (!link.unnormalizedValue) {\n link.unnormalizedValue = link.value;\n }\n });\n data.nodes.forEach((node: SNode) => {\n node.actualValue = Math.max(\n d3Sum(node.sourceLinks!, (link: SLink) => link.unnormalizedValue),\n d3Sum(node.targetLinks!, (link: SLink) => link.unnormalizedValue),\n );\n });\n }\n\n private _normalizeSankeyData(data: ISankeyChartData): void {\n this._nodesInColumn = this._populateNodeInColumns(data, this._sankey);\n this._adjustOnePercentHeightNodes(this._nodesInColumn);\n }\n /**\n *\n * This is used to group nodes by column index.\n */\n private _populateNodeInColumns(graph: ISankeyChartData, sankey: SankeyLayout<SankeyGraph<{}, {}>, {}, {}>) {\n sankey(graph);\n const nodesInColumn: NodesInColumns = {};\n graph.nodes.forEach((node: SNode) => {\n const columnId = node.layer!;\n if (nodesInColumn[columnId]) {\n nodesInColumn[columnId].push(node);\n } else {\n nodesInColumn[columnId] = [node];\n }\n });\n return nodesInColumn;\n }\n\n /**\n * This is used to normalize the nodes value whose value is less than 1% of the total column value.\n *\n */\n private _adjustOnePercentHeightNodes(nodesInColumn: NodesInColumns) {\n const totalColumnValue = Object.values(nodesInColumn).map((column: SNode[]) => {\n return d3Sum(column, (node: SNode) => node.value);\n });\n totalColumnValue.forEach((columnValue: number, index: number) => {\n let totalPercentage = 0;\n nodesInColumn[index].forEach((node: SNode) => {\n const nodePercentage = (node.value! / columnValue) * 100;\n node.actualValue = node.value;\n //if the value is less than 1% then we are making it as 1% of total .\n if (nodePercentage < 1) {\n node.value = 0.01 * columnValue;\n totalPercentage = totalPercentage + 1;\n } else {\n totalPercentage = totalPercentage + nodePercentage;\n }\n });\n //since we have adjusted the value to be 1% but we need to keep the sum of the percentage value under 100.\n const scalingRatio = totalPercentage !== 0 ? totalPercentage / 100 : 1;\n if (scalingRatio > 1) {\n nodesInColumn[index].forEach((node: SNode) => {\n node.value = node.value! / scalingRatio;\n this._changeColumnValue(node, node.actualValue!, node.value);\n });\n }\n });\n }\n\n /**\n *\n * This is used for normalizing each links value for reflecting the normalized node value.\n */\n private _changeColumnValue(node: SNode, originalValue: number, normalizedValue: number) {\n node.sourceLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n node.targetLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n }\n\n /**\n *\n * This is used to introduce dynamic padding for cases where the number of nodes in a column is huge\n * so that we maintain a node to space ratio for such columns as if we fail to do so the\n * chart is devoid of nodes and only shows links.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _adjustPadding(sankey: any, height: number, nodesInColumn: NodesInColumns) {\n let padding = this._sankey.nodePadding();\n Object.values(nodesInColumn).forEach((column: SNode[]) => {\n const minPadding = PADDING_PERCENTAGE * height;\n const toatlPaddingInColumn = height - d3Sum(column, (node: SNode) => node.y1! - node.y0!);\n if (minPadding < toatlPaddingInColumn) {\n //Here we are calculating the min of default and calculated padding, we will not increase the padding\n //in any scenario.\n padding = Math.min(padding, minPadding / (column.length - 1));\n }\n });\n return padding;\n }\n\n private _createLinks(): React.ReactNode[] | undefined {\n const links: React.ReactNode[] = [];\n\n if (this.props.data.SankeyChartData) {\n this.props.data.SankeyChartData.links.forEach((singleLink: SLink, index: number) => {\n const onMouseOut = () => {\n this._onStreamLeave(singleLink);\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = (d: any) => {\n return [\n { x: d.source.x1, y0: d.y0 + d.width / 2, y1: d.y0 - d.width / 2 },\n { x: d.target.x0, y0: d.y1 + d.width / 2, y1: d.y1 - d.width / 2 },\n ];\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataPoints: Array<any> = data(singleLink);\n const linkArea = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((p: any) => p.x)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((p: any) => p.y0)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((p: any) => p.y1)\n .curve(d3CurveBasis);\n const gradientUrl = `url(#gradient-${this._linkId}-${index})`;\n const link = (\n <g key={`${this._linkId}-${index}`}>\n <defs>\n <linearGradient id={`gradient-${this._linkId}-${index}`} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0\" stopColor={(singleLink.source as SNode).color} />\n <stop offset=\"100%\" stopColor={(singleLink.target as SNode).color} />\n </linearGradient>\n </defs>\n <path\n d={linkArea(dataPoints)!}\n id={getId('link')}\n fill={this._fillStreamColors(singleLink, gradientUrl)}\n stroke={this._fillStreamBorder(singleLink, gradientUrl)}\n strokeWidth=\"2\"\n strokeOpacity={this._getOpacityStreamBorder(singleLink)}\n onMouseOver={this._onStreamHover.bind(this, singleLink)}\n onMouseOut={onMouseOut}\n onFocus={this._onFocusLink.bind(this, singleLink)}\n onBlur={this._onBlur}\n fillOpacity={this._getOpacityStream(singleLink)}\n data-is-focusable={true}\n aria-label={\n 'link from' +\n (singleLink.source as SNode).name +\n 'to' +\n (singleLink.target as SNode).name +\n 'with weight' +\n singleLink!.unnormalizedValue\n }\n role=\"img\"\n />\n </g>\n );\n links.push(link);\n });\n }\n return links;\n }\n\n private _createNodes(width: number): React.ReactNode[] | undefined {\n const nodes: React.ReactNode[] = [];\n\n if (this.props.data.SankeyChartData) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.props.data.SankeyChartData.nodes.forEach((singleNode: SNode, index: number) => {\n const onMouseOut = () => {\n this._onLeave(singleNode);\n };\n const height = singleNode.y1! - singleNode.y0! > 0 ? singleNode.y1! - singleNode.y0! : 0;\n let padding = 8;\n let textLengthForNodeWeight = 0;\n\n // If the nodeWeight is in the same line as node description an extra padding\n // of 6 px is required between node description and node weight.\n if (height < MIN_HEIGHT_FOR_DOUBLINE_TYPE) {\n padding = padding + 6;\n const tspan = select('.nodeName').append('text').attr('class', 'tempText').append('tspan').text(null);\n tspan.text(singleNode.actualValue!);\n if (tspan.node() !== null) {\n textLengthForNodeWeight = tspan.node()!.getComputedTextLength();\n padding = padding + textLengthForNodeWeight;\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n }\n // Since the total width of the node is 124 and we are giving margin of 8px from the left .\n //So the actual value on which it will be truncated is 124-8=116.\n const truncatedname: string = this._truncateText(singleNode.name, 116, padding);\n const isTruncated: boolean = truncatedname.slice(-3) === '...';\n const id = getId('tooltip');\n const div = select('body')\n .append('div')\n .attr('id', id)\n .attr('class', this._classNames.toolTip!)\n .style('opacity', 0);\n const nodeId = getId('nodeBar');\n const node = (\n <g key={index} id={getId('nodeGElement')}>\n <rect\n x={singleNode.x0}\n y={singleNode.y0}\n height={height}\n width={singleNode.x1! - singleNode.x0!}\n fill={this._fillNodeColors(singleNode)}\n id={nodeId}\n onMouseOver={this._onHover.bind(this, singleNode)}\n onMouseOut={onMouseOut}\n onFocus={this._onCloseCallout.bind(this)}\n stroke={this._fillNodeBorder(singleNode)}\n strokeWidth=\"2\"\n opacity=\"1\"\n data-is-focusable={true}\n aria-label={'node' + `${singleNode.name}` + 'with weight' + `${singleNode.actualValue}`}\n role=\"img\"\n />\n {singleNode.y1! - singleNode.y0! > MIN_HEIGHT_FOR_TYPE && (\n <g className={this._classNames.nodeTextContainer}>\n <g className=\"nodeName\">\n <text\n id={`${nodeId}-name`}\n x={singleNode.x0}\n y={singleNode.y0}\n dy={'1.2em'}\n dx={'0.4em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"regular\"\n aria-hidden=\"true\"\n fill={\n !(\n !this.state.selectedState ||\n (this.state.selectedState &&\n this.state.selectedNodes.has(singleNode.index!) &&\n this.state.selectedNode) ||\n (this.state.selectedState && !this.state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={10}\n onMouseOver={this._showTooltip.bind(this, singleNode.name, isTruncated, div)}\n onMouseOut={this._hideTooltip.bind(this, div)}\n >\n {truncatedname}\n </text>\n </g>\n\n <text\n x={\n height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? singleNode.x0 : singleNode.x1! - textLengthForNodeWeight - 8\n }\n y={singleNode.y0}\n dy={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '2em' : '1em'}\n dx={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '0.4em' : '0em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"bold\"\n aria-hidden=\"true\"\n fill={\n !(\n !this.state.selectedState ||\n (this.state.selectedState &&\n this.state.selectedNodes.has(singleNode.index!) &&\n this.state.selectedNode) ||\n (this.state.selectedState && !this.state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={14}\n >\n {singleNode.actualValue}\n </text>\n </g>\n )}\n </g>\n );\n nodes.push(node);\n });\n return nodes;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onLeave(singleNode: SNode) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedNode: undefined,\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onHover(singleNode: SNode, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const selectedLinks = this._getSelectedLinks(singleNode);\n const selectedNodes = this._getSelectedNodes(selectedLinks);\n selectedNodes.push(singleNode);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n selectedNode: singleNode,\n refSelected: mouseEvent, //this._refArray.get(index),\n isCalloutVisible: singleNode.y1! - singleNode.y0! < MIN_HEIGHT_FOR_TYPE,\n color: singleNode.color,\n xCalloutValue: singleNode.name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: singleNode.actualValue! as any as string,\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onStreamHover(singleLink: SLink, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const { selectedLinks, selectedNodes } = this._getSelectedLinksforStreamHover(singleLink);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index!)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n refSelected: mouseEvent,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n yCalloutValue: singleLink.unnormalizedValue!.toString(),\n descriptionMessage: 'from ' + (singleLink.source as SNode).name,\n });\n }\n }\n\n private _onStreamLeave(singleLink: SLink) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedLink: undefined,\n });\n }\n }\n\n private _onFocusLink(singleLink: SLink, element: React.FocusEvent<SVGElement>): void {\n element.persist();\n this._onCloseCallout();\n this.setState({\n refSelected: element.currentTarget,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: (singleLink.source as SNode).actualValue! as any as string,\n descriptionMessage: 'from ' + (singleLink.source as SNode).name,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onCloseCallout = () => {\n this.setState({\n isCalloutVisible: false,\n refSelected: undefined,\n descriptionMessage: '',\n });\n };\n\n private _onBlur = (): void => {\n /**/\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillNodeColors = (singleNode: SNode): string | undefined => {\n if (!this.state.selectedState) {\n return singleNode.color;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!) && this.state.selectedNode) {\n return this.state.selectedNode.color;\n } else if (this.state.selectedState && !this.state.selectedNode) {\n return singleNode.color;\n }\n };\n\n /**\n * This is used to assign node fillcolors and borderColor cyclically when the user doesnt\n * provide color to individual node.\n */\n private _assignNodeColors() {\n let colors: string[];\n let borders: string[];\n if (this.props.colorsForNodes && this.props.borderColorsForNodes) {\n colors = this.props.colorsForNodes;\n borders = this.props.borderColorsForNodes;\n } else {\n colors = DEFAULT_NODE_COLORS.map(color => color.fillColor);\n borders = DEFAULT_NODE_COLORS.map(color => color.borderColor);\n }\n let currentIndex = 0;\n this.props.data.SankeyChartData!.nodes.forEach((node: SNode) => {\n if (!node.color && !node.borderColor) {\n node.color = colors[currentIndex];\n node.borderColor = borders[currentIndex];\n } else if (node.color && !node.borderColor) {\n node.borderColor = '#757575';\n } else if (node.borderColor && !node.color) {\n node.color = '#F5F5F5';\n }\n currentIndex = (currentIndex + 1) % colors.length;\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillStreamColors(singleLink: SLink, gradientUrl: string): string | undefined {\n if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!) && this.state.selectedNode) {\n return this.state.selectedNode.color;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillStreamBorder(singleLink: SLink, gradientUrl: string): string {\n if (!this.state.selectedState) {\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!) && this.state.selectedNode) {\n return this.state.selectedNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillNodeBorder = (singleNode: SNode): string => {\n if (!this.state.selectedState) {\n return singleNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!) && this.state.selectedNode) {\n return this.state.selectedNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!)) {\n return singleNode.borderColor!;\n }\n return singleNode.borderColor!;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedNodes(selectedLinks: Set<SLink>): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nodes: SNode[] = [];\n selectedLinks.forEach(link => {\n nodes.push(link.target as SNode);\n\n if (nodes.indexOf(link.source as SNode) === -1) {\n nodes.push(link.source as SNode);\n }\n });\n return nodes;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedLinks(singleNode: SNode): Set<SLink> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n\n singleNode.sourceLinks!.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.target as SNode;\n if (node && node.sourceLinks) {\n node.sourceLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n if (singleNode.targetLinks) {\n singleNode.targetLinks.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n }\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.source as SNode;\n if (node && node.targetLinks) {\n node.targetLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n return finalLinks;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedLinksforStreamHover(singleLink: SLink): { selectedLinks: Set<SLink>; selectedNodes: Set<SNode> } {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n const finalNodes: Set<SNode> = new Set<SNode>();\n\n q.push(singleLink.source);\n finalLinks.add(singleLink);\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.targetLinks && poppedNode.targetLinks.length > 0) {\n poppedNode.targetLinks.forEach((link: SLink) => {\n q.push(link.source);\n finalLinks.add(link);\n });\n }\n }\n\n q.push(singleLink.target);\n\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.sourceLinks && poppedNode.sourceLinks.length > 0) {\n poppedNode.sourceLinks.forEach((link: SLink) => {\n q.push(link.target);\n finalLinks.add(link);\n });\n }\n }\n\n return {\n selectedLinks: finalLinks,\n selectedNodes: finalNodes,\n };\n }\n\n private _getOpacityStream(singleLink: SLink): number {\n if (this.state.selectedState) {\n if (!this.state.selectedLinks.has(singleLink.index!)) {\n return NON_SELECTED_OPACITY;\n } else if (\n this.state.selectedState &&\n this.state.selectedLinks.has(singleLink.index!) &&\n !this.state.selectedNode\n ) {\n return SELECTED_STREAM_OPACITY;\n }\n }\n return REST_STREAM_OPACITY;\n }\n\n private _getOpacityStreamBorder(singleLink: SLink): number {\n if (this.state.selectedState && !this.state.selectedLinks.has(singleLink.index!) && !this.state.selectedNode) {\n return NON_SELECTED_STREAM_BORDER_OPACITY;\n }\n\n return NON_SELECTED_OPACITY;\n }\n\n private _fitParentContainer(): void {\n const { containerWidth, containerHeight } = this.state;\n this._reqID = requestAnimationFrame(() => {\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth = container && container.getBoundingClientRect().width;\n const currentContainerHeight = container && container.getBoundingClientRect().height;\n const shouldResize = containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight;\n if (shouldResize) {\n this.setState({\n containerWidth: currentContainerWidth,\n containerHeight: currentContainerHeight,\n });\n }\n });\n }\n /**\n *\n * @param text is the text which we are trying to truncate\n * @param rectangleWidth is the width of the rectangle which will contain the text\n * @param padding is the space we need to leave between the rect lines and other text\n * @param nodeWeight is the text if present needs to be accomodate in the same line as text.\n * @returns the truncated text , if truncated given the above parameters.\n */\n private _truncateText(text: string, rectangleWidth: number, padding: number) {\n const textLengthForNodeName = rectangleWidth - padding;\n let elipsisLength = 0;\n const tspan = select('.nodeName')\n .append('text')\n .attr('class', 'tempText')\n .attr('font-size', '10')\n .append('tspan')\n .text(null);\n tspan.text(text);\n if (tspan.node() !== null && tspan.node()!.getComputedTextLength() <= textLengthForNodeName) {\n return text;\n }\n tspan.text(null);\n tspan.text('...');\n if (tspan.node() !== null) {\n elipsisLength = tspan.node()!.getComputedTextLength();\n }\n tspan.text(null);\n let line: string = '';\n for (let i = 0; i < text.length; i++) {\n line += text[i];\n tspan.text(line);\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w >= textLengthForNodeName - elipsisLength) {\n line = line.slice(0, -1);\n line += '...';\n break;\n }\n }\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n return line;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _showTooltip(text: string, checkTrcuncated: boolean, div: any, evt: any) {\n if (checkTrcuncated) {\n //Fixing tooltip position by attaching it to the element rather than page\n div.style('opacity', 0.9);\n div\n .html(text)\n .style('left', evt.pageX + 'px')\n .style('top', evt.pageY - 28 + 'px');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _hideTooltip(div: any) {\n div.style('opacity', 0);\n }\n\n private _isChartEmpty() {\n return !(\n this.props.data &&\n this.props.data.SankeyChartData &&\n this.props.data.SankeyChartData.nodes.length > 0 &&\n this.props.data.SankeyChartData.links.length > 0\n );\n }\n}\n"]}
1
+ {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAA6B,MAAM,IAAI,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAkD,MAAM,aAAa,CAAC;AAI7F,IAAM,aAAa,GAAG,kBAAkB,EAA8C,CAAC;AACvF,IAAM,kBAAkB,GAAG,GAAG,CAAC;AAkB/B,IAAM,kCAAkC,GAAW,SAAS,CAAC;AAC7D,IAAM,mBAAmB,GAAiB;IACxC,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;IAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE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I,CAAC,KAAK,CAAC,IAAI,0CAAE,eAAe,CAAC;QACzD,OAAO,CAAC,CAAC,eAAe,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpG,CAAC;IACH,sBAAC;AAAD,CAAC,AAzmBD,CAAqC,KAAK,CAAC,SAAS,GAymBnD","sourcesContent":["import { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { classNamesFunction, getId, getRTL, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { sum as d3Sum } from 'd3-array';\nimport { SankeyGraph, SankeyLayout, sankey as d3Sankey, sankeyJustify, sankeyRight } from 'd3-sankey';\nimport { select, selectAll } from 'd3-selection';\nimport { area as d3Area, curveBumpX as d3CurveBasis } from 'd3-shape';\nimport * as React from 'react';\nimport { ChartHoverCard, IBasestate, IChartHoverCardProps, SLink, SNode } from '../../index';\nimport { IMargins } from '../../utilities/utilities';\nimport { ISankeyChartData, ISankeyChartProps, ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\n\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\nconst PADDING_PERCENTAGE = 0.3;\n\ntype NodesInColumns = { [key: number]: SNode[] };\ntype NodeColors = { fillColor: string; borderColor: string };\n\nexport interface ISankeyChartState extends IBasestate, IChartHoverCardProps {\n containerWidth: number;\n containerHeight: number;\n selectedState: boolean;\n selectedLinks: Set<Number>;\n selectedNodes: Set<Number>;\n selectedNode?: SNode;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n selectedLink?: SLink;\n shouldOverflow: boolean;\n}\n\nconst NON_SELECTED_NODE_AND_STREAM_COLOR: string = '#757575';\nconst DEFAULT_NODE_COLORS: NodeColors[] = [\n { fillColor: '#00758F', borderColor: '#002E39' },\n { fillColor: '#77004D', borderColor: '#43002C' },\n { fillColor: '#4F6BED', borderColor: '#3B52B4' },\n { fillColor: '#937600', borderColor: '#6D5700' },\n { fillColor: '#286EA8', borderColor: '#00457E' },\n { fillColor: '#A43FB1', borderColor: '#7C158A' },\n { fillColor: '#CC3595', borderColor: '#7F215D' },\n { fillColor: '#0E7878', borderColor: '#004E4E' },\n { fillColor: '#8764B8', borderColor: '#4B3867' },\n { fillColor: '#9C663F', borderColor: '#6D4123' },\n];\n\nconst MIN_HEIGHT_FOR_DOUBLINE_TYPE = 36;\nconst MIN_HEIGHT_FOR_TYPE = 24;\nconst REST_STREAM_OPACITY: number = 1;\nconst NON_SELECTED_OPACITY: number = 1;\nconst SELECTED_STREAM_OPACITY: number = 0.3;\nconst NON_SELECTED_STREAM_BORDER_OPACITY: number = 0.5;\nconst DEFAULT_TEXT_COLOR: string = '#323130';\nconst NON_SELECTED_TEXT_COLOR: string = '#FFFFFF';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getSelectedNodes(selectedLinks: Set<SLink>): any[] {\n const nodes: SNode[] = [];\n selectedLinks.forEach(link => {\n nodes.push(link.target as SNode);\n\n if (nodes.indexOf(link.source as SNode) === -1) {\n nodes.push(link.source as SNode);\n }\n });\n return nodes;\n}\n\nfunction getSelectedLinks(singleNode: SNode): Set<SLink> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n\n singleNode.sourceLinks!.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.target as SNode;\n if (node && node.sourceLinks) {\n node.sourceLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n if (singleNode.targetLinks) {\n singleNode.targetLinks.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n }\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.source as SNode;\n if (node && node.targetLinks) {\n node.targetLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n return finalLinks;\n}\n\nfunction getSelectedLinksforStreamHover(singleLink: SLink): { selectedLinks: Set<SLink>; selectedNodes: Set<SNode> } {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n const finalNodes: Set<SNode> = new Set<SNode>();\n\n q.push(singleLink.source);\n finalLinks.add(singleLink);\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.targetLinks && poppedNode.targetLinks.length > 0) {\n poppedNode.targetLinks.forEach((link: SLink) => {\n q.push(link.source);\n finalLinks.add(link);\n });\n }\n }\n\n q.push(singleLink.target);\n\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.sourceLinks && poppedNode.sourceLinks.length > 0) {\n poppedNode.sourceLinks.forEach((link: SLink) => {\n q.push(link.target);\n finalLinks.add(link);\n });\n }\n }\n\n return {\n selectedLinks: finalLinks,\n selectedNodes: finalNodes,\n };\n}\n\n/**\n * This is used to group nodes by column index.\n */\nfunction populateNodeInColumns(graph: ISankeyChartData, sankey: SankeyLayout<SankeyGraph<{}, {}>, {}, {}>) {\n sankey(graph);\n const nodesInColumn: NodesInColumns = {};\n graph.nodes.forEach((node: SNode) => {\n const columnId = node.layer!;\n if (nodesInColumn[columnId]) {\n nodesInColumn[columnId].push(node);\n } else {\n nodesInColumn[columnId] = [node];\n }\n });\n return nodesInColumn;\n}\n\n/**\n * This is used to normalize the nodes value whose value is less than 1% of the total column value.\n */\nfunction adjustOnePercentHeightNodes(nodesInColumn: NodesInColumns) {\n const totalColumnValue = Object.values(nodesInColumn).map((column: SNode[]) => {\n return d3Sum(column, (node: SNode) => node.value);\n });\n totalColumnValue.forEach((columnValue: number, index: number) => {\n let totalPercentage = 0;\n nodesInColumn[index].forEach((node: SNode) => {\n const nodePercentage = (node.value! / columnValue) * 100;\n node.actualValue = node.value;\n //if the value is less than 1% then we are making it as 1% of total .\n if (nodePercentage < 1) {\n node.value = 0.01 * columnValue;\n totalPercentage = totalPercentage + 1;\n } else {\n totalPercentage = totalPercentage + nodePercentage;\n }\n });\n //since we have adjusted the value to be 1% but we need to keep the sum of the percentage value under 100.\n const scalingRatio = totalPercentage !== 0 ? totalPercentage / 100 : 1;\n if (scalingRatio > 1) {\n nodesInColumn[index].forEach((node: SNode) => {\n node.value = node.value! / scalingRatio;\n changeColumnValue(node, node.actualValue!, node.value);\n });\n }\n });\n}\n\n/**\n * This is used for normalizing each links value for reflecting the normalized node value.\n */\nfunction changeColumnValue(node: SNode, originalValue: number, normalizedValue: number) {\n node.sourceLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n node.targetLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n}\n\n/**\n * This is used for calculating the node non normalized value based on link non normalized value.\n */\nfunction populateNodeActualValue(data: ISankeyChartData) {\n data.links.forEach((link: SLink) => {\n if (!link.unnormalizedValue) {\n link.unnormalizedValue = link.value;\n }\n });\n data.nodes.forEach((node: SNode) => {\n node.actualValue = Math.max(\n d3Sum(node.sourceLinks!, (link: SLink) => link.unnormalizedValue),\n d3Sum(node.targetLinks!, (link: SLink) => link.unnormalizedValue),\n );\n });\n}\n\nexport class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> {\n private chartContainer: HTMLDivElement;\n private _reqID: number;\n private _calloutId: string;\n private _linkId: string;\n private _nodesInColumn: NodesInColumns;\n private _sankey: SankeyLayout<SankeyGraph<{}, {}>, {}, {}>;\n private _margins: IMargins;\n private _isRtl: boolean = getRTL();\n private _normalizeData: (data: ISankeyChartData) => void;\n private _emptyChartId: string;\n\n constructor(props: ISankeyChartProps) {\n super(props);\n this.state = {\n containerHeight: 468,\n containerWidth: 912,\n selectedState: false,\n selectedLinks: new Set<number>(),\n selectedNodes: new Set<number>(),\n shouldOverflow: false,\n isCalloutVisible: false,\n };\n this._calloutId = getId('callout');\n this._linkId = getId('link');\n this._margins = { top: 36, right: 48, bottom: 32, left: 48 };\n this._preRenderLayout();\n this._normalizeData = memoizeFunction((data: ISankeyChartData) => this._normalizeSankeyData(data));\n this._emptyChartId = getId('_SankeyChart_empty');\n }\n\n public componentDidMount(): void {\n this._fitParentContainer();\n }\n\n public componentDidUpdate(prevProps: ISankeyChartProps): void {\n if (prevProps.shouldResize !== this.props.shouldResize) {\n this._fitParentContainer();\n }\n }\n\n public componentWillUnmount(): void {\n cancelAnimationFrame(this._reqID);\n }\n\n public render(): React.ReactNode {\n if (!this._isChartEmpty()) {\n const { theme, className, styles, pathColor } = this.props;\n const state = this.state;\n const classNames: IProcessedStyleSet<ISankeyChartStyles> = getClassNames(styles!, {\n theme: theme!,\n width: state.containerWidth,\n height: state.containerHeight,\n pathColor,\n className,\n });\n // We are using the this._margins.left and this._margins.top in sankey extent while constructing the layout\n const { height, width } = this._preRenderLayout();\n const sankeyChartData = this.props.data.SankeyChartData!;\n this._normalizeData(sankeyChartData);\n let nodePadding = 8;\n nodePadding = this._adjustPadding(this._sankey, height - 6, this._nodesInColumn);\n\n this._sankey.nodePadding(nodePadding);\n this._sankey(sankeyChartData);\n populateNodeActualValue(sankeyChartData);\n this._assignNodeColors();\n const nodeData = this._createNodes(classNames);\n const linkData = this._createLinks();\n const calloutProps = {\n isCalloutVisible: state.isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${this._calloutId}`,\n target: state.refSelected,\n color: state.color,\n XValue: state.xCalloutValue,\n YValue: state.yCalloutValue ? state.yCalloutValue : state.dataForHoverCard,\n descriptionMessage: state.descriptionMessage,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: this._onCloseCallout,\n className: classNames.calloutContentRoot,\n preventDismissOnLostFocus: true,\n };\n return (\n <div\n className={classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (this.chartContainer = rootElem)}\n onMouseLeave={this._onCloseCallout}\n >\n <FocusZone\n direction={FocusZoneDirection.bidirectional}\n isCircularNavigation={true}\n handleTabKey={FocusZoneTabbableElements.all}\n >\n <svg width={width} height={height} id={getId('sankeyChart')}>\n <g className={classNames.links} strokeOpacity={1}>\n {linkData}\n </g>\n <g className={classNames.nodes}>{nodeData}</g>\n {calloutProps.isCalloutVisible && (\n <Callout {...calloutProps}>\n <ChartHoverCard\n XValue={calloutProps.XValue}\n YValue={calloutProps.YValue}\n color={calloutProps.color}\n descriptionMessage={calloutProps.descriptionMessage ? calloutProps.descriptionMessage : ''}\n />\n </Callout>\n )}\n </svg>\n </FocusZone>\n </div>\n );\n }\n return (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _preRenderLayout(): { height: number; width: number } {\n const { containerHeight, containerWidth } = this.state;\n const { left, right, top, bottom } = this._margins;\n const width = containerWidth - right!;\n const height = containerHeight - bottom! > 0 ? containerHeight - bottom! : 0;\n\n this._sankey = d3Sankey()\n .nodeWidth(124)\n .extent([\n [left!, top!],\n [width - 1, height - 6],\n ])\n .nodeAlign(this._isRtl ? sankeyRight : sankeyJustify);\n\n return { height, width };\n }\n\n private _normalizeSankeyData(data: ISankeyChartData): void {\n const nodesInColumn = (this._nodesInColumn = populateNodeInColumns(data, this._sankey));\n adjustOnePercentHeightNodes(nodesInColumn);\n }\n\n /**\n * This is used to introduce dynamic padding for cases where the number of nodes in a column is huge\n * so that we maintain a node to space ratio for such columns as if we fail to do so the\n * chart is devoid of nodes and only shows links.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _adjustPadding(sankey: any, height: number, nodesInColumn: NodesInColumns) {\n let padding = this._sankey.nodePadding();\n Object.values(nodesInColumn).forEach((column: SNode[]) => {\n const minPadding = PADDING_PERCENTAGE * height;\n const toatlPaddingInColumn = height - d3Sum(column, (node: SNode) => node.y1! - node.y0!);\n if (minPadding < toatlPaddingInColumn) {\n //Here we are calculating the min of default and calculated padding, we will not increase the padding\n //in any scenario.\n padding = Math.min(padding, minPadding / (column.length - 1));\n }\n });\n return padding;\n }\n\n private _createLinks(): React.ReactNode[] | undefined {\n const links: React.ReactNode[] = [];\n\n const sankeyChartData = this.props.data.SankeyChartData;\n if (sankeyChartData) {\n const linkId = this._linkId;\n sankeyChartData.links.forEach((singleLink: SLink, index: number) => {\n const onMouseOut = () => {\n this._onStreamLeave(singleLink);\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = (d: any) => {\n return [\n { x: d.source.x1, y0: d.y0 + d.width / 2, y1: d.y0 - d.width / 2 },\n { x: d.target.x0, y0: d.y1 + d.width / 2, y1: d.y1 - d.width / 2 },\n ];\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataPoints: Array<any> = data(singleLink);\n const linkArea = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((p: any) => p.x)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((p: any) => p.y0)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((p: any) => p.y1)\n .curve(d3CurveBasis);\n const gradientUrl = `url(#gradient-${linkId}-${index})`;\n const link = (\n <g key={`${linkId}-${index}`}>\n <defs>\n <linearGradient id={`gradient-${linkId}-${index}`} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0\" stopColor={(singleLink.source as SNode).color} />\n <stop offset=\"100%\" stopColor={(singleLink.target as SNode).color} />\n </linearGradient>\n </defs>\n <path\n d={linkArea(dataPoints)!}\n id={getId('link')}\n fill={this._fillStreamColors(singleLink, gradientUrl)}\n stroke={this._fillStreamBorder(singleLink, gradientUrl)}\n strokeWidth=\"2\"\n strokeOpacity={this._getOpacityStreamBorder(singleLink)}\n onMouseOver={this._onStreamHover.bind(this, singleLink)}\n onMouseOut={onMouseOut}\n onFocus={this._onFocusLink.bind(this, singleLink)}\n onBlur={this._onBlur}\n fillOpacity={this._getOpacityStream(singleLink)}\n data-is-focusable={true}\n aria-label={\n 'link from' +\n (singleLink.source as SNode).name +\n 'to' +\n (singleLink.target as SNode).name +\n 'with weight' +\n singleLink!.unnormalizedValue\n }\n role=\"img\"\n />\n </g>\n );\n links.push(link);\n });\n }\n return links;\n }\n\n private _createNodes(classNames: IProcessedStyleSet<ISankeyChartStyles>): React.ReactNode[] | undefined {\n const nodes: React.ReactNode[] = [];\n\n const sankeyChartData = this.props.data.SankeyChartData;\n if (sankeyChartData) {\n const state = this.state;\n sankeyChartData.nodes.forEach((singleNode: SNode, index: number) => {\n const onMouseOut = () => {\n this._onLeave(singleNode);\n };\n const height = singleNode.y1! - singleNode.y0! > 0 ? singleNode.y1! - singleNode.y0! : 0;\n let padding = 8;\n let textLengthForNodeWeight = 0;\n\n // If the nodeWeight is in the same line as node description an extra padding\n // of 6 px is required between node description and node weight.\n if (height < MIN_HEIGHT_FOR_DOUBLINE_TYPE) {\n padding = padding + 6;\n const tspan = select('.nodeName').append('text').attr('class', 'tempText').append('tspan').text(null);\n tspan.text(singleNode.actualValue!);\n if (tspan.node() !== null) {\n textLengthForNodeWeight = tspan.node()!.getComputedTextLength();\n padding = padding + textLengthForNodeWeight;\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n }\n // Since the total width of the node is 124 and we are giving margin of 8px from the left .\n //So the actual value on which it will be truncated is 124-8=116.\n const truncatedname: string = this._truncateText(singleNode.name, 116, padding);\n const isTruncated: boolean = truncatedname.slice(-3) === '...';\n const id = getId('tooltip');\n const div = select('body').append('div').attr('id', id).attr('class', classNames.toolTip!).style('opacity', 0);\n const nodeId = getId('nodeBar');\n // TODO: Should the `aria-label` be localized?\n const node = (\n <g key={index} id={getId('nodeGElement')}>\n <rect\n x={singleNode.x0}\n y={singleNode.y0}\n height={height}\n width={singleNode.x1! - singleNode.x0!}\n fill={this._fillNodeColors(singleNode)}\n id={nodeId}\n onMouseOver={this._onHover.bind(this, singleNode)}\n onMouseOut={onMouseOut}\n onFocus={this._onCloseCallout.bind(this)}\n stroke={this._fillNodeBorder(singleNode)}\n strokeWidth=\"2\"\n opacity=\"1\"\n data-is-focusable={true}\n aria-label={'node' + `${singleNode.name}` + 'with weight' + `${singleNode.actualValue}`}\n role=\"img\"\n />\n {singleNode.y1! - singleNode.y0! > MIN_HEIGHT_FOR_TYPE && (\n <g className={classNames.nodeTextContainer}>\n <g className=\"nodeName\">\n <text\n id={`${nodeId}-name`}\n x={singleNode.x0}\n y={singleNode.y0}\n dy={'1.2em'}\n dx={'0.4em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"regular\"\n aria-hidden=\"true\"\n fill={\n !(\n !state.selectedState ||\n (state.selectedState && state.selectedNodes.has(singleNode.index!) && state.selectedNode) ||\n (state.selectedState && !state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={10}\n onMouseOver={this._showTooltip.bind(this, singleNode.name, isTruncated, div)}\n onMouseOut={this._hideTooltip.bind(this, div)}\n >\n {truncatedname}\n </text>\n </g>\n\n <text\n x={\n height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? singleNode.x0 : singleNode.x1! - textLengthForNodeWeight - 8\n }\n y={singleNode.y0}\n dy={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '2em' : '1em'}\n dx={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '0.4em' : '0em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"bold\"\n aria-hidden=\"true\"\n fill={\n !(\n !state.selectedState ||\n (state.selectedState && state.selectedNodes.has(singleNode.index!) && state.selectedNode) ||\n (state.selectedState && !state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={14}\n >\n {singleNode.actualValue}\n </text>\n </g>\n )}\n </g>\n );\n nodes.push(node);\n });\n return nodes;\n }\n }\n\n private _onLeave(singleNode: SNode) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedNode: undefined,\n });\n }\n }\n\n private _onHover(singleNode: SNode, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const selectedLinks = getSelectedLinks(singleNode);\n const selectedNodes = getSelectedNodes(selectedLinks);\n selectedNodes.push(singleNode);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n selectedNode: singleNode,\n refSelected: mouseEvent, //this._refArray.get(index),\n isCalloutVisible: singleNode.y1! - singleNode.y0! < MIN_HEIGHT_FOR_TYPE,\n color: singleNode.color,\n xCalloutValue: singleNode.name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: singleNode.actualValue! as any as string,\n });\n }\n }\n\n private _onStreamHover(singleLink: SLink, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const { selectedLinks, selectedNodes } = getSelectedLinksforStreamHover(singleLink);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index!)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n refSelected: mouseEvent,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n yCalloutValue: singleLink.unnormalizedValue!.toString(),\n descriptionMessage: 'from ' + (singleLink.source as SNode).name, // TODO: Does this need to be localized?\n });\n }\n }\n\n private _onStreamLeave(singleLink: SLink) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedLink: undefined,\n });\n }\n }\n\n private _onFocusLink(singleLink: SLink, element: React.FocusEvent<SVGElement>): void {\n element.persist();\n this._onCloseCallout();\n this.setState({\n refSelected: element.currentTarget,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: (singleLink.source as SNode).actualValue! as any as string,\n descriptionMessage: 'from ' + (singleLink.source as SNode).name, // TODO: Does this need to be localized?\n });\n }\n\n private _onCloseCallout = () => {\n this.setState({\n isCalloutVisible: false,\n refSelected: undefined,\n descriptionMessage: '',\n });\n };\n\n private _onBlur = (): void => {\n /**/\n };\n\n private _fillNodeColors = (singleNode: SNode): string | undefined => {\n const state = this.state;\n if (!state.selectedState) {\n return singleNode.color;\n } else if (state.selectedState && state.selectedNodes.has(singleNode.index!) && state.selectedNode) {\n return state.selectedNode.color;\n } else if (state.selectedState && !state.selectedNode) {\n return singleNode.color;\n }\n };\n\n /**\n * This is used to assign node fillcolors and borderColor cyclically when the user doesnt\n * provide color to individual node.\n */\n private _assignNodeColors() {\n let colors: string[];\n let borders: string[];\n const { colorsForNodes, borderColorsForNodes } = this.props;\n if (colorsForNodes && borderColorsForNodes) {\n colors = colorsForNodes;\n borders = borderColorsForNodes;\n } else {\n colors = DEFAULT_NODE_COLORS.map(color => color.fillColor);\n borders = DEFAULT_NODE_COLORS.map(color => color.borderColor);\n }\n let currentIndex = 0;\n this.props.data.SankeyChartData!.nodes.forEach((node: SNode) => {\n if (!node.color && !node.borderColor) {\n node.color = colors[currentIndex];\n node.borderColor = borders[currentIndex];\n } else if (node.color && !node.borderColor) {\n node.borderColor = '#757575';\n } else if (node.borderColor && !node.color) {\n node.color = '#F5F5F5';\n }\n currentIndex = (currentIndex + 1) % colors.length;\n });\n }\n\n private _fillStreamColors(singleLink: SLink, gradientUrl: string): string | undefined {\n const state = this.state;\n if (state.selectedState && state.selectedLinks.has(singleLink.index!) && state.selectedNode) {\n return state.selectedNode.color;\n } else if (state.selectedState && state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n }\n\n private _fillStreamBorder(singleLink: SLink, gradientUrl: string): string {\n const state = this.state;\n if (!state.selectedState) {\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n } else if (state.selectedState && state.selectedLinks.has(singleLink.index!) && state.selectedNode) {\n return state.selectedNode.borderColor!;\n } else if (state.selectedState && state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n }\n\n private _fillNodeBorder = (singleNode: SNode): string => {\n const state = this.state;\n if (!state.selectedState) {\n return singleNode.borderColor!;\n } else if (state.selectedState && state.selectedNodes.has(singleNode.index!) && state.selectedNode) {\n return state.selectedNode.borderColor!;\n } else if (state.selectedState && state.selectedNodes.has(singleNode.index!)) {\n return singleNode.borderColor!;\n }\n return singleNode.borderColor!;\n };\n\n private _getOpacityStream(singleLink: SLink): number {\n const state = this.state;\n if (state.selectedState) {\n if (!state.selectedLinks.has(singleLink.index!)) {\n return NON_SELECTED_OPACITY;\n } else if (state.selectedLinks.has(singleLink.index!) && !state.selectedNode) {\n return SELECTED_STREAM_OPACITY;\n }\n }\n return REST_STREAM_OPACITY;\n }\n\n private _getOpacityStreamBorder(singleLink: SLink): number {\n const state = this.state;\n if (state.selectedState && !state.selectedLinks.has(singleLink.index!) && !state.selectedNode) {\n return NON_SELECTED_STREAM_BORDER_OPACITY;\n }\n\n return NON_SELECTED_OPACITY;\n }\n\n private _fitParentContainer(): void {\n const { containerWidth, containerHeight } = this.state;\n this._reqID = requestAnimationFrame(() => {\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth = container && container.getBoundingClientRect().width;\n const currentContainerHeight = container && container.getBoundingClientRect().height;\n const shouldResize = containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight;\n if (shouldResize) {\n this.setState({\n containerWidth: currentContainerWidth,\n containerHeight: currentContainerHeight,\n });\n }\n });\n }\n\n /**\n * @param text is the text which we are trying to truncate\n * @param rectangleWidth is the width of the rectangle which will contain the text\n * @param padding is the space we need to leave between the rect lines and other text\n * @param nodeWeight is the text if present needs to be accomodate in the same line as text.\n * @returns the truncated text , if truncated given the above parameters.\n */\n private _truncateText(text: string, rectangleWidth: number, padding: number) {\n const textLengthForNodeName = rectangleWidth - padding;\n let elipsisLength = 0;\n const tspan = select('.nodeName')\n .append('text')\n .attr('class', 'tempText')\n .attr('font-size', '10')\n .append('tspan')\n .text(null);\n tspan.text(text);\n if (tspan.node() !== null && tspan.node()!.getComputedTextLength() <= textLengthForNodeName) {\n return text;\n }\n tspan.text(null);\n tspan.text('...');\n if (tspan.node() !== null) {\n elipsisLength = tspan.node()!.getComputedTextLength();\n }\n tspan.text(null);\n let line: string = '';\n for (let i = 0; i < text.length; i++) {\n line += text[i];\n tspan.text(line);\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w >= textLengthForNodeName - elipsisLength) {\n line = line.slice(0, -1);\n line += '...';\n break;\n }\n }\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n return line;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _showTooltip(text: string, checkTrcuncated: boolean, div: any, evt: any) {\n if (checkTrcuncated) {\n //Fixing tooltip position by attaching it to the element rather than page\n div.style('opacity', 0.9);\n div\n .html(text)\n .style('left', evt.pageX + 'px')\n .style('top', evt.pageY - 28 + 'px');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _hideTooltip(div: any) {\n div.style('opacity', 0);\n }\n\n private _isChartEmpty() {\n const sankeyChartData = this.props.data?.SankeyChartData;\n return !(sankeyChartData && sankeyChartData.nodes.length > 0 && sankeyChartData.links.length > 0);\n }\n}\n"]}
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Do not modify this file; it is generated as part of publish.
2
2
  // The checked in version is a placeholder only and will not be updated.
3
3
  import { setVersion } from '@fluentui/set-version';
4
- setVersion('@fluentui/react-charting', '5.19.17');
4
+ setVersion('@fluentui/react-charting', '5.19.19');
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.19.17');"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.19.19');"]}
@@ -101,49 +101,6 @@ define(["require", "exports", "tslib", "../../index", "d3-scale", "@fluentui/rea
101
101
  });
102
102
  return rectangles;
103
103
  };
104
- /**
105
- * when the legend is hovered we need to highlight
106
- * all the rectangles which fall under that category
107
- * and un-highlight the rest of them
108
- * @param legendTitle
109
- */
110
- _this._onLegendHover = function (legendTitle) {
111
- _this.setState({
112
- activeLegend: legendTitle,
113
- });
114
- };
115
- /**
116
- * when the mouse is out from the legend , we need
117
- * to show the graph in initial mode.
118
- */
119
- _this._onLegendLeave = function () {
120
- _this.setState({
121
- activeLegend: '',
122
- });
123
- };
124
- /**
125
- * @param legendTitle
126
- * when the legend is clicked we need to highlight
127
- * all the rectangles which fall under that category
128
- * and un highlight the rest of them
129
- */
130
- _this._onLegendClick = function (legendTitle) {
131
- /**
132
- * check if the legend is already selceted,
133
- * if yes, un-select the legend, else
134
- * set the selected legend state to legendTitle
135
- */
136
- if (_this.state.selectedLegend === legendTitle) {
137
- _this.setState({
138
- selectedLegend: '',
139
- });
140
- }
141
- else {
142
- _this.setState({
143
- selectedLegend: legendTitle,
144
- });
145
- }
146
- };
147
104
  _this._createLegendBars = function () {
148
105
  var _a = _this.props, data = _a.data, legendProps = _a.legendProps;
149
106
  var legends = [];
@@ -486,6 +443,49 @@ define(["require", "exports", "tslib", "../../index", "d3-scale", "@fluentui/rea
486
443
  return _this._createRectangles();
487
444
  } }))) : (React.createElement("div", { id: this._emptyChartId, role: 'alert', style: { opacity: '0' }, "aria-label": 'Graph has no data to display' }));
488
445
  };
446
+ /**
447
+ * when the legend is hovered we need to highlight
448
+ * all the rectangles which fall under that category
449
+ * and un-highlight the rest of them
450
+ * @param legendTitle
451
+ */
452
+ HeatMapChartBase.prototype._onLegendHover = function (legendTitle) {
453
+ this.setState({
454
+ activeLegend: legendTitle,
455
+ });
456
+ };
457
+ /**
458
+ * when the mouse is out from the legend , we need
459
+ * to show the graph in initial mode.
460
+ */
461
+ HeatMapChartBase.prototype._onLegendLeave = function () {
462
+ this.setState({
463
+ activeLegend: '',
464
+ });
465
+ };
466
+ /**
467
+ * @param legendTitle
468
+ * when the legend is clicked we need to highlight
469
+ * all the rectangles which fall under that category
470
+ * and un highlight the rest of them
471
+ */
472
+ HeatMapChartBase.prototype._onLegendClick = function (legendTitle) {
473
+ /**
474
+ * check if the legend is already selceted,
475
+ * if yes, un-select the legend, else
476
+ * set the selected legend state to legendTitle
477
+ */
478
+ if (this.state.selectedLegend === legendTitle) {
479
+ this.setState({
480
+ selectedLegend: '',
481
+ });
482
+ }
483
+ else {
484
+ this.setState({
485
+ selectedLegend: legendTitle,
486
+ });
487
+ }
488
+ };
489
489
  HeatMapChartBase.prototype._isChartEmpty = function () {
490
490
  return !(this.props.data && this.props.data.length > 0);
491
491
  };
@@ -1 +1 @@
1
- {"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;IAyFA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;IACzF;QAAsC,4CAAuD;QA2B3F,0BAAmB,KAAyB;YAA5C,YACE,kBAAM,KAAK,CAAC,SA8Bb;YAxCD;;;eAGG;YACK,mBAAa,GAAgC,EAAE,CAAC;YAqHhD,eAAS,GAAG;gBAClB,IAAI,CAAC,GAA2B,EAAE,CAAC;gBACnC,IAAI,CAAC,GAA2B,EAAE,CAAC;gBACnC,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,IAAuB;oBAC9C,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;wBACrC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACnB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACnB,OAAO,EAAE,CAAC,GAAA,EAAE,CAAC,GAAA,EAAE,CAAC;qBACjB;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,EAAE,CAAC,GAAA,EAAE,CAAC,GAAA,EAAE,CAAC;YAClB,CAAC,CAAC;YAEM,iBAAW,GAAG,UAAC,WAAmB;gBACxC,IAAM,OAAO,GAAG,KAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,KAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;gBAClG,OAAO,OAAO,CAAC;YACjB,CAAC,CA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AAE,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAClD,aAAa,EAAE,CAAC,EAChB,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,IAAI,EAClB,iBAAiB,EAAE;oBACjB,SAAS,EAAE,gCAAkB,CAAC,aAAa;iBAC5C,EACD,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,EACpC,iBAAiB,EAAE,IAAI,CAAC,sBAAsB;gBAC9C,sCAAsC;gBACtC,kDAAkD;gBAClD,QAAQ,EAAE,UAAC,KAAkB;oBAC3B,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;oBAChC,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;oBAChC,OAAO,KAAI,CAAC,iBAAiB,EAAE,CAAC;gBAClC,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BACE,EAAE,EAAE,IAAI,CAAC,aAAa,EACtB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBACX,8BAA8B,GAC1C,CACH,CAAC;QACJ,CAAC;QAsdO,wCAAa,GAArB;YACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC;QACH,uBAAC;IAAD,CAAC,AAlmBD,CAAsC,KAAK,CAAC,SAAS,GAkmBpD;IAlmBY,4CAAgB","sourcesContent":["import {\n IAccessibilityProps,\n CartesianChart,\n IChildProps,\n IModifiedCartesianChartProps,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n} from '../../index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { classNamesFunction, getId, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, Legends } from '../Legends/index';\nimport {\n ChartTypes,\n convertToLocaleString,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> {\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n public constructor(props: IHeatMapChartProps) {\n super(props);\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScale;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string, index1: number) => {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n this._dataSet[yAxisDataPoint].forEach((dataPointObject: FlattenData, index2: number) => {\n const id = `x${index1}y${index2}`;\n const rectElement: JSX.Element = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={true}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n >\n {convertToLocaleString(dataPointObject.rectText, this.props.culture)}\n </text>\n </g>\n );\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover = (legendTitle: string): void => {\n this.setState({\n activeLegend: legendTitle,\n });\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave = (): void => {\n this.setState({\n activeLegend: '',\n });\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n };\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item]\n .sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return (a.x as string).toLowerCase() > (b.x as string).toLowerCase() ? 1 : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n })\n .forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n}\n"]}
1
+ {"version":3,"file":"HeatMapChart.base.js","sourceRoot":"../src/","sources":["components/HeatMapChart/HeatMapChart.base.tsx"],"names":[],"mappings":";;;;IAyFA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;IACzF;QAAsC,4CAAuD;QA2B3F,0BAAmB,KAAyB;YAA5C,YACE,kBAAM,KAA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Ac,GAAtB,UAAuB,WAAmB;YACxC;;;;eAIG;YACH,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW,EAAE;gBAC7C,IAAI,CAAC,QAAQ,CAAC;oBACZ,cAAc,EAAE,EAAE;iBACnB,CAAC,CAAC;aACJ;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC;oBACZ,cAAc,EAAE,WAAW;iBAC5B,CAAC,CAAC;aACJ;QACH,CAAC;QA+SO,wCAAa,GAArB;YACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC;QACH,uBAAC;IAAD,CAAC,AAlmBD,CAAsC,KAAK,CAAC,SAAS,GAkmBpD;IAlmBY,4CAAgB","sourcesContent":["import {\n IAccessibilityProps,\n CartesianChart,\n IChildProps,\n IModifiedCartesianChartProps,\n IHeatMapChartData,\n IHeatMapChartDataPoint,\n} from '../../index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { classNamesFunction, getId, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { FocusZoneDirection } from '@fluentui/react-focus';\nimport { DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as React from 'react';\nimport { IHeatMapChartProps, IHeatMapChartStyleProps, IHeatMapChartStyles } from './HeatMapChart.types';\nimport { ILegend, Legends } from '../Legends/index';\nimport {\n ChartTypes,\n convertToLocaleString,\n getAccessibleDataObject,\n XAxisTypes,\n YAxisType,\n getTypeOfAxis,\n} from '../../utilities/utilities';\nimport { Target } from '@fluentui/react';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = IHeatMapChartDataPoint & {\n legend: string;\n};\ninterface IRectRef {\n data: FlattenData;\n refElement: SVGGElement;\n}\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\nexport interface IHeatMapChartState {\n /**\n * contains the selected legend string\n */\n selectedLegend: string;\n /**\n * contains the hovered legend string\n */\n activeLegend: string;\n /**\n * determines wethere to show or hide the callout\n * @default false\n */\n isCalloutVisible: boolean;\n /**\n * y value to be shown in callout\n */\n calloutYValue: string;\n /**\n * legend title to be shown in callout\n */\n calloutLegend: string;\n /**\n * color of the text in the callout\n */\n calloutTextColor: string;\n /**\n * The target that the Callout should try to position itself based on\n */\n target: Target;\n /**\n * ratio to show in the callout\n */\n ratio: [number, number] | null;\n\n /**\n * description message to show in the callout\n */\n descriptionMessage: string;\n /**\n * id to give to callout for accesiblity purpose\n */\n calloutId: string;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\nconst getClassNames = classNamesFunction<IHeatMapChartStyleProps, IHeatMapChartStyles>();\nexport class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatMapChartState> {\n private _classNames: IProcessedStyleSet<IHeatMapChartStyles>;\n private _stringXAxisDataPoints: string[];\n private _stringYAxisDataPoints: string[];\n private _createSet: (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ) => DataSet;\n private _dataSet: RectanglesGraphData;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _colorScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xAxisScale: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _yAxisScale: any;\n /**\n * This array contains ref for all the rectangles\n * drawn inside the chard\n */\n private _rectRefArray: { [key: string]: IRectRef } = {};\n private _xAxisType: XAxisTypes;\n private _yAxisType: YAxisType;\n private _calloutAnchorPoint: FlattenData | null;\n private _emptyChartId: string;\n public constructor(props: IHeatMapChartProps) {\n super(props);\n /**\n * below funciton creates a new data set from the prop\n * @data and also finds all the unique x-axis datapoints\n * and y-axis datapoints(which will render in the axis in graph)\n * we store this in a memoized function, because we want to calulate\n * this set whenever props changes.\n */\n this._createSet = memoizeFunction(\n (\n data: IHeatMapChartData[],\n xDate: string | undefined,\n xNum: string | undefined,\n yDate: string | undefined,\n yNum: string | undefined,\n ): DataSet => this._createNewDataSet(data, xDate, xNum, yDate, yNum),\n );\n this.state = {\n selectedLegend: '',\n activeLegend: '',\n isCalloutVisible: false,\n target: null,\n calloutLegend: '',\n calloutTextColor: '',\n calloutYValue: '',\n ratio: null,\n descriptionMessage: '',\n calloutId: '',\n };\n this._emptyChartId = getId('_HeatMap_empty');\n }\n\n public render(): React.ReactNode {\n const { x, y } = this._getXandY();\n this._xAxisType = getTypeOfAxis(x, true) as XAxisTypes;\n this._yAxisType = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n this.props;\n this._colorScale = this._getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = this._createSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n );\n this._dataSet = dataSet;\n this._stringYAxisDataPoints = yAxisPoints;\n this._stringXAxisDataPoints = xAxisPoints;\n this._classNames = getClassNames(this.props.styles!, { theme: this.props.theme! });\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isBeakVisible: false,\n gapSpace: 8,\n ...this.props.calloutProps,\n isCalloutVisible: this.state.isCalloutVisible,\n id: this.state.calloutId,\n YValue: this.state.calloutYValue,\n legend: this.state.calloutLegend,\n color: this.state.calloutTextColor,\n target: this.state.target,\n styles: this._classNames.subComponentStyles.calloutStyles,\n directionalHint: DirectionalHint.topAutoEdge,\n onDismiss: this._closeCallout,\n ...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false),\n preventDismissOnLostFocus: true,\n };\n const chartHoverProps: IModifiedCartesianChartProps['chartHoverProps'] = {\n ...(this.state.ratio && {\n ratio: this.state.ratio,\n }),\n descriptionMessage: this.state.descriptionMessage,\n };\n return !this._isChartEmpty() ? (\n <CartesianChart\n {...this.props}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n chartHoverProps={chartHoverProps}\n styles={this._classNames.subComponentStyles!.cartesianStyles}\n datasetForXAxisDomain={this._stringXAxisDataPoints}\n stringDatasetForYAxisDomain={this._stringYAxisDataPoints}\n xAxisTickCount={this._stringXAxisDataPoints.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n svgFocusZoneProps={{\n direction: FocusZoneDirection.bidirectional,\n }}\n legendBars={this._createLegendBars()}\n onChartMouseLeave={this._handleChartMouseLeave}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: IChildProps) => {\n this._xAxisScale = props.xScale;\n this._yAxisScale = props.yScale;\n return this._createRectangles();\n }}\n />\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n this.props.data.forEach((item: IHeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n private _getOpacity = (legendTitle: string): string => {\n const opacity = this._legendHighlighted(legendTitle) || this._noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n private _rectRefCallback = (rectElement: SVGGElement, index: number | string, dataPointObject: FlattenData): void => {\n this._rectRefArray[index] = { data: dataPointObject, refElement: rectElement };\n };\n\n private _onRectFocus = (id: string, data: FlattenData): void => {\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n };\n\n private _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this.setState({\n target: this._rectRefArray[id].refElement,\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === data.legend,\n calloutYValue: `${data.rectText}`,\n calloutTextColor: this._colorScale(data.value),\n calloutLegend: data.legend,\n ratio: data.ratio || null,\n descriptionMessage: data.descriptionMessage || '',\n calloutId: id,\n callOutAccessibilityData: data.callOutAccessibilityData,\n });\n }\n };\n\n private _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n private _handleChartMouseLeave = (): void => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n private _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = this._stringYAxisDataPoints.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string, index1: number) => {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n this._dataSet[yAxisDataPoint].forEach((dataPointObject: FlattenData, index2: number) => {\n const id = `x${index1}y${index2}`;\n const rectElement: JSX.Element = (\n <g\n key={id}\n role=\"img\"\n aria-label={this._getAriaLabel(dataPointObject)}\n data-is-focusable={true}\n fillOpacity={this._getOpacity(dataPointObject.legend)}\n transform={`translate(${this._xAxisScale(dataPointObject.x)}, ${this._yAxisScale(dataPointObject.y)})`}\n ref={(gElement: SVGGElement) => {\n this._rectRefCallback(gElement, id, dataPointObject);\n }}\n onFocus={this._onRectFocus.bind(this, id, dataPointObject)}\n onBlur={this._onRectBlurOrMouseOut}\n onMouseOver={this._onRectMouseOver.bind(this, id, dataPointObject)}\n onMouseOut={this._onRectBlurOrMouseOut}\n >\n <rect\n fill={this._colorScale(dataPointObject.value)}\n width={this._xAxisScale.bandwidth()}\n height={this._yAxisScale.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={this._classNames.text}\n transform={`translate(${this._xAxisScale.bandwidth() / 2}, ${this._yAxisScale.bandwidth() / 2})`}\n >\n {convertToLocaleString(dataPointObject.rectText, this.props.culture)}\n </text>\n </g>\n );\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n private _onLegendHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n private _onLegendLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n private _onLegendClick(legendTitle: string): void {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n private _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = this.props;\n const legends: ILegend[] = [];\n data.forEach((item: IHeatMapChartData) => {\n const legend: ILegend = {\n title: item.legend,\n color: this._colorScale(item.value),\n action: () => {\n this._onLegendClick(item.legend);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n this._onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} />;\n };\n\n private _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = this.props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n private _getXIndex = (value: string | Date | number): string => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._xAxisType === XAxisTypes.StringAxis) {\n return value as string;\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n private _getYIndex = (value: string | Date | number): string => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (this._yAxisType === YAxisType.StringAxis) {\n return value as string;\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n private _createNewDataSet = (\n data: IHeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: IHeatMapChartData) => {\n item.data.forEach((point: IHeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = this._getXIndex(item.x);\n const posY = this._getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item]\n .sort((a: IHeatMapChartDataPoint, b: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.StringAxis) {\n return (a.x as string).toLowerCase() > (b.x as string).toLowerCase() ? 1 : -1;\n } else if (this._xAxisType === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n })\n .forEach((datapoint: IHeatMapChartDataPoint) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n datapoint.x = this._getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (this._xAxisType === XAxisTypes.NumericAxis) {\n datapoint.x = this._getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (this._xAxisType === XAxisTypes.StringAxis) {\n datapoint.x = this._getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (this._yAxisType === YAxisType.DateAxis) {\n datapoint.y = this._getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (this._yAxisType === YAxisType.NumericAxis) {\n datapoint.y = this._getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (this._yAxisType === YAxisType.StringAxis) {\n datapoint.y = this._getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n yPoints[this._getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n yPoints[`${this._getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[this._getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = this._getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = this._getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n };\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n private _getXAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis || this._xAxisType === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (this._xAxisType === XAxisTypes.DateAxis) {\n return this._getStringFormattedDate(xPoint, this.props.xAxisDateFormatString);\n } else if (this._xAxisType === XAxisTypes.NumericAxis) {\n return this._getStringFormattedNumber(xPoint, this.props.xAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n };\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n private _getYAxisDataPoints = (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (this._yAxisType === YAxisType.DateAxis || this._yAxisType === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (this._yAxisType === YAxisType.DateAxis) {\n return this._getStringFormattedDate(yPoint, this.props.yAxisDateFormatString);\n } else if (this._yAxisType === YAxisType.NumericAxis) {\n return this._getStringFormattedNumber(yPoint, this.props.yAxisNumberFormatString);\n } else {\n return this._getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n };\n\n private _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n private _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n private _getFormattedLabelForXAxisDataPoint = (point: string): string => {\n const { xAxisStringFormatter } = this.props;\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n };\n\n private _getFormattedLabelForYAxisDataPoint = (point: string): string => {\n const { yAxisStringFormatter } = this.props;\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n };\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n}\n"]}