@fluentui/react-charting 5.14.43 → 5.15.1

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 (39) hide show
  1. package/CHANGELOG.json +37 -1
  2. package/CHANGELOG.md +21 -2
  3. package/dist/react-charting.js +1 -1
  4. package/dist/react-charting.min.js +1 -1
  5. package/lib/components/SankeyChart/SankeyChart.base.d.ts +79 -2
  6. package/lib/components/SankeyChart/SankeyChart.base.js +599 -32
  7. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  8. package/lib/components/SankeyChart/SankeyChart.styles.js +39 -2
  9. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  10. package/lib/components/SankeyChart/SankeyChart.types.d.ts +20 -0
  11. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  12. package/lib/types/IDataPoint.d.ts +5 -1
  13. package/lib/types/IDataPoint.js.map +1 -1
  14. package/lib/version.js +1 -1
  15. package/lib/version.js.map +1 -1
  16. package/lib-amd/components/SankeyChart/SankeyChart.base.d.ts +79 -2
  17. package/lib-amd/components/SankeyChart/SankeyChart.base.js +592 -31
  18. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  19. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +38 -3
  20. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  21. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +20 -0
  22. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  23. package/lib-amd/types/IDataPoint.d.ts +5 -1
  24. package/lib-amd/types/IDataPoint.js.map +1 -1
  25. package/lib-amd/version.js +1 -1
  26. package/lib-amd/version.js.map +1 -1
  27. package/lib-commonjs/components/SankeyChart/SankeyChart.base.d.ts +79 -2
  28. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +597 -30
  29. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  30. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +39 -2
  31. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  32. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +20 -0
  33. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  34. package/lib-commonjs/types/IDataPoint.d.ts +5 -1
  35. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  36. package/lib-commonjs/version.js +1 -1
  37. package/lib-commonjs/version.js.map +1 -1
  38. package/package.json +5 -5
  39. package/src/components/SankeyChart/SankeyChart.types.ts +26 -0
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAG1E,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,IAAM,aAAa,GAAG,kBAAkB,EAA8C,CAAC;AAEvF;IAAqC,mCAMpC;IAIC,yBAAY,KAAwB;QAApC,YACE,kBAAM,KAAK,CAAC,SAKb;QAJC,KAAI,CAAC,KAAK,GAAG;YACX,eAAe,EAAE,CAAC;YAClB,cAAc,EAAE,CAAC;SAClB,CAAC;;IACJ,CAAC;IACM,2CAAiB,GAAxB;QACE,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAEM,4CAAkB,GAAzB,UAA0B,SAA4B;QACpD,IAAI,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;YACtD,IAAI,CAAC,mBAAmB,EAAE,CAAC;SAC5B;IACH,CAAC;IACM,8CAAoB,GAA3B;QACE,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IACM,gCAAM,GAAb;QAAA,iBA0CC;QAzCO,IAAA,KAA0C,IAAI,CAAC,KAAK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C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAEtD,UAAU,CAAC,IAAI,CACX;oBACP;wBACE,kCAAO,UAAU,CAAC,IAAI,GAAG,IAAI,GAAG,UAAU,CAAC,KAAK,CAAQ,CAClD,CACN,CACL,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;YACH,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IACO,6CAAmB,GAA3B;QAAA,iBAcC;QAbO,IAAA,KAAsC,IAAI,CAAC,KAAK,EAA9C,cAAc,oBAAA,EAAE,eAAe,qBAAe,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC;YAClC,IAAM,SAAS,GAAG,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAI,CAAC,cAAc,CAAC;YACpF,IAAM,qBAAqB,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;YACtE,IAAM,sBAAsB,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;YACxE,IAAM,YAAY,GAAG,cAAc,KAAK,qBAAqB,IAAI,eAAe,KAAK,sBAAsB,CAAC;YAC5G,IAAI,YAAY,EAAE;gBAChB,KAAI,CAAC,QAAQ,CAAC;oBACZ,cAAc,EAAE,qBAAqB;oBACrC,eAAe,EAAE,sBAAsB;iBACxC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,sBAAC;AAAD,CAAC,AAnJD,CAAqC,KAAK,CAAC,SAAS,GAmJnD","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId } from '@fluentui/react/lib/Utilities';\nimport { ISankeyChartProps, ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as d3Sankey from 'd3-sankey';\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\n\nexport class SankeyChartBase extends React.Component<\n ISankeyChartProps,\n {\n containerWidth: number;\n containerHeight: number;\n }\n> {\n private _classNames: IProcessedStyleSet<ISankeyChartStyles>;\n private chartContainer: HTMLDivElement;\n private _reqID: number;\n constructor(props: ISankeyChartProps) {\n super(props);\n this.state = {\n containerHeight: 0,\n containerWidth: 0,\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 public componentWillUnmount(): void {\n cancelAnimationFrame(this._reqID);\n }\n public render(): React.ReactNode {\n const { theme, className, styles, pathColor } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: this.state.containerWidth,\n height: this.state.containerHeight,\n pathColor: pathColor,\n className,\n });\n const margin = { top: 10, right: 0, bottom: 10, left: 0 };\n const width = this.state.containerWidth - margin.left - margin.right;\n const height =\n this.state.containerHeight - margin.top - margin.bottom > 0\n ? this.state.containerHeight - margin.top - margin.bottom\n : 0;\n\n const sankey = d3Sankey\n .sankey()\n .nodeWidth(5)\n .nodePadding(6)\n .extent([\n [1, 1],\n [width - 1, height - 6],\n ]);\n\n sankey(this.props.data.SankeyChartData!);\n const nodeData = this._createNodes(width);\n const linkData = this._createLinks();\n return (\n <div\n className={this._classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (this.chartContainer = rootElem)}\n >\n <svg width={width} height={height} id={getId('sankeyChart')}>\n <g className={this._classNames.nodes}>{nodeData}</g>\n <g className={this._classNames.links} strokeOpacity={0.2}>\n {linkData}\n </g>\n </svg>\n </div>\n );\n }\n\n private _createLinks(): React.ReactNode[] | undefined {\n const links: React.ReactNode[] = [];\n if (this.props.data.SankeyChartData) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.props.data.SankeyChartData.links.forEach((singleLink: any, index: number) => {\n const path = d3Sankey.sankeyLinkHorizontal();\n const pathValue = path(singleLink);\n const link = (\n <path\n key={index}\n d={pathValue ? pathValue : undefined}\n strokeWidth={Math.max(1, singleLink.width)}\n id={getId('link')}\n >\n <title>\n <text>{singleLink.source.name + ' → ' + singleLink.target.name + '\\n' + singleLink.value}</text>\n </title>\n </path>\n );\n links.push(link);\n });\n }\n return links;\n }\n\n private _createNodes(width: number): React.ReactNode[] | undefined {\n const nodes: React.ReactNode[] = [];\n if (this.props.data.SankeyChartData) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.props.data.SankeyChartData.nodes.forEach((singleNode: any, index: number) => {\n const height = singleNode.y1 - singleNode.y0 > 0 ? singleNode.y1 - singleNode.y0 : 0;\n const node = (\n <g id={getId('nodeGElement')} key={index}>\n <rect\n x={singleNode.x0}\n y={singleNode.y0}\n height={height}\n width={singleNode.x1 - singleNode.x0}\n fill={singleNode.color}\n id={getId('nodeBar')}\n />\n <text\n x={singleNode.x0 < width / 2 ? singleNode.x1 + 6 : singleNode.x0 - 6}\n y={(singleNode.y1 + singleNode.y0) / 2}\n dy={'0.35em'}\n textAnchor={singleNode.x0 < width / 2 ? 'start' : 'end'}\n >\n {singleNode.name}\n </text>\n <title>\n <text>{singleNode.name + '\\n' + singleNode.value}</text>\n </title>\n </g>\n );\n nodes.push(node);\n });\n return nodes;\n }\n }\n private _fitParentContainer(): void {\n const { containerWidth, containerHeight } = this.state;\n this._reqID = requestAnimationFrame(() => {\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight = 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"]}
1
+ {"version":3,"file":"SankeyChart.base.js","sourceRoot":"../src/","sources":["components/SankeyChart/Sankey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AAG,IAAI,CAAC,CAAC;SACxC;IACH,CAAC;IAED,8DAA8D;IACtD,sCAAY,GAApB,UAAqB,GAAQ;QAC3B,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACH,sBAAC;AAAD,CAAC,AApxBD,CAAqC,KAAK,CAAC,SAAS,GAoxBnD","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, memoizeFunction } from '@fluentui/react/lib/Utilities';\nimport { ISankeyChartData, ISankeyChartProps, ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport * as d3Sankey from 'd3-sankey';\nimport { area as d3Area, curveBumpX as d3CurveBasis } from 'd3-shape';\nimport { sum as d3Sum } from 'd3-array';\nimport { ChartHoverCard, IBasestate, IChartHoverCardProps, SLink, SNode } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { select, selectAll } from 'd3-selection';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IMargins } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ISankeyChartStyleProps, ISankeyChartStyles>();\nconst PADDING_PERCENTAGE = 0.3;\n\ntype NodesInColumns = { [key: number]: SNode[] };\ntype NodeColors = { fillColor: string; borderColor: string };\n\nexport interface ISankeyChartState extends IBasestate, IChartHoverCardProps {\n containerWidth: number;\n containerHeight: number;\n selectedState: boolean;\n selectedLinks: Set<Number>;\n selectedNodes: Set<Number>;\n selectedNode?: SNode;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n selectedLink?: SLink;\n shouldOverflow: boolean;\n}\n\nconst NON_SELECTED_NODE_AND_STREAM_COLOR: string = '#757575';\nconst DEFAULT_NODE_COLORS: NodeColors[] = [\n { fillColor: '#00758F', borderColor: '#002E39' },\n { fillColor: '#77004D', borderColor: '#43002C' },\n { fillColor: '#4F6BED', borderColor: '#3B52B4' },\n { fillColor: '#937600', borderColor: '#6D5700' },\n { fillColor: '#286EA8', borderColor: '#00457E' },\n { fillColor: '#A43FB1', borderColor: '#7C158A' },\n { fillColor: '#CC3595', borderColor: '#7F215D' },\n { fillColor: '#0E7878', borderColor: '#004E4E' },\n { fillColor: '#8764B8', borderColor: '#4B3867' },\n { fillColor: '#9C663F', borderColor: '#6D4123' },\n];\n\nconst MIN_HEIGHT_FOR_DOUBLINE_TYPE = 36;\nconst MIN_HEIGHT_FOR_TYPE = 24;\nconst REST_STREAM_OPACITY: number = 1;\nconst NON_SELECTED_OPACITY: number = 1;\nconst SELECTED_STREAM_OPACITY: number = 0.3;\nconst NON_SELECTED_STREAM_BORDER_OPACITY: number = 0.5;\nconst DEFAULT_TEXT_COLOR: string = '#323130';\nconst NON_SELECTED_TEXT_COLOR: string = '#FFFFFF';\n\nexport class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> {\n private _classNames: IProcessedStyleSet<ISankeyChartStyles>;\n private chartContainer: HTMLDivElement;\n private _reqID: number;\n private _calloutId: string;\n private _linkId: string;\n private _nodesInColumn: NodesInColumns;\n private _sankey: d3Sankey.SankeyLayout<d3Sankey.SankeyGraph<{}, {}>, {}, {}>;\n private _margins: IMargins;\n private _isRtl: boolean = getRTL();\n private _normalizeData: (data: ISankeyChartData) => void;\n\n constructor(props: ISankeyChartProps) {\n super(props);\n this.state = {\n containerHeight: 468,\n containerWidth: 912,\n selectedState: false,\n selectedLinks: new Set<number>(),\n selectedNodes: new Set<number>(),\n shouldOverflow: false,\n isCalloutVisible: false,\n };\n this._calloutId = getId('callout');\n this._linkId = getId('link');\n this._margins = { top: 36, right: 48, bottom: 32, left: 48 };\n this._preRenderLayout();\n this._normalizeData = memoizeFunction((data: ISankeyChartData) => this._normalizeSankeyData(data));\n }\n public componentDidMount(): void {\n this._fitParentContainer();\n }\n\n public componentDidUpdate(prevProps: ISankeyChartProps): void {\n if (prevProps.shouldResize !== this.props.shouldResize) {\n this._fitParentContainer();\n }\n }\n public componentWillUnmount(): void {\n cancelAnimationFrame(this._reqID);\n }\n public render(): React.ReactNode {\n const { theme, className, styles, pathColor } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: this.state.containerWidth,\n height: this.state.containerHeight,\n pathColor,\n className,\n });\n // We are using the this._margins.left and this._margins.top in sankey extent while constructing the layout\n const { height, width } = this._preRenderLayout();\n this._normalizeData(this.props.data.SankeyChartData!);\n let nodePadding = 8;\n nodePadding = this._adjustPadding(this._sankey, height - 6, this._nodesInColumn);\n\n this._sankey.nodePadding(nodePadding);\n this._sankey(this.props.data.SankeyChartData!);\n this._populateNodeActualValue(this.props.data.SankeyChartData!);\n this._assignNodeColors();\n const nodeData = this._createNodes(width);\n const linkData = this._createLinks();\n const calloutProps = {\n isCalloutVisible: this.state.isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${this._calloutId}`,\n target: this.state.refSelected,\n color: this.state.color,\n XValue: this.state.xCalloutValue,\n YValue: this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard,\n descriptionMessage: this.state.descriptionMessage,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: this._onCloseCallout,\n className: this._classNames.calloutContentRoot,\n preventDismissOnLostFocus: true,\n };\n return (\n <div\n className={this._classNames.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => (this.chartContainer = rootElem)}\n onMouseLeave={this._onCloseCallout}\n >\n <FocusZone\n direction={FocusZoneDirection.bidirectional}\n isCircularNavigation={true}\n handleTabKey={FocusZoneTabbableElements.all}\n >\n <svg width={width} height={height} id={getId('sankeyChart')}>\n <g className={this._classNames.links} strokeOpacity={1}>\n {linkData}\n </g>\n <g className={this._classNames.nodes}>{nodeData}</g>\n {calloutProps.isCalloutVisible && (\n <Callout {...calloutProps}>\n <ChartHoverCard\n XValue={calloutProps.XValue}\n YValue={calloutProps.YValue}\n color={calloutProps.color}\n descriptionMessage={calloutProps.descriptionMessage ? calloutProps.descriptionMessage : ''}\n />\n </Callout>\n )}\n </svg>\n </FocusZone>\n </div>\n );\n }\n\n private _preRenderLayout(): { height: number; width: number } {\n const width = this.state.containerWidth - this._margins.right!;\n const height =\n this.state.containerHeight - this._margins.bottom! > 0 ? this.state.containerHeight - this._margins.bottom! : 0;\n\n this._sankey = d3Sankey\n .sankey()\n .nodeWidth(124)\n .extent([\n [this._margins.left!, this._margins.top!],\n [width - 1, height - 6],\n ])\n .nodeAlign(this._isRtl ? d3Sankey.sankeyRight : d3Sankey.sankeyJustify);\n\n return { height, width };\n }\n\n /**\n * This is used for calculating the node non normalized value based on link non normalized value.\n *\n */\n private _populateNodeActualValue(data: ISankeyChartData) {\n data.links.forEach((link: SLink) => {\n if (!link.unnormalizedValue) {\n link.unnormalizedValue = link.value;\n }\n });\n data.nodes.forEach((node: SNode) => {\n node.actualValue = Math.max(\n d3Sum(node.sourceLinks!, (link: SLink) => link.unnormalizedValue),\n d3Sum(node.targetLinks!, (link: SLink) => link.unnormalizedValue),\n );\n });\n }\n\n private _normalizeSankeyData(data: ISankeyChartData): void {\n this._nodesInColumn = this._populateNodeInColumns(data, this._sankey);\n this._adjustOnePercentHeightNodes(this._nodesInColumn);\n }\n /**\n *\n * This is used to group nodes by column index.\n */\n private _populateNodeInColumns(\n graph: ISankeyChartData,\n sankey: d3Sankey.SankeyLayout<d3Sankey.SankeyGraph<{}, {}>, {}, {}>,\n ) {\n sankey(graph);\n const nodesInColumn: NodesInColumns = {};\n graph.nodes.forEach((node: SNode) => {\n const columnId = node.layer!;\n if (nodesInColumn[columnId]) {\n nodesInColumn[columnId].push(node);\n } else {\n nodesInColumn[columnId] = [node];\n }\n });\n return nodesInColumn;\n }\n\n /**\n * This is used to normalize the nodes value whose value is less than 1% of the total column value.\n *\n */\n private _adjustOnePercentHeightNodes(nodesInColumn: NodesInColumns) {\n const totalColumnValue = Object.values(nodesInColumn).map((column: SNode[]) => {\n return d3Sum(column, (node: SNode) => node.value);\n });\n totalColumnValue.forEach((columnValue: number, index: number) => {\n let totalPercentage = 0;\n nodesInColumn[index].forEach((node: SNode) => {\n const nodePercentage = (node.value! / columnValue) * 100;\n node.actualValue = node.value;\n //if the value is less than 1% then we are making it as 1% of total .\n if (nodePercentage < 1) {\n node.value = 0.01 * columnValue;\n totalPercentage = totalPercentage + 1;\n } else {\n totalPercentage = totalPercentage + nodePercentage;\n }\n });\n //since we have adjusted the value to be 1% but we need to keep the sum of the percentage value under 100.\n const scalingRatio = totalPercentage !== 0 ? totalPercentage / 100 : 1;\n if (scalingRatio > 1) {\n nodesInColumn[index].forEach((node: SNode) => {\n node.value = node.value! / scalingRatio;\n this._changeColumnValue(node, node.actualValue!, node.value);\n });\n }\n });\n }\n\n /**\n *\n * This is used for normalizing each links value for reflecting the normalized node value.\n */\n private _changeColumnValue(node: SNode, originalValue: number, normalizedValue: number) {\n node.sourceLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n node.targetLinks!.forEach((link: SLink) => {\n link.unnormalizedValue = link.value;\n const linkRatio = link.value / originalValue;\n link.value = normalizedValue * linkRatio;\n });\n }\n\n /**\n *\n * This is used to introduce dynamic padding for cases where the number of nodes in a column is huge\n * so that we maintain a node to space ratio for such columns as if we fail to do so the\n * chart is devoid of nodes and only shows links.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _adjustPadding(sankey: any, height: number, nodesInColumn: NodesInColumns) {\n let padding = this._sankey.nodePadding();\n Object.values(nodesInColumn).forEach((column: SNode[]) => {\n const minPadding = PADDING_PERCENTAGE * height;\n const toatlPaddingInColumn = height - d3Sum(column, (node: SNode) => node.y1! - node.y0!);\n if (minPadding < toatlPaddingInColumn) {\n //Here we are calculating the min of default and calculated padding, we will not increase the padding\n //in any scenario.\n padding = Math.min(padding, minPadding / (column.length - 1));\n }\n });\n return padding;\n }\n\n private _createLinks(): React.ReactNode[] | undefined {\n const links: React.ReactNode[] = [];\n\n if (this.props.data.SankeyChartData) {\n this.props.data.SankeyChartData.links.forEach((singleLink: SLink, index: number) => {\n const onMouseOut = () => {\n this._onStreamLeave(singleLink);\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = (d: any) => {\n return [\n { x: d.source.x1, y0: d.y0 + d.width / 2, y1: d.y0 - d.width / 2 },\n { x: d.target.x0, y0: d.y1 + d.width / 2, y1: d.y1 - d.width / 2 },\n ];\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataPoints: Array<any> = data(singleLink);\n const linkArea = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((p: any) => p.x)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((p: any) => p.y0)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((p: any) => p.y1)\n .curve(d3CurveBasis);\n const gradientUrl = `url(#gradient-${this._linkId}-${index})`;\n const link = (\n <g key={`${this._linkId}-${index}`}>\n <defs>\n <linearGradient id={`gradient-${this._linkId}-${index}`} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0\" stopColor={(singleLink.source as SNode).color} />\n <stop offset=\"100%\" stopColor={(singleLink.target as SNode).color} />\n </linearGradient>\n </defs>\n <path\n d={linkArea(dataPoints)!}\n id={getId('link')}\n fill={this._fillStreamColors(singleLink, gradientUrl)}\n stroke={this._fillStreamBorder(singleLink, gradientUrl)}\n strokeWidth=\"2\"\n strokeOpacity={this._getOpacityStreamBorder(singleLink)}\n onMouseOver={this._onStreamHover.bind(this, singleLink)}\n onMouseOut={onMouseOut}\n onFocus={this._onFocusLink.bind(this, singleLink)}\n onBlur={this._onBlur}\n fillOpacity={this._getOpacityStream(singleLink)}\n data-is-focusable={true}\n aria-label={\n 'link from' +\n (singleLink.source as SNode).name +\n 'to' +\n (singleLink.target as SNode).name +\n 'with weight' +\n singleLink!.unnormalizedValue\n }\n role=\"img\"\n />\n </g>\n );\n links.push(link);\n });\n }\n return links;\n }\n\n private _createNodes(width: number): React.ReactNode[] | undefined {\n const nodes: React.ReactNode[] = [];\n\n if (this.props.data.SankeyChartData) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.props.data.SankeyChartData.nodes.forEach((singleNode: SNode, index: number) => {\n const onMouseOut = () => {\n this._onLeave(singleNode);\n };\n const height = singleNode.y1! - singleNode.y0! > 0 ? singleNode.y1! - singleNode.y0! : 0;\n let padding = 8;\n let textLengthForNodeWeight = 0;\n\n // If the nodeWeight is in the same line as node description an extra padding\n // of 6 px is required between node description and node weight.\n if (height < MIN_HEIGHT_FOR_DOUBLINE_TYPE) {\n padding = padding + 6;\n const tspan = select('.nodeName').append('text').attr('class', 'tempText').append('tspan').text(null);\n tspan.text(singleNode.actualValue!);\n if (tspan.node() !== null) {\n textLengthForNodeWeight = tspan.node()!.getComputedTextLength();\n padding = padding + textLengthForNodeWeight;\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n }\n // Since the total width of the node is 124 and we are giving margin of 8px from the left .\n //So the actual value on which it will be truncated is 124-8=116.\n const truncatedname: string = this._truncateText(singleNode.name, 116, padding);\n const isTruncated: boolean = truncatedname.slice(-3) === '...';\n const id = getId('tooltip');\n const div = select('body')\n .append('div')\n .attr('id', id)\n .attr('class', this._classNames.toolTip!)\n .style('opacity', 0);\n const nodeId = getId('nodeBar');\n const node = (\n <g key={index} id={getId('nodeGElement')}>\n <rect\n x={singleNode.x0}\n y={singleNode.y0}\n height={height}\n width={singleNode.x1! - singleNode.x0!}\n fill={this._fillNodeColors(singleNode)}\n id={nodeId}\n onMouseOver={this._onHover.bind(this, singleNode)}\n onMouseOut={onMouseOut}\n onFocus={this._onCloseCallout.bind(this)}\n stroke={this._fillNodeBorder(singleNode)}\n strokeWidth=\"2\"\n opacity=\"1\"\n data-is-focusable={true}\n aria-label={'node' + `${singleNode.name}` + 'with weight' + `${singleNode.actualValue}`}\n role=\"img\"\n />\n {singleNode.y1! - singleNode.y0! > MIN_HEIGHT_FOR_TYPE && (\n <g className={this._classNames.nodeTextContainer}>\n <g className=\"nodeName\">\n <text\n id={`${nodeId}-name`}\n x={singleNode.x0}\n y={singleNode.y0}\n dy={'1.2em'}\n dx={'0.4em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"regular\"\n aria-hidden=\"true\"\n fill={\n !(\n !this.state.selectedState ||\n (this.state.selectedState &&\n this.state.selectedNodes.has(singleNode.index!) &&\n this.state.selectedNode) ||\n (this.state.selectedState && !this.state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={10}\n onMouseOver={this._showTooltip.bind(this, singleNode.name, isTruncated, div)}\n onMouseOut={this._hideTooltip.bind(this, div)}\n >\n {truncatedname}\n </text>\n </g>\n\n <text\n x={\n height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? singleNode.x0 : singleNode.x1! - textLengthForNodeWeight - 8\n }\n y={singleNode.y0}\n dy={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '2em' : '1em'}\n dx={height > MIN_HEIGHT_FOR_DOUBLINE_TYPE ? '0.4em' : '0em'}\n textAnchor={this._isRtl ? 'end' : 'start'}\n fontWeight=\"bold\"\n aria-hidden=\"true\"\n fill={\n !(\n !this.state.selectedState ||\n (this.state.selectedState &&\n this.state.selectedNodes.has(singleNode.index!) &&\n this.state.selectedNode) ||\n (this.state.selectedState && !this.state.selectedNode)\n )\n ? DEFAULT_TEXT_COLOR\n : NON_SELECTED_TEXT_COLOR\n }\n fontSize={14}\n >\n {singleNode.actualValue}\n </text>\n </g>\n )}\n </g>\n );\n nodes.push(node);\n });\n return nodes;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onLeave(singleNode: SNode) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedNode: undefined,\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onHover(singleNode: SNode, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const selectedLinks = this._getSelectedLinks(singleNode);\n const selectedNodes = this._getSelectedNodes(selectedLinks);\n selectedNodes.push(singleNode);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n selectedNode: singleNode,\n refSelected: mouseEvent, //this._refArray.get(index),\n isCalloutVisible: singleNode.y1! - singleNode.y0! < MIN_HEIGHT_FOR_TYPE,\n color: singleNode.color,\n xCalloutValue: singleNode.name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: (singleNode.actualValue! as any) as string,\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onStreamHover(singleLink: SLink, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n this._onCloseCallout();\n if (!this.state.selectedState) {\n const { selectedLinks, selectedNodes } = this._getSelectedLinksforStreamHover(singleLink);\n this.setState({\n selectedState: true,\n selectedNodes: new Set<number>(Array.from(selectedNodes).map(node => node.index!)),\n selectedLinks: new Set<number>(Array.from(selectedLinks).map(link => link.index!)),\n refSelected: mouseEvent,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: ((singleLink.source as SNode).actualValue! as any) as string,\n descriptionMessage: 'from ' + (singleLink.source as SNode).name,\n });\n }\n }\n\n private _onStreamLeave(singleLink: SLink) {\n if (this.state.selectedState) {\n this.setState({\n selectedState: false,\n selectedNodes: new Set<number>(),\n selectedLinks: new Set<number>(),\n selectedLink: undefined,\n });\n }\n }\n\n private _onFocusLink(singleLink: SLink, element: React.FocusEvent<SVGElement>): void {\n element.persist();\n this._onCloseCallout();\n this.setState({\n refSelected: element.currentTarget,\n selectedLink: singleLink,\n isCalloutVisible: true,\n color: (singleLink.source as SNode).color,\n xCalloutValue: (singleLink.target as SNode).name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yCalloutValue: ((singleLink.source as SNode).actualValue! as any) as string,\n descriptionMessage: 'from ' + (singleLink.source as SNode).name,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _onCloseCallout = () => {\n this.setState({\n isCalloutVisible: false,\n refSelected: undefined,\n descriptionMessage: '',\n });\n };\n\n private _onBlur = (): void => {\n /**/\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillNodeColors = (singleNode: SNode): string | undefined => {\n if (!this.state.selectedState) {\n return singleNode.color;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!) && this.state.selectedNode) {\n return this.state.selectedNode.color;\n } else if (this.state.selectedState && !this.state.selectedNode) {\n return singleNode.color;\n }\n };\n\n /**\n * This is used to assign node fillcolors and borderColor cyclically when the user doesnt\n * provide color to individual node.\n */\n private _assignNodeColors() {\n let colors: string[];\n let borders: string[];\n if (this.props.colorsForNodes && this.props.borderColorsForNodes) {\n colors = this.props.colorsForNodes;\n borders = this.props.borderColorsForNodes;\n } else {\n colors = DEFAULT_NODE_COLORS.map(color => color.fillColor);\n borders = DEFAULT_NODE_COLORS.map(color => color.borderColor);\n }\n let currentIndex = 0;\n this.props.data.SankeyChartData!.nodes.forEach((node: SNode) => {\n if (!node.color && !node.borderColor) {\n node.color = colors[currentIndex];\n node.borderColor = borders[currentIndex];\n } else if (node.color && !node.borderColor) {\n node.borderColor = '#757575';\n } else if (node.borderColor && !node.color) {\n node.color = '#F5F5F5';\n }\n currentIndex = (currentIndex + 1) % colors.length;\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillStreamColors(singleLink: SLink, gradientUrl: string): string | undefined {\n if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!) && this.state.selectedNode) {\n return this.state.selectedNode.color;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillStreamBorder(singleLink: SLink, gradientUrl: string): string {\n if (!this.state.selectedState) {\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!) && this.state.selectedNode) {\n return this.state.selectedNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedLinks.has(singleLink.index!)) {\n return gradientUrl;\n }\n return NON_SELECTED_NODE_AND_STREAM_COLOR;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fillNodeBorder = (singleNode: SNode): string => {\n if (!this.state.selectedState) {\n return singleNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!) && this.state.selectedNode) {\n return this.state.selectedNode.borderColor!;\n } else if (this.state.selectedState && this.state.selectedNodes.has(singleNode.index!)) {\n return singleNode.borderColor!;\n }\n return singleNode.borderColor!;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedNodes(selectedLinks: Set<SLink>): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nodes: SNode[] = [];\n selectedLinks.forEach(link => {\n nodes.push(link.target as SNode);\n\n if (nodes.indexOf(link.source as SNode) === -1) {\n nodes.push(link.source as SNode);\n }\n });\n return nodes;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedLinks(singleNode: SNode): Set<SLink> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n\n singleNode.sourceLinks!.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.target as SNode;\n if (node && node.sourceLinks) {\n node.sourceLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n if (singleNode.targetLinks) {\n singleNode.targetLinks.forEach((link: SLink) => {\n q.push(link);\n finalLinks.add(link);\n });\n }\n\n while (q.length > 0) {\n const poppedLink: SLink = q.shift();\n const node: SNode = poppedLink.source as SNode;\n if (node && node.targetLinks) {\n node.targetLinks.forEach((link: SLink) => {\n finalLinks.add(link);\n q.push(link);\n });\n }\n }\n\n return finalLinks;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getSelectedLinksforStreamHover(singleLink: SLink): { selectedLinks: Set<SLink>; selectedNodes: Set<SNode> } {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-array-constructor\n const q: any = new Array<any>();\n const finalLinks: Set<SLink> = new Set<SLink>();\n const finalNodes: Set<SNode> = new Set<SNode>();\n\n q.push(singleLink.source);\n finalLinks.add(singleLink);\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.targetLinks && poppedNode.targetLinks.length > 0) {\n poppedNode.targetLinks.forEach((link: SLink) => {\n q.push(link.source);\n finalLinks.add(link);\n });\n }\n }\n\n q.push(singleLink.target);\n\n while (q.length > 0) {\n const poppedNode: SNode = q.shift();\n finalNodes.add(poppedNode);\n if (poppedNode.sourceLinks && poppedNode.sourceLinks.length > 0) {\n poppedNode.sourceLinks.forEach((link: SLink) => {\n q.push(link.target);\n finalLinks.add(link);\n });\n }\n }\n\n return {\n selectedLinks: finalLinks,\n selectedNodes: finalNodes,\n };\n }\n\n private _getOpacityStream(singleLink: SLink): number {\n if (this.state.selectedState) {\n if (!this.state.selectedLinks.has(singleLink.index!)) {\n return NON_SELECTED_OPACITY;\n } else if (\n this.state.selectedState &&\n this.state.selectedLinks.has(singleLink.index!) &&\n !this.state.selectedNode\n ) {\n return SELECTED_STREAM_OPACITY;\n }\n }\n return REST_STREAM_OPACITY;\n }\n\n private _getOpacityStreamBorder(singleLink: SLink): number {\n if (this.state.selectedState && !this.state.selectedLinks.has(singleLink.index!) && !this.state.selectedNode) {\n return NON_SELECTED_STREAM_BORDER_OPACITY;\n }\n\n return NON_SELECTED_OPACITY;\n }\n\n private _fitParentContainer(): void {\n const { containerWidth, containerHeight } = this.state;\n this._reqID = requestAnimationFrame(() => {\n const container = this.props.parentRef ? this.props.parentRef : this.chartContainer;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight = container.getBoundingClientRect().height;\n const shouldResize = containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight;\n if (shouldResize) {\n this.setState({\n containerWidth: currentContainerWidth,\n containerHeight: currentContainerHeight,\n });\n }\n });\n }\n /**\n *\n * @param text is the text which we are trying to truncate\n * @param rectangleWidth is the width of the rectangle which will contain the text\n * @param padding is the space we need to leave between the rect lines and other text\n * @param nodeWeight is the text if present needs to be accomodate in the same line as text.\n * @returns the truncated text , if truncated given the above parameters.\n */\n private _truncateText(text: string, rectangleWidth: number, padding: number) {\n const textLengthForNodeName = rectangleWidth - padding;\n let elipsisLength = 0;\n const tspan = select('.nodeName')\n .append('text')\n .attr('class', 'tempText')\n .attr('font-size', '10')\n .append('tspan')\n .text(null);\n tspan.text(text);\n if (tspan.node() !== null && tspan.node()!.getComputedTextLength() <= textLengthForNodeName) {\n return text;\n }\n tspan.text(null);\n tspan.text('...');\n if (tspan.node() !== null) {\n elipsisLength = tspan.node()!.getComputedTextLength();\n }\n tspan.text(null);\n let line: string = '';\n for (let i = 0; i < text.length; i++) {\n line += text[i];\n tspan.text(line);\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w >= textLengthForNodeName - elipsisLength) {\n line = line.slice(0, -1);\n line += '...';\n break;\n }\n }\n }\n tspan.text(null);\n selectAll('.tempText').remove();\n return line;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _showTooltip(text: string, checkTrcuncated: boolean, div: any, evt: any) {\n if (checkTrcuncated) {\n //Fixing tooltip position by attaching it to the element rather than page\n div.style('opacity', 0.9);\n div\n .html(text)\n .style('left', evt.pageX + 'px')\n .style('top', evt.pageY - 28 + 'px');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _hideTooltip(div: any) {\n div.style('opacity', 0);\n }\n}\n"]}
@@ -1,5 +1,9 @@
1
+ import { __assign } from "tslib";
2
+ import { HighContrastSelectorBlack } from '@fluentui/react/lib/Styling';
1
3
  export var getStyles = function (props) {
4
+ var _a, _b, _c;
2
5
  var className = props.className, theme = props.theme, pathColor = props.pathColor;
6
+ var effects = theme.effects;
3
7
  return {
4
8
  root: [
5
9
  theme.fonts.medium,
@@ -13,8 +17,41 @@ export var getStyles = function (props) {
13
17
  className,
14
18
  ],
15
19
  links: {
16
- stroke: pathColor ? pathColor : theme.palette.blue,
17
- fill: 'none',
20
+ stroke: pathColor ? pathColor : theme.palette.black,
21
+ fill: theme ? theme.semanticColors.bodyBackground : '#F5F5F5',
22
+ strokeWidth: 3,
23
+ selectors: (_a = {},
24
+ _a[HighContrastSelectorBlack] = {
25
+ fill: '#000000',
26
+ },
27
+ _a),
28
+ },
29
+ nodes: {
30
+ fill: '#F5F5F5',
31
+ selectors: (_b = {},
32
+ _b[HighContrastSelectorBlack] = {
33
+ fill: '#000000',
34
+ },
35
+ _b),
36
+ },
37
+ toolTip: __assign(__assign({}, props.theme.fonts.medium), { display: 'flex', flexDirection: 'column', padding: '8px', position: 'absolute', textAlign: 'center', top: '0px', background: props.theme.semanticColors.bodyBackground, borderRadius: '2px', pointerEvents: 'none' }),
38
+ nodeTextContainer: {
39
+ selectors: {
40
+ text: {
41
+ selectors: (_c = {},
42
+ _c[HighContrastSelectorBlack] = {
43
+ fill: 'rgb(179, 179, 179)',
44
+ },
45
+ _c),
46
+ },
47
+ },
48
+ marginTop: '4px',
49
+ marginLeft: '8px',
50
+ marginBottom: '4px',
51
+ marginRight: '8px',
52
+ },
53
+ calloutContentRoot: {
54
+ boxShadow: effects.elevation4,
18
55
  },
19
56
  };
20
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.styles.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.styles.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,KAA6B;IAC7C,IAAA,SAAS,GAAuB,KAAK,UAA5B,EAAE,KAAK,GAAgB,KAAK,MAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;IAC9C,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB;gBACE,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,aAAa,EAAE,QAAQ;gBACvB,QAAQ,EAAE,QAAQ;aACnB;YACD,SAAS;SACV;QACD,KAAK,EAAE;YACL,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;YAClD,IAAI,EAAE,MAAM;SACb;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\n\nexport const getStyles = (props: ISankeyChartStyleProps): ISankeyChartStyles => {\n const { className, theme, pathColor } = props;\n return {\n root: [\n theme.fonts.medium,\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n },\n className,\n ],\n links: {\n stroke: pathColor ? pathColor : theme.palette.blue,\n fill: 'none',\n },\n };\n};\n"]}
1
+ {"version":3,"file":"SankeyChart.styles.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.styles.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,KAA6B;;IAC7C,IAAA,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B;yBAC3B;2BACF;iBACF;aACF;YAED,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,KAAK;SACnB;QACD,kBAAkB,EAAE;YAClB,SAAS,EAAE,OAAO,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { ISankeyChartStyleProps, ISankeyChartStyles } from './SankeyChart.types';\nimport { HighContrastSelectorBlack } from '@fluentui/react/lib/Styling';\n\nexport const getStyles = (props: ISankeyChartStyleProps): ISankeyChartStyles => {\n const { className, theme, pathColor } = props;\n const { effects } = theme;\n return {\n root: [\n theme.fonts.medium,\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n },\n className,\n ],\n links: {\n stroke: pathColor ? pathColor : theme.palette.black,\n fill: theme ? theme.semanticColors.bodyBackground : '#F5F5F5',\n strokeWidth: 3,\n selectors: {\n [HighContrastSelectorBlack]: {\n fill: '#000000',\n },\n },\n },\n nodes: {\n fill: '#F5F5F5',\n selectors: {\n [HighContrastSelectorBlack]: {\n fill: '#000000',\n },\n },\n },\n toolTip: {\n ...props.theme!.fonts.medium,\n display: 'flex',\n flexDirection: 'column',\n padding: '8px',\n position: 'absolute',\n textAlign: 'center',\n top: '0px',\n background: props.theme!.semanticColors.bodyBackground,\n borderRadius: '2px',\n pointerEvents: 'none',\n },\n nodeTextContainer: {\n selectors: {\n text: {\n selectors: {\n [HighContrastSelectorBlack]: {\n fill: 'rgb(179, 179, 179)',\n },\n },\n },\n },\n\n marginTop: '4px',\n marginLeft: '8px',\n marginBottom: '4px',\n marginRight: '8px',\n },\n calloutContentRoot: {\n boxShadow: effects.elevation4,\n },\n };\n};\n"]}
@@ -39,6 +39,14 @@ export interface ISankeyChartProps {
39
39
  * Color for path
40
40
  */
41
41
  pathColor?: string;
42
+ /**
43
+ * Colors for nodes
44
+ */
45
+ colorsForNodes?: string[];
46
+ /**
47
+ * Colors for nodes border
48
+ */
49
+ borderColorsForNodes?: string[];
42
50
  }
43
51
  export interface ISankeyChartStyleProps {
44
52
  theme: ITheme;
@@ -60,4 +68,16 @@ export interface ISankeyChartStyles {
60
68
  * Style for the links.
61
69
  */
62
70
  links?: IStyle;
71
+ /**
72
+ * Style for the text inside node.
73
+ */
74
+ nodeTextContainer?: IStyle;
75
+ /**
76
+ * Style for the tooltip ,when user hover over the truncated node detail.
77
+ */
78
+ toolTip?: IStyle;
79
+ /**
80
+ * Style for the tooltip ,when user hover over the truncated node detail.
81
+ */
82
+ calloutContentRoot?: IStyle;
63
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.types.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChartProps } from '../../types/IDataPoint';\n\nexport type { IChartProps, IDataPoint, ISankeyChartData } from '../../types/IDataPoint';\n\nexport interface ISankeyChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SankeyChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the Sankey chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * should chart resize when parent resize.\n */\n shouldResize?: number;\n\n /**\n * Color for path\n */\n pathColor?: string;\n}\n\nexport interface ISankeyChartStyleProps {\n theme: ITheme;\n className?: string;\n width: number;\n height: number;\n pathColor?: string;\n}\n\nexport interface ISankeyChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the nodes.\n */\n nodes?: IStyle;\n\n /**\n * Style for the links.\n */\n links?: IStyle;\n}\n"]}
1
+ {"version":3,"file":"SankeyChart.types.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChartProps } from '../../types/IDataPoint';\n\nexport type { IChartProps, IDataPoint, ISankeyChartData } from '../../types/IDataPoint';\n\nexport interface ISankeyChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SankeyChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the Sankey chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * should chart resize when parent resize.\n */\n shouldResize?: number;\n\n /**\n * Color for path\n */\n pathColor?: string;\n\n /**\n * Colors for nodes\n */\n colorsForNodes?: string[];\n\n /**\n * Colors for nodes border\n */\n borderColorsForNodes?: string[];\n}\n\nexport interface ISankeyChartStyleProps {\n theme: ITheme;\n className?: string;\n width: number;\n height: number;\n pathColor?: string;\n}\n\nexport interface ISankeyChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the nodes.\n */\n nodes?: IStyle;\n\n /**\n * Style for the links.\n */\n links?: IStyle;\n\n /**\n * Style for the text inside node.\n */\n nodeTextContainer?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n toolTip?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n\n calloutContentRoot?: IStyle;\n}\n"]}
@@ -330,12 +330,16 @@ export interface ISankeyChartData {
330
330
  interface ISNodeExtra {
331
331
  nodeId: number | string;
332
332
  name: string;
333
- color: string;
333
+ color?: string;
334
+ borderColor?: string;
335
+ actualValue?: number;
336
+ layer?: number;
334
337
  }
335
338
  interface ISLinkExtra {
336
339
  source: number;
337
340
  target: number;
338
341
  value: number;
342
+ unnormalizedValue?: number;
339
343
  }
340
344
  export declare type SNode = d3Sankey.SankeyNode<ISNodeExtra, ISLinkExtra>;
341
345
  export declare type SLink = d3Sankey.SankeyLink<ISNodeExtra, ISLinkExtra>;
@@ -1 +1 @@
1
- {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import { SVGProps } from 'react';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport * as d3Sankey from 'd3-sankey';\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface ILineChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\nexport interface ILineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n}\n\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n}\n\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n nodeId: number | string;\n name: string;\n color: string;\n}\n\ninterface ISLinkExtra {\n source: number;\n target: number;\n value: number;\n}\n\nexport type SNode = d3Sankey.SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = d3Sankey.SankeyLink<ISNodeExtra, ISLinkExtra>;\n\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalStackedBarChart {\n y: number;\n color: string;\n legend: string;\n /**\n * Data to show in callout\n */\n data?: number;\n yAxisCalloutData?: string;\n}\n\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n"]}
1
+ {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import { SVGProps } from 'react';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport * as d3Sankey from 'd3-sankey';\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface ILineChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\nexport interface ILineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n}\n\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n}\n\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n nodeId: number | string;\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n source: number;\n target: number;\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = d3Sankey.SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = d3Sankey.SankeyLink<ISNodeExtra, ISLinkExtra>;\n\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalStackedBarChart {\n y: number;\n color: string;\n legend: string;\n /**\n * Data to show in callout\n */\n data?: number;\n yAxisCalloutData?: string;\n}\n\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n"]}
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Do not modify this file; it is generated as part of publish.
2
2
  // The checked in version is a placeholder only and will not be updated.
