@fluentui/react-charting 5.25.4 → 5.25.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.json +48 -1
  2. package/CHANGELOG.md +15 -2
  3. package/dist/react-charting.d.ts +36 -0
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +8 -0
  7. package/lib/components/CommonComponents/CartesianChart.base.js +1 -1
  8. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  10. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +199 -61
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  13. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  14. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  15. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +4 -0
  16. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  17. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  18. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +55 -5
  19. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  20. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
  21. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  22. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  23. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  24. package/lib/components/LineChart/LineChart.base.js +1 -1
  25. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  26. package/lib/components/SankeyChart/SankeyChart.base.js +1 -1
  27. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  28. package/lib/components/ScatterChart/ScatterChart.base.js +13 -4
  29. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  30. package/lib/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  31. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  32. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -7
  33. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  34. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +18 -5
  35. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  36. package/lib/types/IDataPoint.d.ts +19 -0
  37. package/lib/types/IDataPoint.js.map +1 -1
  38. package/lib/utilities/utilities.d.ts +4 -2
  39. package/lib/utilities/utilities.js +22 -7
  40. package/lib/utilities/utilities.js.map +1 -1
  41. package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -1
  42. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  43. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  44. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  45. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +199 -61
  46. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  47. package/lib-amd/components/DonutChart/Pie/Pie.js +4 -2
  48. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  49. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +4 -0
  50. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  51. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  52. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
  53. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  54. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -2
  55. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  56. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  57. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  58. package/lib-amd/components/LineChart/LineChart.base.js +1 -1
  59. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  60. package/lib-amd/components/SankeyChart/SankeyChart.base.js +1 -1
  61. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  62. package/lib-amd/components/ScatterChart/ScatterChart.base.js +13 -4
  63. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  64. package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  65. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
  66. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -7
  67. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  68. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +18 -5
  69. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  70. package/lib-amd/types/IDataPoint.d.ts +19 -0
  71. package/lib-amd/types/IDataPoint.js.map +1 -1
  72. package/lib-amd/utilities/utilities.d.ts +4 -2
  73. package/lib-amd/utilities/utilities.js +22 -7
  74. package/lib-amd/utilities/utilities.js.map +1 -1
  75. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -1
  76. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  77. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  78. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  79. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +199 -61
  80. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  81. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  82. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  83. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +4 -0
  84. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  85. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
  86. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
  87. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  88. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
  89. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
  90. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
  91. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  92. package/lib-commonjs/components/LineChart/LineChart.base.js +1 -1
  93. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  94. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +1 -1
  95. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  96. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +13 -4
  97. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  98. package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +4 -0
  99. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  100. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -7
  101. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  102. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +18 -5
  103. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  104. package/lib-commonjs/types/IDataPoint.d.ts +19 -0
  105. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  106. package/lib-commonjs/utilities/utilities.d.ts +4 -2
  107. package/lib-commonjs/utilities/utilities.js +22 -7
  108. package/lib-commonjs/utilities/utilities.js.map +1 -1
  109. package/package.json +1 -1
  110. package/src/components/CommonComponents/CartesianChart.types.ts +5 -0
  111. package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +11 -0
  112. package/src/components/ScatterChart/ScatterChart.types.ts +5 -0
@@ -831,7 +831,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
831
831
  var state = this.state;
832
832
  if (state.selectedState && state.selectedLinks.has(singleLink.index)) {
833
833
  var selectedNode = state.selectedNode;
834
- return selectedNode ? selectedNode.color : gradientUrl;
834
+ return singleLink ? singleLink.color : selectedNode ? selectedNode.color : gradientUrl;
835
835
  }
836
836
  };