3
3
  import { setVersion } from '@fluentui/set-version';
4
- setVersion('@fluentui/react-charting', '5.14.43');
4
+ setVersion('@fluentui/react-charting', '5.15.1');
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.14.43');"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,UAAU,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.15.1');"]}
@@ -1,18 +1,95 @@
1
1
  import * as React from 'react';
2
2
  import { ISankeyChartProps } from './SankeyChart.types';
3
- export declare class SankeyChartBase extends React.Component<ISankeyChartProps, {
3
+ import { IBasestate, IChartHoverCardProps, SLink, SNode } from '../../index';
4
+ export interface ISankeyChartState extends IBasestate, IChartHoverCardProps {
4
5
  containerWidth: number;
5
6
  containerHeight: number;
6
- }> {
7
+ selectedState: boolean;
8
+ selectedLinks: Set<Number>;
9
+ selectedNodes: Set<Number>;
10
+ selectedNode?: SNode;
11
+ refSelected?: any;
12
+ selectedLink?: SLink;
13
+ shouldOverflow: boolean;
14
+ }
15
+ export declare class SankeyChartBase extends React.Component<ISankeyChartProps, ISankeyChartState> {
7
16
  private _classNames;
8
17
  private chartContainer;
9
18
  private _reqID;
19
+ private _calloutId;
20
+ private _linkId;
21
+ private _nodesInColumn;
22
+ private _sankey;
23
+ private _margins;
24
+ private _isRtl;
25
+ private _normalizeData;
10
26
  constructor(props: ISankeyChartProps);
11
27
  componentDidMount(): void;
12
28
  componentDidUpdate(prevProps: ISankeyChartProps): void;
13
29
  componentWillUnmount(): void;
14
30
  render(): React.ReactNode;
31
+ private _preRenderLayout;
32
+ /**
33
+ * This is used for calculating the node non normalized value based on link non normalized value.
34
+ *
35
+ */
36
+ private _populateNodeActualValue;
37
+ private _normalizeSankeyData;
38
+ /**
39
+ *
40
+ * This is used to group nodes by column index.
41
+ */
42
+ private _populateNodeInColumns;
43
+ /**
44
+ * This is used to normalize the nodes value whose value is less than 1% of the total column value.
45
+ *
46
+ */
47
+ private _adjustOnePercentHeightNodes;
48
+ /**
49
+ *
50
+ * This is used for normalizing each links value for reflecting the normalized node value.
51
+ */
52
+ private _changeColumnValue;
53
+ /**
54
+ *
55
+ * This is used to introduce dynamic padding for cases where the number of nodes in a column is huge
56
+ * so that we maintain a node to space ratio for such columns as if we fail to do so the
57
+ * chart is devoid of nodes and only shows links.
58
+ */
59
+ private _adjustPadding;
15
60
  private _createLinks;
16
61
  private _createNodes;
62
+ private _onLeave;
63
+ private _onHover;
64
+ private _onStreamHover;
65
+ private _onStreamLeave;
66
+ private _onFocusLink;
67
+ private _onCloseCallout;
68
+ private _onBlur;
69
+ private _fillNodeColors;
70
+ /**
71
+ * This is used to assign node fillcolors and borderColor cyclically when the user doesnt
72
+ * provide color to individual node.
73
+ */
74
+ private _assignNodeColors;
75
+ private _fillStreamColors;
76
+ private _fillStreamBorder;
77
+ private _fillNodeBorder;
78
+ private _getSelectedNodes;
79
+ private _getSelectedLinks;
80
+ private _getSelectedLinksforStreamHover;
81
+ private _getOpacityStream;
82
+ private _getOpacityStreamBorder;
17
83
  private _fitParentContainer;
84
+ /**
85
+ *
86
+ * @param text is the text which we are trying to truncate
87
+ * @param rectangleWidth is the width of the rectangle which will contain the text
88
+ * @param padding is the space we need to leave between the rect lines and other text
89
+ * @param nodeWeight is the text if present needs to be accomodate in the same line as text.
90
+ * @returns the truncated text , if truncated given the above parameters.
91
+ */
92
+ private _truncateText;
93
+ private _showTooltip;
94
+ private _hideTooltip;
18
95
  }