837
837
  SankeyChartBase.prototype._fillStreamBorder = function (singleLink, gradientUrl) {
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.base.tsx"],"names":[],"mappings":";;;;IAkMA,gDAWC;IAqFD,sCAYC;IAwDD,0CAiBC;IAxVD,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8C,CAAC;IACvF,IAAM,kBAAkB,GAAG,GAAG,CAAC;IAsC/B,IAAM,kCAAkC,GAAW,SAAS,CAAC;IAC7D,IAAM,mBAAmB,GAAiB;QACxC,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SA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;QAED,8DAA8D;QACtD,sCAAY,GAApB,UAAqB,GAAQ;YAC3B,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAC1B,CAAC;QAEO,uCAAa,GAArB;;YACE,IAAM,eAAe,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,0CAAE,eAAe,CAAC;YACzD,OAAO,CAAC,CAAC,eAAe,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpG,CAAC;QA1xBa,4BAAY,GAA+B;YACvD,YAAY,EAAE,IAAI;SACnB,AAFyB,CAExB;QAoyBJ,sBAAC;KAAA,AAvyBD,CAAqC,KAAK,CAAC,SAAS,GAuyBnD;IAvyBY,0CAAe","sourcesContent":["import { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet, ITheme } from '@fluentui/react/lib/Styling';\nimport {\n IStyleFunctionOrObject,\n classNamesFunction,\n format,\n getId,\n getRTL,\n initializeComponentRef,\n memoizeFunction,\n} from '@fluentui/react/lib/Utilities';\nimport { sum as d3Sum } from 'd3-array';\nimport { SankeyGraph, SankeyLayout, sankey as d3Sankey, sankeyJustify, sankeyRight } from 'd3-sankey';\nimport { BaseType, Selection as D3Selection, select, selectAll } from 'd3-selection';\nimport { area as d3Area, curveBumpX as d3CurveBasis } from 'd3-shape';\nimport * as React from 'react';\nimport { IBasestate, IChart, IImageExportOptions, SLink, SNode } from '../../types/IDataPoint';\nimport { ChartHoverCard } from '../../utilities/ChartHoverCard/ChartHoverCard';\nimport { IChartHoverCardProps } from '../../utilities/ChartHoverCard/ChartHoverCard.types';\nimport { IMargins } from '../../utilities/utilities';\nimport {\n ISankeyChartAccessibilityProps,\n ISankeyChartData,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart.types';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\n\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\nconst PADDING_PERCENTAGE = 0.3;\n\ntype NodeId = number | string;\ntype ItemValues<T> = { [key: NodeId]: T };\ntype NodeValues = ItemValues<number>;\ntype LinkItemValues<T> = { [key: NodeId]: ItemValues<T> };\ntype LinkValues = LinkItemValues<number>;\n\ntype NodesInColumns = { [key: number]: SNode[] };\ntype NormalizedData = ISankeyChartData & {\n width: number;\n height: number;\n};\n\ntype NormalizeDiagramFunction = (\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n) => NormalizedData;\n\ntype NodeColors = { fillColor: string; borderColor: string };\ntype SankeyLayoutGenerator = SankeyLayout<SankeyGraph<{}, {}>, {}, {}>;\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';\nconst NODE_WIDTH = 124;\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\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): {\n selectedLinks: Set<SLink>;\n selectedNodes: Set<SNode>;\n} {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 */\n// This is exported for unit tests.\nexport function groupNodesByColumn(graph: ISankeyChartData): NodesInColumns {\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(\n nodesInColumn: NodesInColumns,\n computedNodes: NodeValues,\n originalLinks: LinkValues,\n): void {\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 const onePercent = 0.01 * columnValue;\n const columnNodes = nodesInColumn[index];\n columnNodes.forEach((node: SNode) => {\n const value = computedNodes[node.nodeId];\n const nodePercentage = (value / columnValue) * 100;\n node.actualValue = 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 = onePercent;\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 // Loop through each node in that column and scale that node--and its incoming and outgoing links--by the\n // scaling ratio. We need the sankey diagram to re-layout the nodes and links after we do this.\n columnNodes.forEach((node: SNode) => {\n const normalized = (node.value = node.value! / scalingRatio);\n // Which Original Value? and Which Normalized Value is needed, here? The Node? The Link? Both?\n changeColumnValue(node, computedNodes[node.nodeId], normalized, originalLinks);\n });\n }\n });\n}\n\n/**\n * This is used for normalizing each link's value to reflect the normalized node value.\n */\nfunction changeColumnValue(\n node: SNode,\n originalNodeValue: number,\n normalizedNodeValue: number,\n linkValues: LinkValues,\n) {\n // For each link in the source and target, compute the proportion that this link contributes to the total\n // then adjust the link's value to reflect its proportion of the normalized node value.\n const updateLinkValue = (link: SLink) => {\n const value = linkValue(linkValues, link);\n link.unnormalizedValue = value;\n const linkRatio = value / originalNodeValue;\n link.value = Math.max(normalizedNodeValue * linkRatio, link.value);\n };\n node.sourceLinks!.forEach(updateLinkValue);\n node.targetLinks!.forEach(updateLinkValue);\n}\n\n/**\n * This is used for calculating the node non normalized value based on link non normalized value.\n * The links have the original weights. Computed nodes have the total weight of all incoming and outgoing links.\n */\nfunction populateNodeActualValue(data: ISankeyChartData, computedNodes: NodeValues, originalLinks: LinkValues) {\n data.links.forEach((link: SLink) => {\n if (!link.unnormalizedValue) {\n link.unnormalizedValue = linkValue(originalLinks, link);\n }\n });\n data.nodes.forEach((node: SNode) => {\n node.actualValue = computedNodes[node.nodeId as NodeId];\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// This is exported for unit tests\nexport function adjustPadding(sankey: SankeyLayoutGenerator, height: number, nodesInColumn: NodesInColumns): void {\n let padding = sankey.nodePadding();\n const minPadding = PADDING_PERCENTAGE * height;\n Object.values(nodesInColumn).forEach((column: SNode[]) => {\n const totalPaddingInColumn = height - d3Sum(column, (node: SNode) => node.y1! - node.y0!);\n if (minPadding < totalPaddingInColumn) {\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 sankey.nodePadding(padding);\n}\n\nfunction idFromNumberOrSNode(node: SNode | number): NodeId {\n if (typeof node === 'number') {\n return node;\n }\n return node.nodeId as NodeId;\n}\n\n/**\n * Duplicates the supplied chart data so that we do not alter the original.\n * @param data The data to duplicate.\n * @returns The duplicated data.\n */\nfunction duplicateData(data: ISankeyChartData): ISankeyChartData {\n return {\n nodes: data.nodes.map(\n (node: SNode): SNode => ({\n ...node,\n }),\n ),\n links: data.links.map(\n (link: SLink): SLink => ({\n ...link,\n }),\n ),\n };\n}\n\nfunction valuesOfNodes(nodes: SNode[]): NodeValues {\n const result: NodeValues = {};\n nodes.forEach((node: SNode) => {\n result[node.nodeId as NodeId] = node.value!;\n });\n return result;\n}\n\nfunction valuesOfLinks(links: SLink[]): LinkValues {\n const result: LinkValues = {};\n links.forEach((link: SLink) => {\n const sourceId = idFromNumberOrSNode(link.source);\n let sourceToTarget = result[sourceId];\n if (!sourceToTarget) {\n sourceToTarget = {};\n result[sourceId] = sourceToTarget;\n }\n sourceToTarget[idFromNumberOrSNode(link.target)] = link.value;\n });\n return result;\n}\n\nfunction linkValue<T>(originalLinks: LinkItemValues<T>, link: SLink): T {\n return originalLinks[idFromNumberOrSNode(link.source)][idFromNumberOrSNode(link.target)];\n}\n\n// This is exported for unit tests.\nexport function preRenderLayout(\n margins: IMargins,\n containerWidth: number,\n containerHeight: number,\n isRtl: boolean,\n): { sankey: SankeyLayoutGenerator; height: number; width: number } {\n const { left, right, top, bottom } = margins;\n\n const sankey = d3Sankey()\n .nodeWidth(NODE_WIDTH)\n .extent([\n [left!, top!],\n [containerWidth - right!, containerHeight - bottom!],\n ])\n .nodeAlign(isRtl ? sankeyRight : sankeyJustify);\n\n return { sankey, height: containerHeight, width: containerWidth };\n}\n\nconst elipsis = '...';\n\n/**\n * This is used to assign node fillcolors and borderColor cyclically when the user doesnt\n * provide color to individual node.\n */\nfunction assignNodeColors(\n nodes: SNode[],\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n) {\n let colors: string[];\n let borders: string[];\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 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/**\n * Takes in the display name for the node and potentially returns a trimmed version of the name.\n * @param tspan the `tspan` element to use for text visual length measurement\n * @param text is the text which we will potentially 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 * @returns the name to show on the node which might be the truncated `text` if the `text` is too long\n */\nfunction truncateText(tspan: TSpanForTextMeasuring, text: string, rectangleWidth: number, padding: number) {\n // NOTE: This method is the most-expensive in terms of rerendering components.\n const textLengthForNodeName = rectangleWidth - padding; // This can likely be computed once and passed in.\n // The following `select` statement injects a `tempText` element into the DOM. This injection\n // (and subsequent removal) is causing a layout recalculation. This is a performance issue.\n // Note that this code will always inject a `tempText` element, but doesn't always remove it. This is a bug.\n if (fitsWithinNode(tspan, text, textLengthForNodeName)) {\n return text;\n }\n // Computing the size of elipsis is performed with each node. This should be computed once and used everywhere.\n // TODO: Compute the size of the elipsis once and use it everywhere.\n const elipsisLength = computeElipsisLength(tspan);\n let line: string = '';\n // Calculate how much of the original text to show.\n // TODO: The folllowing is O(n). We could use a binary search to make this faster: O(log(n)).\n for (let i = 0; i < text.length; i++) {\n line += text[i];\n tspan.text(line);\n const currentNode = tspan.node();\n if (currentNode !== null) {\n const w = currentNode!.getComputedTextLength();\n if (w >= textLengthForNodeName - elipsisLength) {\n line = line.slice(0, -1);\n line += elipsis;\n break;\n }\n }\n }\n tspan.text(null);\n return line;\n}\n\ntype RenderedNodeAttributes = {\n readonly reactId: string;\n readonly gElementId: string;\n readonly name: string;\n readonly aria: string;\n readonly trimmed: boolean;\n readonly height: number;\n readonly weightOffset: number;\n};\n\ntype RenderedLinkAttributes = {\n readonly reactId: string;\n readonly aria: string;\n readonly from: string;\n};\n\ntype TSpanForTextMeasuring = D3Selection<SVGTSpanElement, unknown, HTMLElement, unknown>;\n\nfunction fitsWithinNode(tspan: TSpanForTextMeasuring, text: string, textLengthForNodeName: number): boolean {\n const measurement = measureText(tspan, text);\n if (measurement === undefined) {\n return false;\n }\n return measurement <= textLengthForNodeName;\n}\n\nfunction measureText(tspan: TSpanForTextMeasuring, text: string | number): number | undefined {\n try {\n tspan.text(text);\n return tspan.node()?.getComputedTextLength();\n } finally {\n tspan.text(null);\n }\n}\n\nfunction computeElipsisLength(tspan: TSpanForTextMeasuring): number {\n const measurement = measureText(tspan, elipsis);\n return measurement === undefined ? 0 : measurement;\n}\n\nfunction computeLinkAttributes(\n links: SLink[],\n linkFrom: (node: SNode) => string,\n linkAriaLabel: (link: SLink) => string,\n): LinkItemValues<RenderedLinkAttributes> {\n const result: LinkItemValues<RenderedLinkAttributes> = {};\n links.forEach((link: SLink) => {\n const sourceId = idFromNumberOrSNode(link.source);\n let sourceToTarget = result[sourceId];\n if (!sourceToTarget) {\n sourceToTarget = {};\n result[sourceId] = sourceToTarget;\n }\n sourceToTarget[idFromNumberOrSNode(link.target)] = {\n reactId: getId('link'),\n from: linkFrom(link.source as SNode),\n aria: linkAriaLabel(link),\n };\n });\n\n return result;\n}\n\ntype ItemPositions = {\n readonly x0: number;\n readonly y0: number;\n readonly x1: number;\n readonly y1: number;\n};\n\ntype SankeyLinkWithPositions = ItemPositions & {\n readonly source: ItemPositions;\n readonly target: ItemPositions;\n readonly width: number;\n};\n\ntype AreaDataPoint = {\n readonly x: number;\n readonly y0: number;\n readonly y1: number;\n};\n\nconst linkToDataPoints = (d: SankeyLinkWithPositions): [AreaDataPoint, AreaDataPoint] => {\n const halfWidth = d.width * 0.5;\n const y0 = d.y0;\n const y1 = d.y1;\n return [\n { x: d.source.x1, y0: y0 + halfWidth, y1: y0 - halfWidth },\n { x: d.target.x0, y0: y1 + halfWidth, y1: y1 - halfWidth },\n ];\n};\n\nconst linkArea = d3Area<AreaDataPoint>()\n .x((p: AreaDataPoint) => p.x)\n .y0((p: AreaDataPoint) => p.y0)\n .y1((p: AreaDataPoint) => p.y1)\n .curve(d3CurveBasis);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TooltipDiv = D3Selection<BaseType, unknown, HTMLElement, any>;\n\nfunction nodeTextColor(state: Readonly<ISankeyChartState>, singleNode: SNode): string {\n return !(\n !state.selectedState ||\n (state.selectedNodes.has(singleNode.index!) && state.selectedNode) ||\n !state.selectedNode\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR;\n}\n\ntype StringRenderer = {\n linkFrom: (node: SNode) => string;\n};\n\ntype AccessibilityRenderer = {\n emptyAriaLabel: string;\n nodeAriaLabel: (node: SNode, weight: number) => string;\n linkAriaLabel: (link: SLink) => string;\n};\n\n// NOTE: To start employing React.useMemo properly, we need to convert this code from a React.Component\n// to a function component. This will require a significant refactor of the code in this file.\n// https://stackoverflow.com/questions/60223362/fast-way-to-convert-react-class-component-to-functional-component\n// I am concerned that doing so would break this contract, making it difficult for consuming code.\nexport class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> implements IChart {\n public static defaultProps: Partial<ISankeyChartProps> = {\n enableReflow: true,\n };\n\n public chartContainer: HTMLDivElement;\n private _reqID: number;\n private readonly _calloutId: string;\n private readonly _linkId: string;\n private readonly _chartId: string;\n private readonly _emptyChartId: string;\n private readonly _labelTooltipId: string;\n private readonly _margins: IMargins;\n private readonly _isRtl: boolean = getRTL();\n private _numColumns: number = 0;\n\n private readonly _computeClassNamesProps: (\n theme: ITheme,\n pathColor: string,\n className: string,\n containerWidth: number,\n containerHeight: number,\n enableReflow: boolean | undefined,\n ) => ISankeyChartStyleProps;\n private readonly _computeClassNames: (\n styles: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>,\n classNamesProps: ISankeyChartStyleProps,\n ) => IProcessedStyleSet<ISankeyChartStyles>;\n private readonly _normalizeData: NormalizeDiagramFunction;\n private readonly _fetchTooltip: (classNames: IProcessedStyleSet<ISankeyChartStyles>) => TooltipDiv;\n private readonly _nodeAttributes: (\n nodes: SNode[],\n nodeAriaLabel: (node: SNode, weight: number) => string,\n ) => ItemValues<RenderedNodeAttributes>;\n private readonly _linkAttributes: (\n links: SLink[],\n linkFrom: (node: SNode) => string,\n linkAriaLabel: (link: SLink) => string,\n ) => LinkItemValues<RenderedLinkAttributes>;\n private readonly _fetchNodes: (\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n nodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ) => React.ReactNode[] | undefined;\n private readonly _fetchLinks: (\n links: SLink[],\n linkAttributes: LinkItemValues<RenderedLinkAttributes>,\n ) => React.ReactNode[] | undefined;\n\n private readonly _strings: StringRenderer;\n private readonly _accessibility: AccessibilityRenderer;\n\n constructor(props: ISankeyChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\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._chartId = getId('sankeyChart');\n this._emptyChartId = getId('_SankeyChart_empty');\n this._labelTooltipId = getId('tooltip');\n this._margins = { top: 36, right: 48, bottom: 32, left: 48 };\n // We memo-ize creation so that we only create a new object when any of the fields change.\n this._computeClassNamesProps = memoizeFunction(\n (\n theme: ITheme,\n pathColor: string,\n className: string,\n containerWidth: number,\n containerHeight: number,\n enableReflow: boolean | undefined,\n ): ISankeyChartStyleProps => ({\n theme: theme!,\n width: containerWidth,\n height: containerHeight,\n pathColor,\n className,\n enableReflow,\n }),\n );\n // `getClassNames` is memoized underneath, so it only recomputes when the `styles` or `classNamesProps` change.\n // We memoize `classNamesProps` so that we only create new class names when absolutely necessary,\n // and so that we can memoize the `_createNodes` method.\n this._computeClassNames = memoizeFunction(\n (\n styles: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>,\n classNamesProps: ISankeyChartStyleProps,\n ) => getClassNames(styles, classNamesProps),\n );\n this._normalizeData = memoizeFunction(\n (\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n ) => this._normalizeSankeyData(data, containerWidth, containerHeight, colorsForNodes, borderColorsForNodes),\n );\n this._fetchTooltip = memoizeFunction((classNames: IProcessedStyleSet<ISankeyChartStyles>) =>\n this._labelTooltipDiv(classNames),\n );\n // Prepare the localization utilities\n this._strings = memoizeFunction((strings?: ISankeyChartStrings): StringRenderer => {\n const fromString = strings?.linkFrom || 'From {0}';\n // NOTE: The `node` parameter is the sankey-generated node on the link, and not the original `node` supplied\n // by the caller.\n return {\n linkFrom: (node: SNode) => format(fromString, node.name),\n };\n })(props.strings);\n this._accessibility = memoizeFunction((accessibility?: ISankeyChartAccessibilityProps): AccessibilityRenderer => {\n const linkString = accessibility?.linkAriaLabel || 'link from {0} to {1} with weight {2}';\n const nodeString = accessibility?.nodeAriaLabel || 'node {0} with weight {1}';\n return {\n emptyAriaLabel: accessibility?.emptyAriaLabel || 'Graph has no data to display',\n linkAriaLabel: (link: SLink) =>\n format(\n linkString,\n (link.source as SNode).name,\n (link.target as SNode).name,\n link.unnormalizedValue ? this._formatNumber(link.unnormalizedValue) : link.unnormalizedValue,\n ),\n nodeAriaLabel: (node: SNode, weight: number) => format(nodeString, node.name, this._formatNumber(weight)),\n };\n })(props.accessibility);\n // NOTE: Memoizing the `_createNodes` and `_createLinks` methods would break the hoverability of the chart\n // because the nodes are currently created differently based on the layout information. Hence why we do not\n // memoize these methods (but have stubs for memoizing as the `_fetchNodes` and `_fetchLinks` methods).\n this._nodeAttributes = memoizeFunction((nodes: SNode[], nodeAriaLabel: (node: SNode, weight: number) => string) =>\n this._computeNodeAttributes(nodes, nodeAriaLabel),\n );\n this._fetchNodes = (\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n nodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ) => this._createNodes(classNames, nodes, nodeAttributes, tooltipDiv);\n this._linkAttributes = memoizeFunction(\n (links: SLink[], linkFrom: (node: SNode) => string, linkAriaLabel: (link: SLink) => string) =>\n computeLinkAttributes(links, linkFrom, linkAriaLabel),\n );\n this._fetchLinks = (links: SLink[], linkAttributes: LinkItemValues<RenderedLinkAttributes>) =>\n this._createLinks(links, linkAttributes);\n // Our shorter path to performance is to pre-compute the truncated labels of each node because\n // that should not change based on the position of the mouse. This is a shorter path becase the code which\n // computes the truncated labels creates and destroys a `tempText` element in the DOM. This is causing a\n // reflow and repaint of the entire chart. This is a performance issue, and so computing the truncated labels\n // once will help to mitigate this issue.\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, colorsForNodes, borderColorsForNodes } = this.props;\n const state = this.state;\n const classNamesProps = this._computeClassNamesProps(\n theme!,\n pathColor!,\n className!,\n state.containerWidth,\n state.containerHeight,\n this.props.enableReflow,\n );\n const classNames: IProcessedStyleSet<ISankeyChartStyles> = this._computeClassNames(styles!, classNamesProps);\n\n // Compute the position of each node and link\n const { nodes, links, width, height } = this._normalizeData(\n this.props.data.SankeyChartData!,\n state.containerWidth,\n state.containerHeight,\n colorsForNodes,\n borderColorsForNodes,\n );\n\n // In FocusZone, the focus order is determined by the rendering order of the elements. We need to find\n // a rendering order such that the focus moves through the nodes and links in a logical sequence.\n // Rendering the nodes and links layer by layer in a vertical order seems to be the most effective solution\n // with FocusZone. Although this focus order may not be entirely logical, it ensures that the focus moves\n // sequentially and prevents links (especially skip layer links) from being rendered over the nodes.\n const nodeLinkDomOrderArray: { layer: number; type: string; index: number }[] = [];\n nodes.sort((a: SNode, b: SNode) => {\n if (a.x0 !== b.x0) {\n return a.x0! - b.x0!;\n }\n return a.y0! - b.y0!;\n });\n nodes.forEach((item: SNode, index) => {\n nodeLinkDomOrderArray.push({ layer: item.layer!, type: 'node', index });\n });\n links.sort((a: SLink, b: SLink) => {\n const asx0 = (a.source as SNode).x0;\n const bsx0 = (b.source as SNode).x0;\n if (asx0 !== bsx0) {\n return asx0! - bsx0!;\n }\n return a.y0! - b.y0!;\n });\n links.forEach((item: SLink, index) => {\n nodeLinkDomOrderArray.push({ layer: (item.source as SNode).layer!, type: 'link', index });\n });\n nodeLinkDomOrderArray.sort((a, b) => {\n if (a.layer !== b.layer) {\n return a.layer - b.layer;\n }\n\n if (a.type > b.type) {\n return -1;\n }\n if (a.type < b.type) {\n return 1;\n }\n return 0;\n });\n\n // NOTE: I don't love this approach to caching the \"select\" result. Is it still valid from render-to-render?\n // although local testing seems to indicate so, I do not trust that React will always support that instance.\n // It might be better to perform this `fetch` within the `_showTooltip` and `_hideTooltip` methods.\n const tooltipDiv = this._fetchTooltip(classNames);\n // Pre-compute some important attributes about nodes, specifically text\n const nodeAttributes = this._nodeAttributes(nodes, this._accessibility.nodeAriaLabel);\n // Build the nodes and links as rendered in the UX.\n const nodeData = this._fetchNodes(classNames, nodes, nodeAttributes, tooltipDiv);\n const linkAttributes = this._linkAttributes(links, this._strings.linkFrom, this._accessibility.linkAriaLabel);\n const linkData = this._fetchLinks(links, linkAttributes);\n\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 ...this.props.calloutProps!,\n };\n return (\n <div\n className={classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => {\n this.chartContainer = rootElem;\n }}\n onMouseLeave={this._onCloseCallout}\n >\n {/*\n - Horizontal navigation has been disabled because the nodes and links are rendered vertically,\n causing the left/right arrow keys to move focus up or down to the previous or next sibling element.\n - Bidirectional navigation has been disabled because it causes the up/down arrow keys to move the focus\n in a non-sequential and erratic manner within a 2D grid.\n */}\n <FocusZone direction={FocusZoneDirection.vertical} className={classNames.chartWrapper}>\n <svg width={width} height={height} id={this._chartId} className={classNames.chart}>\n {nodeLinkDomOrderArray.map(item => {\n if (item.type === 'node') {\n return (\n <g key={nodes[item.index].nodeId} className={classNames.nodes}>\n {nodeData![item.index]}\n </g>\n );\n } else {\n return (\n <g\n key={`${(links[item.index].source as SNode).nodeId}-${\n (links[item.index].target as SNode).nodeId\n }`}\n className={classNames.links}\n strokeOpacity={1}\n >\n {linkData![item.index]}\n </g>\n );\n }\n })}\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={this._accessibility.emptyAriaLabel}\n />\n );\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage([{ container: this.chartContainer }], undefined, this._isRtl, opts);\n };\n\n private _computeNodeAttributes(\n nodes: SNode[],\n nodeAriaLabel: (node: SNode, weight: number) => string,\n ): ItemValues<RenderedNodeAttributes> {\n const result: ItemValues<RenderedNodeAttributes> = {};\n const weightSpan = select('.nodeName').append('text').attr('class', 'tempText').append('tspan').text(null);\n const nameSpan = select('.nodeName')\n .append('text')\n .attr('class', 'tempText')\n .attr('font-size', '10')\n .append('tspan')\n .text(null);\n nodes.forEach((singleNode: SNode) => {\n const height = Math.max(singleNode.y1! - singleNode.y0!, 0);\n let padding = 8;\n let textLengthForNodeWeight = 0;\n\n const nodeValue = singleNode.actualValue!;\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 // The following `select` statement injects a `tempText` element into the DOM. This injection\n // (and subsequent removal) is causing a layout recalculation. This is a performance issue.\n const measurement = measureText(weightSpan, this._formatNumber(nodeValue));\n if (measurement !== undefined) {\n textLengthForNodeWeight = measurement;\n padding = padding + textLengthForNodeWeight;\n }\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 = truncateText(nameSpan, singleNode.name, NODE_WIDTH - 8, padding);\n const isTruncated: boolean = truncatedname.slice(-3) === elipsis;\n result[singleNode.nodeId] = {\n reactId: getId('nodeBar'),\n gElementId: getId('nodeGElement'),\n name: truncatedname,\n aria: nodeAriaLabel(singleNode, nodeValue),\n trimmed: isTruncated,\n height,\n weightOffset: textLengthForNodeWeight,\n };\n });\n selectAll('.tempText').remove();\n return result;\n }\n\n private _linkCalloutAttributes(\n singleLink: SLink,\n from: string,\n ): IChartHoverCardProps & {\n selectedLink: SLink;\n isCalloutVisible: boolean;\n color: string;\n xCalloutValue: string;\n yCalloutValue: string;\n descriptionMessage: string;\n } {\n return {\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color!,\n xCalloutValue: (singleLink.target as SNode).name,\n yCalloutValue: this._formatNumber(singleLink.unnormalizedValue!),\n descriptionMessage: from,\n };\n }\n\n private _normalizeSankeyData(\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n ): NormalizedData {\n const { sankey, height, width } = preRenderLayout(this._margins, containerWidth, containerHeight, this._isRtl);\n // Clone the data before mutating it (via the SankeyLayoutGenerator) so that we don't mutate the original data.\n const transformed: ISankeyChartData = duplicateData(data);\n sankey(transformed);\n // NOTE: After the prior line, `transformed` is now a more-complex object than the incoming `ISankeyChartData`.\n // `transformed` should be cast to a more-specific type. This is a breaking change because we would be eliminating\n // fields from `ISankeyChartData` and putting those fields on a now-local type. But doing so makes it clearer what\n // the caller needs to supply and why. For example, the `actualValue` and `layer` fields of `ISNodeExtra` should\n // both be moved. Similarly for `unnormalizedValue` in `ISLinkExtra`.\n // `SankeyNodeMinimal` and `SankeyLinkMinimal` are both the types after `sankey(transformed)`, but have almost no\n // bearing on the data before `sankey(transformed)` (which is basically nodes with ids and names along with links\n // with source index, target index, and value).\n const nodesInColumn = groupNodesByColumn(transformed);\n this._numColumns = Object.keys(nodesInColumn).length;\n // Keep track of the original values of the links and their acccumulated values in the nodes\n // Setting these in external objects so they cannot be mutated by other code.\n // The IDs of nodes can be numbers or strings. But, the IDs of links are always the index into the \"nodes\" array.\n // After the sankey layout is computed, the each link's `source` and `target` will have the ID of the node in the\n // type originally specified in the Nodes array. Consequently, we get the values of those links after the sankey\n // transformation.\n const nodeValues = valuesOfNodes(transformed.nodes);\n const linkValues = valuesOfLinks(transformed.links);\n adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);\n adjustPadding(sankey, containerHeight - this._margins.top! - this._margins.bottom!, nodesInColumn);\n // `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.\n // NOTE: The second call to `sankey` is required to allow links to be hoverable.\n // Without the second call, the links are not hoverable.\n sankey(transformed);\n populateNodeActualValue(transformed, nodeValues, linkValues);\n assignNodeColors(transformed.nodes, colorsForNodes, borderColorsForNodes);\n return {\n width,\n height,\n nodes: transformed.nodes,\n links: transformed.links,\n };\n }\n\n private _labelTooltipDiv(classNames: IProcessedStyleSet<ISankeyChartStyles>): TooltipDiv {\n // find the tooltip div. If it doesn't exist, then create it.\n let tooltipDiv = select(`#${this._labelTooltipId}`);\n if (tooltipDiv.empty()) {\n tooltipDiv = select('body')\n .append('div')\n .attr('id', this._labelTooltipId)\n .attr('class', classNames.toolTip!)\n .style('opacity', 0);\n }\n // If the div exists, then `classNames` has changed; update the `class` on the `div`.\n tooltipDiv.attr('class', classNames.toolTip!);\n return tooltipDiv;\n }\n\n private _createLinks(\n dataLinks: SLink[],\n linkAttributes: LinkItemValues<RenderedLinkAttributes>,\n ): React.ReactNode[] | undefined {\n if (dataLinks) {\n const linkId = this._linkId;\n return dataLinks.map((singleLink: SLink, index: number): React.ReactNode => {\n const onMouseOut = () => {\n this._onStreamLeave(singleLink);\n };\n const { reactId, from, aria } = linkValue(linkAttributes, singleLink);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataPoints: Array<any> = linkToDataPoints(singleLink as unknown as SankeyLinkWithPositions);\n const key = `${linkId}-${index}`;\n const gradientId = `gradient-${key}`;\n const gradientUrl = `url(#${gradientId})`;\n const source = singleLink.source as SNode;\n const target = singleLink.target as SNode;\n // TODO: localize the aria-label string\n return (\n <g key={key}>\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0\" stopColor={source.color} />\n <stop offset=\"100%\" stopColor={target.color} />\n </linearGradient>\n </defs>\n <path\n d={linkArea(dataPoints)!}\n id={reactId}\n fill={this._fillStreamColors(singleLink, gradientUrl)}\n stroke={this._fillStreamBorder(singleLink, gradientUrl)}\n strokeWidth=\"2\"\n strokeOpacity={this._getOpacityStreamBorder(singleLink)}\n onMouseOver={event => this._onStreamHover(event, singleLink, from)}\n onMouseOut={onMouseOut}\n onFocus={event => this._onFocusLink(event, singleLink, from)}\n onBlur={this._onBlur}\n fillOpacity={this._getOpacityStream(singleLink)}\n data-is-focusable={true}\n aria-label={aria}\n role=\"img\"\n />\n </g>\n );\n });\n }\n return [];\n }\n\n private _createNodes(\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n dataNodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ): React.ReactNode[] | undefined {\n if (dataNodes) {\n const state = this.state;\n const textAnchor = this._isRtl ? 'end' : 'start';\n return dataNodes.map((singleNode: SNode, index: number): React.ReactNode => {\n const onMouseOut = () => {\n this._onLeave(singleNode);\n };\n const {\n reactId: nodeId,\n gElementId,\n height,\n trimmed: isTruncated,\n name: truncatedName,\n weightOffset: textLengthForNodeWeight,\n aria,\n } = nodeAttributes[singleNode.nodeId];\n const tooTall = height > MIN_HEIGHT_FOR_DOUBLINE_TYPE;\n const { name, actualValue, x0, x1, y0 } = singleNode;\n const textColor = nodeTextColor(state, singleNode);\n return (\n <g key={index} id={gElementId}>\n <rect\n x={x0}\n y={y0}\n height={height}\n width={x1! - 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={aria}\n role=\"img\"\n />\n {height > MIN_HEIGHT_FOR_TYPE && (\n <g className={classNames.nodeTextContainer}>\n <g className=\"nodeName\">\n <text\n id={`${nodeId}-name`}\n x={x0}\n y={y0}\n dy={'1.2em'}\n dx={'0.4em'}\n textAnchor={textAnchor}\n fontWeight=\"regular\"\n aria-hidden=\"true\"\n fill={textColor}\n fontSize={10}\n onMouseOver={this._showTooltip.bind(this, name, isTruncated, tooltipDiv)}\n onMouseOut={this._hideTooltip.bind(this, tooltipDiv)}\n >\n {truncatedName}\n </text>\n </g>\n\n <text\n x={tooTall ? x0 : x1! - textLengthForNodeWeight - 8}\n y={y0}\n dy={tooTall ? '2em' : '1em'}\n dx={tooTall ? '0.4em' : '0em'}\n textAnchor={textAnchor}\n fontWeight=\"bold\"\n aria-hidden=\"true\"\n fill={textColor}\n fontSize={14}\n >\n {actualValue ? this._formatNumber(actualValue) : actualValue}\n </text>\n </g>\n )}\n </g>\n );\n });\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 yCalloutValue: this._formatNumber(singleNode.actualValue!),\n });\n }\n }\n\n private _formatNumber(value: number): string {\n return this.props.formatNumberOptions\n ? value.toLocaleString(undefined, this.props.formatNumberOptions)\n : value.toString();\n }\n\n private _onStreamHover(mouseEvent: React.MouseEvent<SVGElement>, singleLink: SLink, from: string) {\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 ...this._linkCalloutAttributes(singleLink, from),\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(element: React.FocusEvent<SVGElement>, singleLink: SLink, from: string): void {\n // There is a big difference in how \"Tab\" and the \"Arrow keys\" are handled in this diagram.\n // In particular, I would expect the \"Down\" key to be like \"Tab\", but it jumps a little wildly. I'm not sure\n // if this behavior is an accessiblity violation, but it we might want to investigate it.\n element.persist();\n this._onCloseCallout();\n this.setState({\n refSelected: element.currentTarget,\n ...this._linkCalloutAttributes(singleLink, from),\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 {\n const selectedNode = state.selectedNode;\n if (selectedNode && state.selectedNodes.has(singleNode.index!)) {\n return selectedNode.color;\n } else if (!selectedNode) {\n return singleNode.color;\n }\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!)) {\n const selectedNode = state.selectedNode;\n return selectedNode ? selectedNode.color : 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 {\n if (state.selectedLinks.has(singleLink.index!)) {\n const selectedNode = state.selectedNode;\n return selectedNode ? selectedNode.borderColor! : gradientUrl;\n }\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n }\n }\n\n private _fillNodeBorder = (singleNode: SNode): string => {\n const state = this.state;\n if (!state.selectedState) {\n return singleNode.borderColor!;\n } else {\n if (state.selectedNodes.has(singleNode.index!)) {\n const selectedNode = state.selectedNode;\n return selectedNode ? selectedNode.borderColor! : singleNode.borderColor!;\n }\n return singleNode.borderColor!;\n }\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.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 // NOTE: Calls to this method trigger a re-render.\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth =\n container &&\n (this.props.enableReflow\n ? Math.max(container.getBoundingClientRect().width, this._calculateChartMinWidth())\n : 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 // 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).style('color', this.props.theme!.palette.neutralPrimary);\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 private _calculateChartMinWidth = (): number => {\n return (\n this._margins.left! +\n this._margins.right! +\n // total width of all node columns\n this._numColumns * NODE_WIDTH +\n // minimum total width of all column gaps\n (this._numColumns - 1) * (NODE_WIDTH / 2)\n );\n };\n}\n"]}
1
+ {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.base.tsx"],"names":[],"mappings":";;;;IAkMA,gDAWC;IAqFD,sCAYC;IAwDD,0CAiBC;IAxVD,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8C,CAAC;IACvF,IAAM,kBAAkB,GAAG,GAAG,CAAC;IAsC/B,IAAM,kCAAkC,GAAW,SAAS,CAAC;IAC7D,IAAM,mBAAmB,GAAiB;QACxC,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE;QAChD,EA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AAC,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpG,CAAC;QA1xBa,4BAAY,GAA+B;YACvD,YAAY,EAAE,IAAI;SACnB,AAFyB,CAExB;QAoyBJ,sBAAC;KAAA,AAvyBD,CAAqC,KAAK,CAAC,SAAS,GAuyBnD;IAvyBY,0CAAe","sourcesContent":["import { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { IProcessedStyleSet, ITheme } from '@fluentui/react/lib/Styling';\nimport {\n IStyleFunctionOrObject,\n classNamesFunction,\n format,\n getId,\n getRTL,\n initializeComponentRef,\n memoizeFunction,\n} from '@fluentui/react/lib/Utilities';\nimport { sum as d3Sum } from 'd3-array';\nimport { SankeyGraph, SankeyLayout, sankey as d3Sankey, sankeyJustify, sankeyRight } from 'd3-sankey';\nimport { BaseType, Selection as D3Selection, select, selectAll } from 'd3-selection';\nimport { area as d3Area, curveBumpX as d3CurveBasis } from 'd3-shape';\nimport * as React from 'react';\nimport { IBasestate, IChart, IImageExportOptions, SLink, SNode } from '../../types/IDataPoint';\nimport { ChartHoverCard } from '../../utilities/ChartHoverCard/ChartHoverCard';\nimport { IChartHoverCardProps } from '../../utilities/ChartHoverCard/ChartHoverCard.types';\nimport { IMargins } from '../../utilities/utilities';\nimport {\n ISankeyChartAccessibilityProps,\n ISankeyChartData,\n ISankeyChartProps,\n ISankeyChartStrings,\n ISankeyChartStyleProps,\n ISankeyChartStyles,\n} from './SankeyChart.types';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\n\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\nconst PADDING_PERCENTAGE = 0.3;\n\ntype NodeId = number | string;\ntype ItemValues<T> = { [key: NodeId]: T };\ntype NodeValues = ItemValues<number>;\ntype LinkItemValues<T> = { [key: NodeId]: ItemValues<T> };\ntype LinkValues = LinkItemValues<number>;\n\ntype NodesInColumns = { [key: number]: SNode[] };\ntype NormalizedData = ISankeyChartData & {\n width: number;\n height: number;\n};\n\ntype NormalizeDiagramFunction = (\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n) => NormalizedData;\n\ntype NodeColors = { fillColor: string; borderColor: string };\ntype SankeyLayoutGenerator = SankeyLayout<SankeyGraph<{}, {}>, {}, {}>;\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';\nconst NODE_WIDTH = 124;\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\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): {\n selectedLinks: Set<SLink>;\n selectedNodes: Set<SNode>;\n} {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 */\n// This is exported for unit tests.\nexport function groupNodesByColumn(graph: ISankeyChartData): NodesInColumns {\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(\n nodesInColumn: NodesInColumns,\n computedNodes: NodeValues,\n originalLinks: LinkValues,\n): void {\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 const onePercent = 0.01 * columnValue;\n const columnNodes = nodesInColumn[index];\n columnNodes.forEach((node: SNode) => {\n const value = computedNodes[node.nodeId];\n const nodePercentage = (value / columnValue) * 100;\n node.actualValue = 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 = onePercent;\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 // Loop through each node in that column and scale that node--and its incoming and outgoing links--by the\n // scaling ratio. We need the sankey diagram to re-layout the nodes and links after we do this.\n columnNodes.forEach((node: SNode) => {\n const normalized = (node.value = node.value! / scalingRatio);\n // Which Original Value? and Which Normalized Value is needed, here? The Node? The Link? Both?\n changeColumnValue(node, computedNodes[node.nodeId], normalized, originalLinks);\n });\n }\n });\n}\n\n/**\n * This is used for normalizing each link's value to reflect the normalized node value.\n */\nfunction changeColumnValue(\n node: SNode,\n originalNodeValue: number,\n normalizedNodeValue: number,\n linkValues: LinkValues,\n) {\n // For each link in the source and target, compute the proportion that this link contributes to the total\n // then adjust the link's value to reflect its proportion of the normalized node value.\n const updateLinkValue = (link: SLink) => {\n const value = linkValue(linkValues, link);\n link.unnormalizedValue = value;\n const linkRatio = value / originalNodeValue;\n link.value = Math.max(normalizedNodeValue * linkRatio, link.value);\n };\n node.sourceLinks!.forEach(updateLinkValue);\n node.targetLinks!.forEach(updateLinkValue);\n}\n\n/**\n * This is used for calculating the node non normalized value based on link non normalized value.\n * The links have the original weights. Computed nodes have the total weight of all incoming and outgoing links.\n */\nfunction populateNodeActualValue(data: ISankeyChartData, computedNodes: NodeValues, originalLinks: LinkValues) {\n data.links.forEach((link: SLink) => {\n if (!link.unnormalizedValue) {\n link.unnormalizedValue = linkValue(originalLinks, link);\n }\n });\n data.nodes.forEach((node: SNode) => {\n node.actualValue = computedNodes[node.nodeId as NodeId];\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// This is exported for unit tests\nexport function adjustPadding(sankey: SankeyLayoutGenerator, height: number, nodesInColumn: NodesInColumns): void {\n let padding = sankey.nodePadding();\n const minPadding = PADDING_PERCENTAGE * height;\n Object.values(nodesInColumn).forEach((column: SNode[]) => {\n const totalPaddingInColumn = height - d3Sum(column, (node: SNode) => node.y1! - node.y0!);\n if (minPadding < totalPaddingInColumn) {\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 sankey.nodePadding(padding);\n}\n\nfunction idFromNumberOrSNode(node: SNode | number): NodeId {\n if (typeof node === 'number') {\n return node;\n }\n return node.nodeId as NodeId;\n}\n\n/**\n * Duplicates the supplied chart data so that we do not alter the original.\n * @param data The data to duplicate.\n * @returns The duplicated data.\n */\nfunction duplicateData(data: ISankeyChartData): ISankeyChartData {\n return {\n nodes: data.nodes.map(\n (node: SNode): SNode => ({\n ...node,\n }),\n ),\n links: data.links.map(\n (link: SLink): SLink => ({\n ...link,\n }),\n ),\n };\n}\n\nfunction valuesOfNodes(nodes: SNode[]): NodeValues {\n const result: NodeValues = {};\n nodes.forEach((node: SNode) => {\n result[node.nodeId as NodeId] = node.value!;\n });\n return result;\n}\n\nfunction valuesOfLinks(links: SLink[]): LinkValues {\n const result: LinkValues = {};\n links.forEach((link: SLink) => {\n const sourceId = idFromNumberOrSNode(link.source);\n let sourceToTarget = result[sourceId];\n if (!sourceToTarget) {\n sourceToTarget = {};\n result[sourceId] = sourceToTarget;\n }\n sourceToTarget[idFromNumberOrSNode(link.target)] = link.value;\n });\n return result;\n}\n\nfunction linkValue<T>(originalLinks: LinkItemValues<T>, link: SLink): T {\n return originalLinks[idFromNumberOrSNode(link.source)][idFromNumberOrSNode(link.target)];\n}\n\n// This is exported for unit tests.\nexport function preRenderLayout(\n margins: IMargins,\n containerWidth: number,\n containerHeight: number,\n isRtl: boolean,\n): { sankey: SankeyLayoutGenerator; height: number; width: number } {\n const { left, right, top, bottom } = margins;\n\n const sankey = d3Sankey()\n .nodeWidth(NODE_WIDTH)\n .extent([\n [left!, top!],\n [containerWidth - right!, containerHeight - bottom!],\n ])\n .nodeAlign(isRtl ? sankeyRight : sankeyJustify);\n\n return { sankey, height: containerHeight, width: containerWidth };\n}\n\nconst elipsis = '...';\n\n/**\n * This is used to assign node fillcolors and borderColor cyclically when the user doesnt\n * provide color to individual node.\n */\nfunction assignNodeColors(\n nodes: SNode[],\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n) {\n let colors: string[];\n let borders: string[];\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 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/**\n * Takes in the display name for the node and potentially returns a trimmed version of the name.\n * @param tspan the `tspan` element to use for text visual length measurement\n * @param text is the text which we will potentially 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 * @returns the name to show on the node which might be the truncated `text` if the `text` is too long\n */\nfunction truncateText(tspan: TSpanForTextMeasuring, text: string, rectangleWidth: number, padding: number) {\n // NOTE: This method is the most-expensive in terms of rerendering components.\n const textLengthForNodeName = rectangleWidth - padding; // This can likely be computed once and passed in.\n // The following `select` statement injects a `tempText` element into the DOM. This injection\n // (and subsequent removal) is causing a layout recalculation. This is a performance issue.\n // Note that this code will always inject a `tempText` element, but doesn't always remove it. This is a bug.\n if (fitsWithinNode(tspan, text, textLengthForNodeName)) {\n return text;\n }\n // Computing the size of elipsis is performed with each node. This should be computed once and used everywhere.\n // TODO: Compute the size of the elipsis once and use it everywhere.\n const elipsisLength = computeElipsisLength(tspan);\n let line: string = '';\n // Calculate how much of the original text to show.\n // TODO: The folllowing is O(n). We could use a binary search to make this faster: O(log(n)).\n for (let i = 0; i < text.length; i++) {\n line += text[i];\n tspan.text(line);\n const currentNode = tspan.node();\n if (currentNode !== null) {\n const w = currentNode!.getComputedTextLength();\n if (w >= textLengthForNodeName - elipsisLength) {\n line = line.slice(0, -1);\n line += elipsis;\n break;\n }\n }\n }\n tspan.text(null);\n return line;\n}\n\ntype RenderedNodeAttributes = {\n readonly reactId: string;\n readonly gElementId: string;\n readonly name: string;\n readonly aria: string;\n readonly trimmed: boolean;\n readonly height: number;\n readonly weightOffset: number;\n};\n\ntype RenderedLinkAttributes = {\n readonly reactId: string;\n readonly aria: string;\n readonly from: string;\n};\n\ntype TSpanForTextMeasuring = D3Selection<SVGTSpanElement, unknown, HTMLElement, unknown>;\n\nfunction fitsWithinNode(tspan: TSpanForTextMeasuring, text: string, textLengthForNodeName: number): boolean {\n const measurement = measureText(tspan, text);\n if (measurement === undefined) {\n return false;\n }\n return measurement <= textLengthForNodeName;\n}\n\nfunction measureText(tspan: TSpanForTextMeasuring, text: string | number): number | undefined {\n try {\n tspan.text(text);\n return tspan.node()?.getComputedTextLength();\n } finally {\n tspan.text(null);\n }\n}\n\nfunction computeElipsisLength(tspan: TSpanForTextMeasuring): number {\n const measurement = measureText(tspan, elipsis);\n return measurement === undefined ? 0 : measurement;\n}\n\nfunction computeLinkAttributes(\n links: SLink[],\n linkFrom: (node: SNode) => string,\n linkAriaLabel: (link: SLink) => string,\n): LinkItemValues<RenderedLinkAttributes> {\n const result: LinkItemValues<RenderedLinkAttributes> = {};\n links.forEach((link: SLink) => {\n const sourceId = idFromNumberOrSNode(link.source);\n let sourceToTarget = result[sourceId];\n if (!sourceToTarget) {\n sourceToTarget = {};\n result[sourceId] = sourceToTarget;\n }\n sourceToTarget[idFromNumberOrSNode(link.target)] = {\n reactId: getId('link'),\n from: linkFrom(link.source as SNode),\n aria: linkAriaLabel(link),\n };\n });\n\n return result;\n}\n\ntype ItemPositions = {\n readonly x0: number;\n readonly y0: number;\n readonly x1: number;\n readonly y1: number;\n};\n\ntype SankeyLinkWithPositions = ItemPositions & {\n readonly source: ItemPositions;\n readonly target: ItemPositions;\n readonly width: number;\n};\n\ntype AreaDataPoint = {\n readonly x: number;\n readonly y0: number;\n readonly y1: number;\n};\n\nconst linkToDataPoints = (d: SankeyLinkWithPositions): [AreaDataPoint, AreaDataPoint] => {\n const halfWidth = d.width * 0.5;\n const y0 = d.y0;\n const y1 = d.y1;\n return [\n { x: d.source.x1, y0: y0 + halfWidth, y1: y0 - halfWidth },\n { x: d.target.x0, y0: y1 + halfWidth, y1: y1 - halfWidth },\n ];\n};\n\nconst linkArea = d3Area<AreaDataPoint>()\n .x((p: AreaDataPoint) => p.x)\n .y0((p: AreaDataPoint) => p.y0)\n .y1((p: AreaDataPoint) => p.y1)\n .curve(d3CurveBasis);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TooltipDiv = D3Selection<BaseType, unknown, HTMLElement, any>;\n\nfunction nodeTextColor(state: Readonly<ISankeyChartState>, singleNode: SNode): string {\n return !(\n !state.selectedState ||\n (state.selectedNodes.has(singleNode.index!) && state.selectedNode) ||\n !state.selectedNode\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR;\n}\n\ntype StringRenderer = {\n linkFrom: (node: SNode) => string;\n};\n\ntype AccessibilityRenderer = {\n emptyAriaLabel: string;\n nodeAriaLabel: (node: SNode, weight: number) => string;\n linkAriaLabel: (link: SLink) => string;\n};\n\n// NOTE: To start employing React.useMemo properly, we need to convert this code from a React.Component\n// to a function component. This will require a significant refactor of the code in this file.\n// https://stackoverflow.com/questions/60223362/fast-way-to-convert-react-class-component-to-functional-component\n// I am concerned that doing so would break this contract, making it difficult for consuming code.\nexport class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> implements IChart {\n public static defaultProps: Partial<ISankeyChartProps> = {\n enableReflow: true,\n };\n\n public chartContainer: HTMLDivElement;\n private _reqID: number;\n private readonly _calloutId: string;\n private readonly _linkId: string;\n private readonly _chartId: string;\n private readonly _emptyChartId: string;\n private readonly _labelTooltipId: string;\n private readonly _margins: IMargins;\n private readonly _isRtl: boolean = getRTL();\n private _numColumns: number = 0;\n\n private readonly _computeClassNamesProps: (\n theme: ITheme,\n pathColor: string,\n className: string,\n containerWidth: number,\n containerHeight: number,\n enableReflow: boolean | undefined,\n ) => ISankeyChartStyleProps;\n private readonly _computeClassNames: (\n styles: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>,\n classNamesProps: ISankeyChartStyleProps,\n ) => IProcessedStyleSet<ISankeyChartStyles>;\n private readonly _normalizeData: NormalizeDiagramFunction;\n private readonly _fetchTooltip: (classNames: IProcessedStyleSet<ISankeyChartStyles>) => TooltipDiv;\n private readonly _nodeAttributes: (\n nodes: SNode[],\n nodeAriaLabel: (node: SNode, weight: number) => string,\n ) => ItemValues<RenderedNodeAttributes>;\n private readonly _linkAttributes: (\n links: SLink[],\n linkFrom: (node: SNode) => string,\n linkAriaLabel: (link: SLink) => string,\n ) => LinkItemValues<RenderedLinkAttributes>;\n private readonly _fetchNodes: (\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n nodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ) => React.ReactNode[] | undefined;\n private readonly _fetchLinks: (\n links: SLink[],\n linkAttributes: LinkItemValues<RenderedLinkAttributes>,\n ) => React.ReactNode[] | undefined;\n\n private readonly _strings: StringRenderer;\n private readonly _accessibility: AccessibilityRenderer;\n\n constructor(props: ISankeyChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\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._chartId = getId('sankeyChart');\n this._emptyChartId = getId('_SankeyChart_empty');\n this._labelTooltipId = getId('tooltip');\n this._margins = { top: 36, right: 48, bottom: 32, left: 48 };\n // We memo-ize creation so that we only create a new object when any of the fields change.\n this._computeClassNamesProps = memoizeFunction(\n (\n theme: ITheme,\n pathColor: string,\n className: string,\n containerWidth: number,\n containerHeight: number,\n enableReflow: boolean | undefined,\n ): ISankeyChartStyleProps => ({\n theme: theme!,\n width: containerWidth,\n height: containerHeight,\n pathColor,\n className,\n enableReflow,\n }),\n );\n // `getClassNames` is memoized underneath, so it only recomputes when the `styles` or `classNamesProps` change.\n // We memoize `classNamesProps` so that we only create new class names when absolutely necessary,\n // and so that we can memoize the `_createNodes` method.\n this._computeClassNames = memoizeFunction(\n (\n styles: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>,\n classNamesProps: ISankeyChartStyleProps,\n ) => getClassNames(styles, classNamesProps),\n );\n this._normalizeData = memoizeFunction(\n (\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n ) => this._normalizeSankeyData(data, containerWidth, containerHeight, colorsForNodes, borderColorsForNodes),\n );\n this._fetchTooltip = memoizeFunction((classNames: IProcessedStyleSet<ISankeyChartStyles>) =>\n this._labelTooltipDiv(classNames),\n );\n // Prepare the localization utilities\n this._strings = memoizeFunction((strings?: ISankeyChartStrings): StringRenderer => {\n const fromString = strings?.linkFrom || 'From {0}';\n // NOTE: The `node` parameter is the sankey-generated node on the link, and not the original `node` supplied\n // by the caller.\n return {\n linkFrom: (node: SNode) => format(fromString, node.name),\n };\n })(props.strings);\n this._accessibility = memoizeFunction((accessibility?: ISankeyChartAccessibilityProps): AccessibilityRenderer => {\n const linkString = accessibility?.linkAriaLabel || 'link from {0} to {1} with weight {2}';\n const nodeString = accessibility?.nodeAriaLabel || 'node {0} with weight {1}';\n return {\n emptyAriaLabel: accessibility?.emptyAriaLabel || 'Graph has no data to display',\n linkAriaLabel: (link: SLink) =>\n format(\n linkString,\n (link.source as SNode).name,\n (link.target as SNode).name,\n link.unnormalizedValue ? this._formatNumber(link.unnormalizedValue) : link.unnormalizedValue,\n ),\n nodeAriaLabel: (node: SNode, weight: number) => format(nodeString, node.name, this._formatNumber(weight)),\n };\n })(props.accessibility);\n // NOTE: Memoizing the `_createNodes` and `_createLinks` methods would break the hoverability of the chart\n // because the nodes are currently created differently based on the layout information. Hence why we do not\n // memoize these methods (but have stubs for memoizing as the `_fetchNodes` and `_fetchLinks` methods).\n this._nodeAttributes = memoizeFunction((nodes: SNode[], nodeAriaLabel: (node: SNode, weight: number) => string) =>\n this._computeNodeAttributes(nodes, nodeAriaLabel),\n );\n this._fetchNodes = (\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n nodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ) => this._createNodes(classNames, nodes, nodeAttributes, tooltipDiv);\n this._linkAttributes = memoizeFunction(\n (links: SLink[], linkFrom: (node: SNode) => string, linkAriaLabel: (link: SLink) => string) =>\n computeLinkAttributes(links, linkFrom, linkAriaLabel),\n );\n this._fetchLinks = (links: SLink[], linkAttributes: LinkItemValues<RenderedLinkAttributes>) =>\n this._createLinks(links, linkAttributes);\n // Our shorter path to performance is to pre-compute the truncated labels of each node because\n // that should not change based on the position of the mouse. This is a shorter path becase the code which\n // computes the truncated labels creates and destroys a `tempText` element in the DOM. This is causing a\n // reflow and repaint of the entire chart. This is a performance issue, and so computing the truncated labels\n // once will help to mitigate this issue.\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, colorsForNodes, borderColorsForNodes } = this.props;\n const state = this.state;\n const classNamesProps = this._computeClassNamesProps(\n theme!,\n pathColor!,\n className!,\n state.containerWidth,\n state.containerHeight,\n this.props.enableReflow,\n );\n const classNames: IProcessedStyleSet<ISankeyChartStyles> = this._computeClassNames(styles!, classNamesProps);\n\n // Compute the position of each node and link\n const { nodes, links, width, height } = this._normalizeData(\n this.props.data.SankeyChartData!,\n state.containerWidth,\n state.containerHeight,\n colorsForNodes,\n borderColorsForNodes,\n );\n\n // In FocusZone, the focus order is determined by the rendering order of the elements. We need to find\n // a rendering order such that the focus moves through the nodes and links in a logical sequence.\n // Rendering the nodes and links layer by layer in a vertical order seems to be the most effective solution\n // with FocusZone. Although this focus order may not be entirely logical, it ensures that the focus moves\n // sequentially and prevents links (especially skip layer links) from being rendered over the nodes.\n const nodeLinkDomOrderArray: { layer: number; type: string; index: number }[] = [];\n nodes.sort((a: SNode, b: SNode) => {\n if (a.x0 !== b.x0) {\n return a.x0! - b.x0!;\n }\n return a.y0! - b.y0!;\n });\n nodes.forEach((item: SNode, index) => {\n nodeLinkDomOrderArray.push({ layer: item.layer!, type: 'node', index });\n });\n links.sort((a: SLink, b: SLink) => {\n const asx0 = (a.source as SNode).x0;\n const bsx0 = (b.source as SNode).x0;\n if (asx0 !== bsx0) {\n return asx0! - bsx0!;\n }\n return a.y0! - b.y0!;\n });\n links.forEach((item: SLink, index) => {\n nodeLinkDomOrderArray.push({ layer: (item.source as SNode).layer!, type: 'link', index });\n });\n nodeLinkDomOrderArray.sort((a, b) => {\n if (a.layer !== b.layer) {\n return a.layer - b.layer;\n }\n\n if (a.type > b.type) {\n return -1;\n }\n if (a.type < b.type) {\n return 1;\n }\n return 0;\n });\n\n // NOTE: I don't love this approach to caching the \"select\" result. Is it still valid from render-to-render?\n // although local testing seems to indicate so, I do not trust that React will always support that instance.\n // It might be better to perform this `fetch` within the `_showTooltip` and `_hideTooltip` methods.\n const tooltipDiv = this._fetchTooltip(classNames);\n // Pre-compute some important attributes about nodes, specifically text\n const nodeAttributes = this._nodeAttributes(nodes, this._accessibility.nodeAriaLabel);\n // Build the nodes and links as rendered in the UX.\n const nodeData = this._fetchNodes(classNames, nodes, nodeAttributes, tooltipDiv);\n const linkAttributes = this._linkAttributes(links, this._strings.linkFrom, this._accessibility.linkAriaLabel);\n const linkData = this._fetchLinks(links, linkAttributes);\n\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 ...this.props.calloutProps!,\n };\n return (\n <div\n className={classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => {\n this.chartContainer = rootElem;\n }}\n onMouseLeave={this._onCloseCallout}\n >\n {/*\n - Horizontal navigation has been disabled because the nodes and links are rendered vertically,\n causing the left/right arrow keys to move focus up or down to the previous or next sibling element.\n - Bidirectional navigation has been disabled because it causes the up/down arrow keys to move the focus\n in a non-sequential and erratic manner within a 2D grid.\n */}\n <FocusZone direction={FocusZoneDirection.vertical} className={classNames.chartWrapper}>\n <svg width={width} height={height} id={this._chartId} className={classNames.chart}>\n {nodeLinkDomOrderArray.map(item => {\n if (item.type === 'node') {\n return (\n <g key={nodes[item.index].nodeId} className={classNames.nodes}>\n {nodeData![item.index]}\n </g>\n );\n } else {\n return (\n <g\n key={`${(links[item.index].source as SNode).nodeId}-${\n (links[item.index].target as SNode).nodeId\n }`}\n className={classNames.links}\n strokeOpacity={1}\n >\n {linkData![item.index]}\n </g>\n );\n }\n })}\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={this._accessibility.emptyAriaLabel}\n />\n );\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return exportChartsAsImage([{ container: this.chartContainer }], undefined, this._isRtl, opts);\n };\n\n private _computeNodeAttributes(\n nodes: SNode[],\n nodeAriaLabel: (node: SNode, weight: number) => string,\n ): ItemValues<RenderedNodeAttributes> {\n const result: ItemValues<RenderedNodeAttributes> = {};\n const weightSpan = select('.nodeName').append('text').attr('class', 'tempText').append('tspan').text(null);\n const nameSpan = select('.nodeName')\n .append('text')\n .attr('class', 'tempText')\n .attr('font-size', '10')\n .append('tspan')\n .text(null);\n nodes.forEach((singleNode: SNode) => {\n const height = Math.max(singleNode.y1! - singleNode.y0!, 0);\n let padding = 8;\n let textLengthForNodeWeight = 0;\n\n const nodeValue = singleNode.actualValue!;\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 // The following `select` statement injects a `tempText` element into the DOM. This injection\n // (and subsequent removal) is causing a layout recalculation. This is a performance issue.\n const measurement = measureText(weightSpan, this._formatNumber(nodeValue));\n if (measurement !== undefined) {\n textLengthForNodeWeight = measurement;\n padding = padding + textLengthForNodeWeight;\n }\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 = truncateText(nameSpan, singleNode.name, NODE_WIDTH - 8, padding);\n const isTruncated: boolean = truncatedname.slice(-3) === elipsis;\n result[singleNode.nodeId] = {\n reactId: getId('nodeBar'),\n gElementId: getId('nodeGElement'),\n name: truncatedname,\n aria: nodeAriaLabel(singleNode, nodeValue),\n trimmed: isTruncated,\n height,\n weightOffset: textLengthForNodeWeight,\n };\n });\n selectAll('.tempText').remove();\n return result;\n }\n\n private _linkCalloutAttributes(\n singleLink: SLink,\n from: string,\n ): IChartHoverCardProps & {\n selectedLink: SLink;\n isCalloutVisible: boolean;\n color: string;\n xCalloutValue: string;\n yCalloutValue: string;\n descriptionMessage: string;\n } {\n return {\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color!,\n xCalloutValue: (singleLink.target as SNode).name,\n yCalloutValue: this._formatNumber(singleLink.unnormalizedValue!),\n descriptionMessage: from,\n };\n }\n\n private _normalizeSankeyData(\n data: ISankeyChartData,\n containerWidth: number,\n containerHeight: number,\n colorsForNodes: string[] | undefined,\n borderColorsForNodes: string[] | undefined,\n ): NormalizedData {\n const { sankey, height, width } = preRenderLayout(this._margins, containerWidth, containerHeight, this._isRtl);\n // Clone the data before mutating it (via the SankeyLayoutGenerator) so that we don't mutate the original data.\n const transformed: ISankeyChartData = duplicateData(data);\n sankey(transformed);\n // NOTE: After the prior line, `transformed` is now a more-complex object than the incoming `ISankeyChartData`.\n // `transformed` should be cast to a more-specific type. This is a breaking change because we would be eliminating\n // fields from `ISankeyChartData` and putting those fields on a now-local type. But doing so makes it clearer what\n // the caller needs to supply and why. For example, the `actualValue` and `layer` fields of `ISNodeExtra` should\n // both be moved. Similarly for `unnormalizedValue` in `ISLinkExtra`.\n // `SankeyNodeMinimal` and `SankeyLinkMinimal` are both the types after `sankey(transformed)`, but have almost no\n // bearing on the data before `sankey(transformed)` (which is basically nodes with ids and names along with links\n // with source index, target index, and value).\n const nodesInColumn = groupNodesByColumn(transformed);\n this._numColumns = Object.keys(nodesInColumn).length;\n // Keep track of the original values of the links and their acccumulated values in the nodes\n // Setting these in external objects so they cannot be mutated by other code.\n // The IDs of nodes can be numbers or strings. But, the IDs of links are always the index into the \"nodes\" array.\n // After the sankey layout is computed, the each link's `source` and `target` will have the ID of the node in the\n // type originally specified in the Nodes array. Consequently, we get the values of those links after the sankey\n // transformation.\n const nodeValues = valuesOfNodes(transformed.nodes);\n const linkValues = valuesOfLinks(transformed.links);\n adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);\n adjustPadding(sankey, containerHeight - this._margins.top! - this._margins.bottom!, nodesInColumn);\n // `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.\n // NOTE: The second call to `sankey` is required to allow links to be hoverable.\n // Without the second call, the links are not hoverable.\n sankey(transformed);\n populateNodeActualValue(transformed, nodeValues, linkValues);\n assignNodeColors(transformed.nodes, colorsForNodes, borderColorsForNodes);\n return {\n width,\n height,\n nodes: transformed.nodes,\n links: transformed.links,\n };\n }\n\n private _labelTooltipDiv(classNames: IProcessedStyleSet<ISankeyChartStyles>): TooltipDiv {\n // find the tooltip div. If it doesn't exist, then create it.\n let tooltipDiv = select(`#${this._labelTooltipId}`);\n if (tooltipDiv.empty()) {\n tooltipDiv = select('body')\n .append('div')\n .attr('id', this._labelTooltipId)\n .attr('class', classNames.toolTip!)\n .style('opacity', 0);\n }\n // If the div exists, then `classNames` has changed; update the `class` on the `div`.\n tooltipDiv.attr('class', classNames.toolTip!);\n return tooltipDiv;\n }\n\n private _createLinks(\n dataLinks: SLink[],\n linkAttributes: LinkItemValues<RenderedLinkAttributes>,\n ): React.ReactNode[] | undefined {\n if (dataLinks) {\n const linkId = this._linkId;\n return dataLinks.map((singleLink: SLink, index: number): React.ReactNode => {\n const onMouseOut = () => {\n this._onStreamLeave(singleLink);\n };\n const { reactId, from, aria } = linkValue(linkAttributes, singleLink);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataPoints: Array<any> = linkToDataPoints(singleLink as unknown as SankeyLinkWithPositions);\n const key = `${linkId}-${index}`;\n const gradientId = `gradient-${key}`;\n const gradientUrl = `url(#${gradientId})`;\n const source = singleLink.source as SNode;\n const target = singleLink.target as SNode;\n // TODO: localize the aria-label string\n return (\n <g key={key}>\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0\" stopColor={source.color} />\n <stop offset=\"100%\" stopColor={target.color} />\n </linearGradient>\n </defs>\n <path\n d={linkArea(dataPoints)!}\n id={reactId}\n fill={this._fillStreamColors(singleLink, gradientUrl)}\n stroke={this._fillStreamBorder(singleLink, gradientUrl)}\n strokeWidth=\"2\"\n strokeOpacity={this._getOpacityStreamBorder(singleLink)}\n onMouseOver={event => this._onStreamHover(event, singleLink, from)}\n onMouseOut={onMouseOut}\n onFocus={event => this._onFocusLink(event, singleLink, from)}\n onBlur={this._onBlur}\n fillOpacity={this._getOpacityStream(singleLink)}\n data-is-focusable={true}\n aria-label={aria}\n role=\"img\"\n />\n </g>\n );\n });\n }\n return [];\n }\n\n private _createNodes(\n classNames: IProcessedStyleSet<ISankeyChartStyles>,\n dataNodes: SNode[],\n nodeAttributes: ItemValues<RenderedNodeAttributes>,\n tooltipDiv: TooltipDiv,\n ): React.ReactNode[] | undefined {\n if (dataNodes) {\n const state = this.state;\n const textAnchor = this._isRtl ? 'end' : 'start';\n return dataNodes.map((singleNode: SNode, index: number): React.ReactNode => {\n const onMouseOut = () => {\n this._onLeave(singleNode);\n };\n const {\n reactId: nodeId,\n gElementId,\n height,\n trimmed: isTruncated,\n name: truncatedName,\n weightOffset: textLengthForNodeWeight,\n aria,\n } = nodeAttributes[singleNode.nodeId];\n const tooTall = height > MIN_HEIGHT_FOR_DOUBLINE_TYPE;\n const { name, actualValue, x0, x1, y0 } = singleNode;\n const textColor = nodeTextColor(state, singleNode);\n return (\n <g key={index} id={gElementId}>\n <rect\n x={x0}\n y={y0}\n height={height}\n width={x1! - 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={aria}\n role=\"img\"\n />\n {height > MIN_HEIGHT_FOR_TYPE && (\n <g className={classNames.nodeTextContainer}>\n <g className=\"nodeName\">\n <text\n id={`${nodeId}-name`}\n x={x0}\n y={y0}\n dy={'1.2em'}\n dx={'0.4em'}\n textAnchor={textAnchor}\n fontWeight=\"regular\"\n aria-hidden=\"true\"\n fill={textColor}\n fontSize={10}\n onMouseOver={this._showTooltip.bind(this, name, isTruncated, tooltipDiv)}\n onMouseOut={this._hideTooltip.bind(this, tooltipDiv)}\n >\n {truncatedName}\n </text>\n </g>\n\n <text\n x={tooTall ? x0 : x1! - textLengthForNodeWeight - 8}\n y={y0}\n dy={tooTall ? '2em' : '1em'}\n dx={tooTall ? '0.4em' : '0em'}\n textAnchor={textAnchor}\n fontWeight=\"bold\"\n aria-hidden=\"true\"\n fill={textColor}\n fontSize={14}\n >\n {actualValue ? this._formatNumber(actualValue) : actualValue}\n </text>\n </g>\n )}\n </g>\n );\n });\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 yCalloutValue: this._formatNumber(singleNode.actualValue!),\n });\n }\n }\n\n private _formatNumber(value: number): string {\n return this.props.formatNumberOptions\n ? value.toLocaleString(undefined, this.props.formatNumberOptions)\n : value.toString();\n }\n\n private _onStreamHover(mouseEvent: React.MouseEvent<SVGElement>, singleLink: SLink, from: string) {\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 ...this._linkCalloutAttributes(singleLink, from),\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(element: React.FocusEvent<SVGElement>, singleLink: SLink, from: string): void {\n // There is a big difference in how \"Tab\" and the \"Arrow keys\" are handled in this diagram.\n // In particular, I would expect the \"Down\" key to be like \"Tab\", but it jumps a little wildly. I'm not sure\n // if this behavior is an accessiblity violation, but it we might want to investigate it.\n element.persist();\n this._onCloseCallout();\n this.setState({\n refSelected: element.currentTarget,\n ...this._linkCalloutAttributes(singleLink, from),\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 {\n const selectedNode = state.selectedNode;\n if (selectedNode && state.selectedNodes.has(singleNode.index!)) {\n return selectedNode.color;\n } else if (!selectedNode) {\n return singleNode.color;\n }\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!)) {\n const selectedNode = state.selectedNode;\n return singleLink ? singleLink.color : selectedNode ? selectedNode.color : 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 {\n if (state.selectedLinks.has(singleLink.index!)) {\n const selectedNode = state.selectedNode;\n return selectedNode ? selectedNode.borderColor! : gradientUrl;\n }\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n }\n }\n\n private _fillNodeBorder = (singleNode: SNode): string => {\n const state = this.state;\n if (!state.selectedState) {\n return singleNode.borderColor!;\n } else {\n if (state.selectedNodes.has(singleNode.index!)) {\n const selectedNode = state.selectedNode;\n return selectedNode ? selectedNode.borderColor! : singleNode.borderColor!;\n }\n return singleNode.borderColor!;\n }\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.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 // NOTE: Calls to this method trigger a re-render.\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth =\n container &&\n (this.props.enableReflow\n ? Math.max(container.getBoundingClientRect().width, this._calculateChartMinWidth())\n : 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 // 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).style('color', this.props.theme!.palette.neutralPrimary);\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 private _calculateChartMinWidth = (): number => {\n return (\n this._margins.left! +\n this._margins.right! +\n // total width of all node columns\n this._numColumns * NODE_WIDTH +\n // minimum total width of all column gaps\n (this._numColumns - 1) * (NODE_WIDTH / 2)\n );\n };\n}\n"]}
@@ -39,9 +39,10 @@ define(["require", "exports", "tslib", "react", "d3-selection", "../Legends/inde
39
39
  var _g = React.useState(false), isSelectedLegend = _g[0], setIsSelectedLegend = _g[1];
40
40
  var _h = React.useState(''), activePoint = _h[0], setActivePoint = _h[1];
41
41
  var _j = React.useState(), stackCalloutProps = _j[0], setStackCalloutProps = _j[1];
42
- var _k = React.useState(false), isCalloutVisible = _k[0], setCalloutVisible = _k[1];
43
- var _l = React.useState(((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends) || []), selectedLegends = _l[0], setSelectedLegends = _l[1];
44
- var _m = React.useState(''), refSelected = _m[0], setRefSelected = _m[1];
42
+ var _k = React.useState(), dataPointCalloutProps = _k[0], setDataPointCalloutProps = _k[1];
43
+ var _l = React.useState(false), isCalloutVisible = _l[0], setCalloutVisible = _l[1];
44
+ var _m = React.useState(((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends) || []), selectedLegends = _m[0], setSelectedLegends = _m[1];
45
+ var _o = React.useState(''), refSelected = _o[0], setRefSelected = _o[1];
45
46
  var prevSelectedLegendsRef = React.useRef(undefined);
46
47
  var _isScatterPolarRef = React.useRef(false);
47
48
  var _isTextMode = React.useRef(false);
@@ -252,6 +253,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "../Legends/inde
252
253
  setRefSelected("#".concat(circleId));
253
254
  setYValueHover(found.values);
254
255
  setStackCalloutProps(found);
256
+ setDataPointCalloutProps(found);
255
257
  setActivePoint(circleId);
256
258
  }
257
259
  }
@@ -465,6 +467,13 @@ define(["require", "exports", "tslib", "react", "d3-selection", "../Legends/inde
465
467
  function _closeCallout() {
466
468
  setCalloutVisible(false);
467
469
  }
470
+ function _getCustomizedCallout() {
471
+ return props.onRenderCalloutPerStack
472
+ ? props.onRenderCalloutPerStack(stackCalloutProps)
473
+ : props.onRenderCalloutPerDataPoint
474
+ ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps)
475
+ : null;
476
+ }
468
477
  var _getNumericMinMaxOfY = React.useCallback(function (points, yAxisType) {
469
478
  var _a = (0, index_2.findNumericMinMaxOfY)(points, yAxisType, undefined, props.yScaleType), startValue = _a.startValue, endValue = _a.endValue;
470
479
  var yPadding = (0, index_2.getDomainPaddingForMarkers)(startValue, endValue, props.yScaleType);
@@ -500,7 +509,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "../Legends/inde
500
509
  _xAxisLabels = Array.from(new Set(xAxisLabels));
501
510
  // Compute unique y axis labels for string y axis
502
511
  var _yAxisLabels = _getOrderedYAxisLabels();
503
- return !_isChartEmpty() ? (React.createElement(index_3.CartesianChart, tslib_1.__assign({}, props, { ref: cartesianChartRef, chartTitle: props.data.chartTitle, isCalloutForStack: true, points: points, chartType: index_4.ChartTypes.ScatterChart, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, getmargins: _getMargins, getMinMaxOfYAxis: _getNumericMinMaxOfY, getDomainNRangeValues: getDomainNRangeValuesScatterChart, createYAxis: index_2.createNumericYAxis, createStringYAxis: index_2.createStringYAxis, getGraphData: _initializeScatterChartData, xAxisType: _xAxisType, yAxisType: _yAxisType }, (_yAxisType === index_2.YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {}), { onChartMouseLeave: _handleChartMouseLeave, enableFirstRenderOptimization: _firstRenderOptimization, datasetForXAxisDomain: _xAxisLabels, componentRef: cartesianChartRef }, (_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {}), {
512
+ return !_isChartEmpty() ? (React.createElement(index_3.CartesianChart, tslib_1.__assign({}, props, { ref: cartesianChartRef, chartTitle: props.data.chartTitle, isCalloutForStack: true, points: points, chartType: index_4.ChartTypes.ScatterChart, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, getmargins: _getMargins, getMinMaxOfYAxis: _getNumericMinMaxOfY, getDomainNRangeValues: getDomainNRangeValuesScatterChart, createYAxis: index_2.createNumericYAxis, createStringYAxis: index_2.createStringYAxis, getGraphData: _initializeScatterChartData, xAxisType: _xAxisType, yAxisType: _yAxisType }, (_yAxisType === index_2.YAxisType.StringAxis ? { stringDatasetForYAxisDomain: _yAxisLabels } : {}), { onChartMouseLeave: _handleChartMouseLeave, enableFirstRenderOptimization: _firstRenderOptimization, datasetForXAxisDomain: _xAxisLabels, componentRef: cartesianChartRef }, (_isScatterPolarRef.current ? { yMaxValue: 1, yMinValue: -1 } : {}), { customizedCallout: _getCustomizedCallout(),
504
513
  /* eslint-disable react/jsx-no-bind */
505
514
  children: function (childProps) {
506
515
  _xAxisScale.current = childProps.xScale;