@fluentui/react-charting 5.23.11 → 5.23.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +49 -1
- package/CHANGELOG.md +23 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/AreaChart/AreaChart.base.js +8 -13
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +1 -2
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +9 -10
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.js +3 -3
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +3 -3
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +3 -3
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/Legends/Legends.base.js +1 -2
- package/lib/components/Legends/Legends.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +14 -23
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +2 -8
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/PieChart/Arc/Arc.js +2 -1
- package/lib/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib/components/PieChart/Pie/Pie.js +4 -4
- package/lib/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib/components/PieChart/PieChart.base.js +4 -4
- package/lib/components/PieChart/PieChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +9 -14
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +4 -5
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js +3 -3
- package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib/components/TreeChart/TreeChart.base.js +1 -2
- package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +30 -44
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +10 -17
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +4 -5
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +8 -13
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -2
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/Arc/Arc.js +9 -10
- package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js +3 -3
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/Pie/Pie.js +3 -3
- package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.types.js +2 -2
- package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +3 -3
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-amd/components/Legends/Legends.base.js +1 -2
- package/lib-amd/components/Legends/Legends.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +14 -23
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js +2 -8
- package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-amd/components/PieChart/Arc/Arc.js +2 -1
- package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-amd/components/PieChart/Pie/Pie.js +4 -4
- package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-amd/components/PieChart/PieChart.base.js +4 -4
- package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +9 -14
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +4 -5
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +3 -3
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-amd/components/TreeChart/TreeChart.base.js +1 -2
- package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-amd/components/TreeChart/TreeChart.types.js +2 -2
- package/lib-amd/components/TreeChart/TreeChart.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +30 -44
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +10 -17
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/utilities/SVGTooltipText.js +4 -5
- package/lib-amd/utilities/SVGTooltipText.js.map +1 -1
- package/lib-amd/utilities/utilities.js +5 -5
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +8 -13
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +9 -10
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +3 -3
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +3 -3
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +2 -2
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.base.js +1 -2
- package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +14 -23
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -8
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/PieChart/Arc/Arc.js +2 -1
- package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/PieChart/Pie/Pie.js +4 -4
- package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/PieChart/PieChart.base.js +4 -4
- package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +9 -14
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +4 -5
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.js +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +3 -3
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/TreeChart/TreeChart.base.js +1 -2
- package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
- package/lib-commonjs/components/TreeChart/TreeChart.types.js +2 -2
- package/lib-commonjs/components/TreeChart/TreeChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +30 -44
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +10 -17
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +4 -5
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +5 -5
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeChart.base.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6CAA+C;AAC/C,2DAAmE;AAEnE,6CAAiD;AACjD,qDAAkD;AAClD,qCAAsD;AAYtD,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgC,CAAC;AAEzE,mDAAmD;AACnD;IAOE,sBACE,QAA6B,EAC7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,CAAC;IACH,oBAAC;AAAD,CAAC,AAnGD,CAAmC,KAAK,CAAC,SAAS,GAmGjD;AAnGY,sCAAa","sourcesContent":["import * as React from 'react';\nimport { hierarchy, tree } from 'd3-hierarchy';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { select, selectAll } from 'd3-selection';\nimport { FocusZone } from '@fluentui/react-focus';\nimport { max as d3Max, min as d3Min } from 'd3-array';\n\nimport {\n ITreeProps,\n ITreeState,\n ITreeDataStructure,\n ITreeChartDataPoint,\n ITreeStyleProps,\n ITreeStyles,\n} from '../../index';\nimport { IMargins } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ITreeStyleProps, ITreeStyles>();\n\n// Create a parent class for common tree components\nclass StandardTree {\n public treeData: ITreeChartDataPoint;\n public styleClassNames: IProcessedStyleSet<ITreeStyles>;\n\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n\n constructor(\n treeData: ITreeChartDataPoint,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n ) {\n this.treeData = treeData;\n this.styleClassNames = styleClassNames;\n this._nodeElements = _nodeElements;\n this._linkElements = _linkElements;\n }\n\n public truncateText(text: string, rectangleWidth: number, padding: number, styleClass: string | undefined) {\n let truncatedText = '';\n const words = text.split(/\\s+/).reverse();\n let word: string = '';\n const tspan = select('.svgTree').append('text').attr('class', 'tempText').append('tspan').text(null);\n\n if (styleClass) {\n tspan.attr('class', styleClass);\n }\n\n const line: string[] = [];\n while ((word = words.pop()!)) {\n line.push(word);\n tspan.text(line.join(' ') + ' ');\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w > rectangleWidth - padding) {\n line.pop();\n line.push('...');\n break;\n }\n }\n }\n\n truncatedText = line.join(' ') + ' ';\n tspan.text(null);\n selectAll('.tempText').remove();\n return truncatedText;\n }\n\n // Append node elements\n // nodeId to create unique key\n public addNodeShapetoSVG(\n name: string,\n subname: string | undefined,\n bodytext: string | undefined,\n metricName: string | undefined,\n xCenterCoordinate: number,\n yCoordinate: number,\n fillColor: string,\n rectangleWidth: number,\n rectangleHeight: number,\n nodeId: number,\n parentInfo: string,\n ) {\n const ariaLabel = `nodeId: ${nodeId} \\nnodeMainText: ${name}\\nsubText ${subname} ${parentInfo}`;\n const xCoordinate = xCenterCoordinate - rectangleWidth / 2;\n if (metricName || nodeId !== 0 || !bodytext) {\n this._nodeElements.push(\n <rect\n width={rectangleWidth}\n height={rectangleHeight}\n x={xCoordinate}\n y={yCoordinate}\n tabIndex={0}\n role={'text'}\n data-is-focusable={true}\n aria-label={ariaLabel}\n className={this.styleClassNames.rectNode}\n stroke={fillColor}\n key={`${nodeId}${this.styleClassNames.rectNode}`}\n />,\n );\n }\n\n if (subname) {\n subname = this.truncateText(subname, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectSubText);\n }\n if (bodytext) {\n bodytext = this.truncateText(bodytext, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectBodyText);\n }\n if (metricName) {\n metricName = this.truncateText(\n metricName,\n rectangleWidth,\n rectangleWidth / 4,\n this.styleClassNames.rectMetricText,\n );\n }\n name = this.truncateText(name, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectText);\n\n // Text position y = y + rectHeight/2, 2 is ratio for depth\n // Text position x = x + rectWidth/2, 2 is ratio for length\n // Sub-text position x = x + rectWidth/2, 2 is ratio for length\n\n const subValue = metricName ? (\n <tspan className={this.styleClassNames.rectMetricText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {metricName}\n </tspan>\n ) : bodytext ? (\n <>\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n <tspan className={this.styleClassNames.rectBodyText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {bodytext}\n </tspan>\n </>\n ) : (\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n );\n\n if (!subname && !metricName && !bodytext) {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={this.styleClassNames.rectMetricText}\n dy={yCoordinate + rectangleHeight / 1.6}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n data-is-focusable={nodeId === 0}\n >\n {name}\n </text>,\n );\n } else {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={metricName ? this.styleClassNames.rectSubText : this.styleClassNames.rectText}\n dy={metricName ? yCoordinate + rectangleHeight / 2.5 : yCoordinate + rectangleHeight / 2}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n data-is-focusable={nodeId === 0}\n >\n {name}\n {subValue}\n </text>,\n );\n }\n }\n // Create a rectangular path from parent to the child nodes\n public createPathLink(\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number,\n ): string {\n // gap adds ratio for parent.y to child.y\n\n /*Below code is used to draw lines(___|) to show the parent child relation i.e a vertical line\n emerging from the parent and\n then a horzontal line encompassing all the its children which are\n shown below it .so it gives a visual representation of tree branches.\n\n So for making this path firstly we are moving to the childX which is the mid point of the node and then\n we are subtracting the half of rectwidth to move the complete width of the rectangle and\n we are subtracting gap from y cordinate as we are making this line at a little gap from node.\n Then we are building that line horizonatlly till childXmax, again adding half rectwidth to complete\n the line till end as childXmax will be midpoint.\n Then last part is for making line vertical for that we move to the parentx position and\n then draw the vertical till parenty + rectHeight + gap/2\n We have seperate path for leaf node as we are using different composition like compact, long etc.*/\n\n const path = `M${childX - rectWidth / 2},${childY - gap} H${childXMax + rectWidth / 2} M${parentX},${childY - gap}\n V${parentY + rectHeight + gap / 2}`;\n\n const leafpath = `M${parentX},${parentY + rectHeight + gap / 2} V${parentY + gap * 5}\n H${parentX - rectWidth / 2} H${parentX + rectWidth / 2}`;\n\n // based on the type of node return leafpath or path element\n return leaf ? leafpath : path;\n }\n\n // Append path link element\n public addLinktoSVG(\n nodeId: number,\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number = 0,\n ) {\n this._linkElements.push(\n <path\n className={this.styleClassNames.link}\n d={this.createPathLink(parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax)}\n key={`${nodeId}${this.styleClassNames.link}`}\n />,\n );\n }\n}\n\n// Create child class to Add Tree component based on treeHeight\nclass LayeredTree extends StandardTree {\n public composition: number | undefined;\n private _treeTraversal: number | undefined;\n constructor(\n treeData: ITreeChartDataPoint,\n composition: number | undefined,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n _treeTraversal: number | undefined,\n ) {\n super(treeData, styleClassNames, _nodeElements, _linkElements);\n this.composition = composition;\n this._treeTraversal = _treeTraversal;\n }\n public createTree(givenLayoutWidth: number | undefined, screenWidth: number) {\n givenLayoutWidth = givenLayoutWidth! < 65 ? 65 : givenLayoutWidth! > 90 ? 90 : givenLayoutWidth;\n const layoutWidth = givenLayoutWidth || 75;\n const root = hierarchy(this.treeData, d => {\n return d.children;\n });\n\n // Find tree Height\n const treeHeight = root?.height + 1;\n\n // Create tree layout, width: layoutWidth, height: layoutWidth/1.5 and add node separation\n const treeChart = tree()\n .nodeSize([layoutWidth, layoutWidth / 1.5])\n .separation((a, b) => {\n return a.parent === root && b.parent === root ? 3.5 : 1;\n });\n\n // Assigns the x and y position for the nodes\n const treeData = treeChart(root);\n\n // Compute the new tree layout.\n const nodes = treeData.descendants();\n\n // Normalize for fixed-depth and width\n // Normalise y coordinate by depth of each node by a factor of 130\n // Normalise x coordinate by start coordinate 0 with screenSize/3\n nodes.forEach(d => {\n d.y = d.depth === 0 ? 10 : d.depth * 130;\n d.x += screenWidth / 2;\n });\n\n // <------------------ Traversal section ------------------>\n\n // Create tree data structure\n const treeDataStructure: Array<ITreeDataStructure> = [];\n let TreeID: number = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const createTreeDataStructure = (d: any) => {\n d.id = TreeID;\n treeDataStructure.push({\n id: TreeID,\n children: d.children,\n dataName: d.data.name,\n subName: d.data.subname,\n bodyText: d.data.bodytext,\n metricName: d.data?.metric,\n fill: d.data.fill,\n x: d.x,\n y: d.y,\n parentID: d.parent?.id,\n });\n TreeID++;\n };\n\n this._treeTraversal === 0\n ? root.each(d => {\n createTreeDataStructure(d);\n })\n : root.eachBefore(d => {\n createTreeDataStructure(d);\n });\n\n const rectWidth = layoutWidth * 3;\n const rectHeight = rectWidth / 3.45;\n const gap: number = 20;\n const parentSet = new Set();\n\n for (const d of treeDataStructure) {\n const parentInfo =\n d.id === 0\n ? 'Root Node'\n : `Parent info parentId: ${d.parentID}\n ${treeDataStructure[d.parentID].dataName}\n ${treeDataStructure[d.parentID].subName}`;\n\n // check for leaf nodes\n if (!d.children && !parentSet.has(d.parentID) && treeHeight === 3) {\n const compactNodeWidth = (rectWidth - gap) / 2;\n const compactNodeHeight = rectHeight;\n parentSet.add(d.parentID);\n\n // <------------------ Links section ------------------>\n this.addLinktoSVG(\n d.id,\n treeDataStructure[d.parentID].x,\n treeDataStructure[d.parentID].y,\n treeDataStructure[d.id].x,\n treeDataStructure[d.id].y,\n true,\n rectWidth,\n rectHeight,\n gap,\n );\n\n // <------------------ Nodes section ------------------>\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.parentID]?.children;\n\n const compactNodeCenterX1: number = treeDataStructure[d.parentID]?.x - compactNodeWidth / 2 - gap / 2;\n const compactNodeCenterX2: number = treeDataStructure[d.parentID]?.x + compactNodeWidth / 2 + gap / 2;\n const longNodeCenterX: number = treeDataStructure[d.parentID]?.x;\n let dy: number = children[0]?.y;\n\n for (let itr = 0; itr < children.length; ++itr) {\n const child = children[itr];\n\n // Given Composition\n if (this.composition !== undefined) {\n // For compact compostion\n if (this.composition === 0) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n // If the leaf node count is 1 ,\n //irrespective of provided composition we should always use long composition\n itr % 2 === 0 ? (children.length === 1 ? longNodeCenterX : compactNodeCenterX1) : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n }\n // For long compostion\n else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n\n // Automatic Node Composition\n else {\n if (children.length > 2) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n itr % 2 === 0 ? compactNodeCenterX1 : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n } else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n }\n }\n\n if (d.children || treeHeight <= 2) {\n // <------------------ Nodes section ------------------>\n // Since the height <=2 we will be using long compositon.\n this.addNodeShapetoSVG(\n d.dataName,\n d.subName,\n d.bodyText,\n d.metricName,\n d.x,\n d.y,\n d.fill,\n rectWidth,\n rectHeight,\n d.id,\n parentInfo,\n );\n\n // <------------------ Links section ------------------>\n if (d.id === 0 && d.children) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.id]?.children;\n const childXMin = d3Min(children, (child: ITreeDataStructure) => child.x as number)!;\n const childXMax = d3Max(children, (child: ITreeDataStructure) => child.x as number)!;\n this.addLinktoSVG(d.id, d.x, d.y, childXMin, d.children[0].y, false, rectWidth, rectHeight, gap, childXMax);\n }\n }\n }\n }\n}\n\nexport class TreeChartBase extends React.Component<ITreeProps, ITreeState> {\n private _treeData: ITreeChartDataPoint;\n private _width: number;\n private _height: number;\n private _composition: number | undefined;\n private _classNames: IProcessedStyleSet<ITreeStyles>;\n private _margin: IMargins;\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n private _treeTraversal: number | undefined;\n\n constructor(props: ITreeProps) {\n super(props);\n this._margin = {\n top: this.props.margins?.top || 30,\n bottom: this.props.margins?.bottom || 30,\n left: this.props.margins?.left || 50,\n right: this.props.margins?.right || 20,\n };\n this._width = this.props.width || 1500;\n this._height = this.props.height || 700;\n this._treeData = this.props.treeData;\n this._composition = this.props?.composition;\n this._treeTraversal = this.props.treeTraversal;\n\n this.state = {\n _width: this._width,\n _height: this._height,\n };\n }\n\n public componentDidMount() {\n const { theme, className, styles } = this.props;\n\n // Get classNames to create component styling\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n\n // Call createTreeChart function in componentDidMount\n this.createTreeChart();\n\n this.setState({\n _width: this.props.width || 1500,\n _height: this.props.height || 700,\n });\n }\n\n public componentDidUpdate(prevProps: ITreeProps): void {\n if (prevProps.layoutWidth !== this.props.layoutWidth) {\n const svgText = selectAll('text');\n const svgRect = selectAll('rect');\n const svgLink = selectAll('path');\n\n if (this._nodeElements.length === 0 && this._linkElements.length === 0) {\n svgText.remove();\n svgRect.remove();\n svgLink.remove();\n }\n\n this.createTreeChart();\n }\n }\n public createTreeChart() {\n const nodeElements: JSX.Element[] = [];\n const linkElements: JSX.Element[] = [];\n\n // Instantiate inherited class and call createTree function for the object\n const treeObject = new LayeredTree(\n this._treeData,\n this._composition,\n this._classNames,\n nodeElements,\n linkElements,\n this._treeTraversal,\n );\n const width = this.state._width - this._margin.left! - this._margin.right!;\n treeObject.createTree(this.props.layoutWidth, width);\n this._nodeElements = nodeElements;\n this._linkElements = linkElements;\n }\n\n public render(): JSX.Element {\n return (\n <FocusZone>\n <div className={this._classNames?.root}>\n <svg\n className=\"svgTree\"\n width={this.state._width - this._margin.left! - this._margin.right!}\n height={this.state._height - this._margin.top! - this._margin.bottom!}\n >\n <g className=\"svgNode\">{this._nodeElements.map(element => element)}</g>\n <g className=\"svgLink\">{this._linkElements.map(element => element)}</g>\n </svg>\n </div>\n </FocusZone>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TreeChart.base.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,6CAA+C;AAC/C,2DAAmE;AAEnE,6CAAiD;AACjD,qDAAkD;AAClD,qCAAsD;AAYtD,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgC,CAAC;AAEzE,mDAAmD;AACnD;IAOE,sBACE,QAA6B,EAC7B,eAAgD,EAChD,aAAiC,EACjC,aAAiC;QADjC,8BAAA,EAAA,kBAAiC;QACjC,8BAAA,EAAA,kBAAiC;QAP3B,kBAAa,GAAkB,EAAE,CAAC;QAClC,kBAAa,GAAkB,EAAE,CAAC;QAQxC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,mCAAY,GAAnB,UAAoB,IAAY,EAAE,cAAsB,EAAE,OAAe,EAAE,UAA8B;QACvG,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,IAAM,KAAK,G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AI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAEM,8BAAM,GAAb;;QACE,OAAO,CACL,oBAAC,uBAAS;YACR,6BAAK,SAAS,EAAE,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI;gBACpC,6BACE,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAM,EACnE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAO;oBAErE,2BAAG,SAAS,EAAC,SAAS,IAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,EAAP,CAAO,CAAC,CAAK;oBACvE,2BAAG,SAAS,EAAC,SAAS,IAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,EAAP,CAAO,CAAC,CAAK,CACnE,CACF,CACI,CACb,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAnGD,CAAmC,KAAK,CAAC,SAAS,GAmGjD;AAnGY,sCAAa","sourcesContent":["import * as React from 'react';\nimport { hierarchy, tree } from 'd3-hierarchy';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { select, selectAll } from 'd3-selection';\nimport { FocusZone } from '@fluentui/react-focus';\nimport { max as d3Max, min as d3Min } from 'd3-array';\n\nimport {\n ITreeProps,\n ITreeState,\n ITreeDataStructure,\n ITreeChartDataPoint,\n ITreeStyleProps,\n ITreeStyles,\n} from '../../index';\nimport { IMargins } from '../../utilities/utilities';\n\nconst getClassNames = classNamesFunction<ITreeStyleProps, ITreeStyles>();\n\n// Create a parent class for common tree components\nclass StandardTree {\n public treeData: ITreeChartDataPoint;\n public styleClassNames: IProcessedStyleSet<ITreeStyles>;\n\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n\n constructor(\n treeData: ITreeChartDataPoint,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n ) {\n this.treeData = treeData;\n this.styleClassNames = styleClassNames;\n this._nodeElements = _nodeElements;\n this._linkElements = _linkElements;\n }\n\n public truncateText(text: string, rectangleWidth: number, padding: number, styleClass: string | undefined) {\n let truncatedText = '';\n const words = text.split(/\\s+/).reverse();\n let word: string = '';\n const tspan = select('.svgTree').append('text').attr('class', 'tempText').append('tspan').text(null);\n\n if (styleClass) {\n tspan.attr('class', styleClass);\n }\n\n const line: string[] = [];\n while ((word = words.pop()!)) {\n line.push(word);\n tspan.text(line.join(' ') + ' ');\n if (tspan.node() !== null) {\n const w = tspan.node()!.getComputedTextLength();\n if (w > rectangleWidth - padding) {\n line.pop();\n line.push('...');\n break;\n }\n }\n }\n\n truncatedText = line.join(' ') + ' ';\n tspan.text(null);\n selectAll('.tempText').remove();\n return truncatedText;\n }\n\n // Append node elements\n // nodeId to create unique key\n public addNodeShapetoSVG(\n name: string,\n subname: string | undefined,\n bodytext: string | undefined,\n metricName: string | undefined,\n xCenterCoordinate: number,\n yCoordinate: number,\n fillColor: string,\n rectangleWidth: number,\n rectangleHeight: number,\n nodeId: number,\n parentInfo: string,\n ) {\n const ariaLabel = `nodeId: ${nodeId} \\nnodeMainText: ${name}\\nsubText ${subname} ${parentInfo}`;\n const xCoordinate = xCenterCoordinate - rectangleWidth / 2;\n if (metricName || nodeId !== 0 || !bodytext) {\n this._nodeElements.push(\n <rect\n width={rectangleWidth}\n height={rectangleHeight}\n x={xCoordinate}\n y={yCoordinate}\n tabIndex={0}\n role={'text'}\n data-is-focusable={true}\n aria-label={ariaLabel}\n className={this.styleClassNames.rectNode}\n stroke={fillColor}\n key={`${nodeId}${this.styleClassNames.rectNode}`}\n />,\n );\n }\n\n if (subname) {\n subname = this.truncateText(subname, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectSubText);\n }\n if (bodytext) {\n bodytext = this.truncateText(bodytext, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectBodyText);\n }\n if (metricName) {\n metricName = this.truncateText(\n metricName,\n rectangleWidth,\n rectangleWidth / 4,\n this.styleClassNames.rectMetricText,\n );\n }\n name = this.truncateText(name, rectangleWidth, rectangleWidth / 4, this.styleClassNames.rectText);\n\n // Text position y = y + rectHeight/2, 2 is ratio for depth\n // Text position x = x + rectWidth/2, 2 is ratio for length\n // Sub-text position x = x + rectWidth/2, 2 is ratio for length\n\n const subValue = metricName ? (\n <tspan className={this.styleClassNames.rectMetricText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {metricName}\n </tspan>\n ) : bodytext ? (\n <>\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n <tspan className={this.styleClassNames.rectBodyText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {bodytext}\n </tspan>\n </>\n ) : (\n <tspan className={this.styleClassNames.rectSubText} dy=\"1.4em\" x={xCoordinate + rectangleWidth / 2}>\n {subname}\n </tspan>\n );\n\n if (!subname && !metricName && !bodytext) {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={this.styleClassNames.rectMetricText}\n dy={yCoordinate + rectangleHeight / 1.6}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n data-is-focusable={nodeId === 0}\n >\n {name}\n </text>,\n );\n } else {\n this._nodeElements.push(\n <text\n textAnchor=\"middle\"\n className={metricName ? this.styleClassNames.rectSubText : this.styleClassNames.rectText}\n dy={metricName ? yCoordinate + rectangleHeight / 2.5 : yCoordinate + rectangleHeight / 2}\n x={xCoordinate + rectangleWidth / 2}\n key={`${nodeId}${this.styleClassNames.rectText}`}\n data-is-focusable={nodeId === 0}\n >\n {name}\n {subValue}\n </text>,\n );\n }\n }\n // Create a rectangular path from parent to the child nodes\n public createPathLink(\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number,\n ): string {\n // gap adds ratio for parent.y to child.y\n\n /*Below code is used to draw lines(___|) to show the parent child relation i.e a vertical line\n emerging from the parent and\n then a horzontal line encompassing all the its children which are\n shown below it .so it gives a visual representation of tree branches.\n\n So for making this path firstly we are moving to the childX which is the mid point of the node and then\n we are subtracting the half of rectwidth to move the complete width of the rectangle and\n we are subtracting gap from y cordinate as we are making this line at a little gap from node.\n Then we are building that line horizonatlly till childXmax, again adding half rectwidth to complete\n the line till end as childXmax will be midpoint.\n Then last part is for making line vertical for that we move to the parentx position and\n then draw the vertical till parenty + rectHeight + gap/2\n We have seperate path for leaf node as we are using different composition like compact, long etc.*/\n\n const path = `M${childX - rectWidth / 2},${childY - gap} H${childXMax + rectWidth / 2} M${parentX},${childY - gap}\n V${parentY + rectHeight + gap / 2}`;\n\n const leafpath = `M${parentX},${parentY + rectHeight + gap / 2} V${parentY + gap * 5}\n H${parentX - rectWidth / 2} H${parentX + rectWidth / 2}`;\n\n // based on the type of node return leafpath or path element\n return leaf ? leafpath : path;\n }\n\n // Append path link element\n public addLinktoSVG(\n nodeId: number,\n parentX: number,\n parentY: number,\n childX: number,\n childY: number,\n leaf: boolean,\n rectWidth: number,\n rectHeight: number,\n gap: number,\n childXMax: number = 0,\n ) {\n this._linkElements.push(\n <path\n className={this.styleClassNames.link}\n d={this.createPathLink(parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap, childXMax)}\n key={`${nodeId}${this.styleClassNames.link}`}\n />,\n );\n }\n}\n\n// Create child class to Add Tree component based on treeHeight\nclass LayeredTree extends StandardTree {\n public composition: number | undefined;\n private _treeTraversal: number | undefined;\n constructor(\n treeData: ITreeChartDataPoint,\n composition: number | undefined,\n styleClassNames: IProcessedStyleSet<ITreeStyles>,\n _nodeElements: JSX.Element[] = [],\n _linkElements: JSX.Element[] = [],\n _treeTraversal: number | undefined,\n ) {\n super(treeData, styleClassNames, _nodeElements, _linkElements);\n this.composition = composition;\n this._treeTraversal = _treeTraversal;\n }\n public createTree(givenLayoutWidth: number | undefined, screenWidth: number) {\n givenLayoutWidth = givenLayoutWidth! < 65 ? 65 : givenLayoutWidth! > 90 ? 90 : givenLayoutWidth;\n const layoutWidth = givenLayoutWidth || 75;\n const root = hierarchy(this.treeData, d => {\n return d.children;\n });\n\n // Find tree Height\n const treeHeight = root?.height + 1;\n\n // Create tree layout, width: layoutWidth, height: layoutWidth/1.5 and add node separation\n const treeChart = tree()\n .nodeSize([layoutWidth, layoutWidth / 1.5])\n .separation((a, b) => {\n return a.parent === root && b.parent === root ? 3.5 : 1;\n });\n\n // Assigns the x and y position for the nodes\n const treeData = treeChart(root);\n\n // Compute the new tree layout.\n const nodes = treeData.descendants();\n\n // Normalize for fixed-depth and width\n // Normalise y coordinate by depth of each node by a factor of 130\n // Normalise x coordinate by start coordinate 0 with screenSize/3\n nodes.forEach(d => {\n d.y = d.depth === 0 ? 10 : d.depth * 130;\n d.x += screenWidth / 2;\n });\n\n // <------------------ Traversal section ------------------>\n\n // Create tree data structure\n const treeDataStructure: Array<ITreeDataStructure> = [];\n let TreeID: number = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const createTreeDataStructure = (d: any) => {\n d.id = TreeID;\n treeDataStructure.push({\n id: TreeID,\n children: d.children,\n dataName: d.data.name,\n subName: d.data.subname,\n bodyText: d.data.bodytext,\n metricName: d.data?.metric,\n fill: d.data.fill,\n x: d.x,\n y: d.y,\n parentID: d.parent?.id,\n });\n TreeID++;\n };\n\n this._treeTraversal === 0\n ? root.each(d => {\n createTreeDataStructure(d);\n })\n : root.eachBefore(d => {\n createTreeDataStructure(d);\n });\n\n const rectWidth = layoutWidth * 3;\n const rectHeight = rectWidth / 3.45;\n const gap: number = 20;\n const parentSet = new Set();\n\n for (const d of treeDataStructure) {\n const parentInfo =\n d.id === 0\n ? 'Root Node'\n : `Parent info parentId: ${d.parentID}\n ${treeDataStructure[d.parentID].dataName}\n ${treeDataStructure[d.parentID].subName}`;\n\n // check for leaf nodes\n if (!d.children && !parentSet.has(d.parentID) && treeHeight === 3) {\n const compactNodeWidth = (rectWidth - gap) / 2;\n const compactNodeHeight = rectHeight;\n parentSet.add(d.parentID);\n\n // <------------------ Links section ------------------>\n this.addLinktoSVG(\n d.id,\n treeDataStructure[d.parentID].x,\n treeDataStructure[d.parentID].y,\n treeDataStructure[d.id].x,\n treeDataStructure[d.id].y,\n true,\n rectWidth,\n rectHeight,\n gap,\n );\n\n // <------------------ Nodes section ------------------>\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.parentID]?.children;\n\n const compactNodeCenterX1: number = treeDataStructure[d.parentID]?.x - compactNodeWidth / 2 - gap / 2;\n const compactNodeCenterX2: number = treeDataStructure[d.parentID]?.x + compactNodeWidth / 2 + gap / 2;\n const longNodeCenterX: number = treeDataStructure[d.parentID]?.x;\n let dy: number = children[0]?.y;\n\n for (let itr = 0; itr < children.length; ++itr) {\n const child = children[itr];\n\n // Given Composition\n if (this.composition !== undefined) {\n // For compact compostion\n if (this.composition === 0) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n // If the leaf node count is 1 ,\n //irrespective of provided composition we should always use long composition\n itr % 2 === 0 ? (children.length === 1 ? longNodeCenterX : compactNodeCenterX1) : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n }\n // For long compostion\n else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n\n // Automatic Node Composition\n else {\n if (children.length > 2) {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n itr % 2 === 0 ? compactNodeCenterX1 : compactNodeCenterX2,\n dy,\n child.data.fill,\n children.length === 1 ? rectWidth : compactNodeWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n if (itr % 2 === 1) {\n dy += compactNodeHeight + gap;\n }\n } else {\n this.addNodeShapetoSVG(\n child.data.name,\n child.data.subname,\n child.data.bodytext,\n child.data.metricName,\n longNodeCenterX,\n dy,\n child.data.fill,\n rectWidth,\n rectHeight,\n child.id,\n parentInfo,\n );\n dy += compactNodeHeight + gap;\n }\n }\n }\n }\n\n if (d.children || treeHeight <= 2) {\n // <------------------ Nodes section ------------------>\n // Since the height <=2 we will be using long compositon.\n this.addNodeShapetoSVG(\n d.dataName,\n d.subName,\n d.bodyText,\n d.metricName,\n d.x,\n d.y,\n d.fill,\n rectWidth,\n rectHeight,\n d.id,\n parentInfo,\n );\n\n // <------------------ Links section ------------------>\n if (d.id === 0 && d.children) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children: any = treeDataStructure[d.id]?.children;\n const childXMin = d3Min(children, (child: ITreeDataStructure) => child.x as number)!;\n const childXMax = d3Max(children, (child: ITreeDataStructure) => child.x as number)!;\n this.addLinktoSVG(d.id, d.x, d.y, childXMin, d.children[0].y, false, rectWidth, rectHeight, gap, childXMax);\n }\n }\n }\n }\n}\n\nexport class TreeChartBase extends React.Component<ITreeProps, ITreeState> {\n private _treeData: ITreeChartDataPoint;\n private _width: number;\n private _height: number;\n private _composition: number | undefined;\n private _classNames: IProcessedStyleSet<ITreeStyles>;\n private _margin: IMargins;\n private _nodeElements: JSX.Element[] = [];\n private _linkElements: JSX.Element[] = [];\n private _treeTraversal: number | undefined;\n\n constructor(props: ITreeProps) {\n super(props);\n this._margin = {\n top: this.props.margins?.top || 30,\n bottom: this.props.margins?.bottom || 30,\n left: this.props.margins?.left || 50,\n right: this.props.margins?.right || 20,\n };\n this._width = this.props.width || 1500;\n this._height = this.props.height || 700;\n this._treeData = this.props.treeData;\n this._composition = this.props?.composition;\n this._treeTraversal = this.props.treeTraversal;\n\n this.state = {\n _width: this._width,\n _height: this._height,\n };\n }\n\n public componentDidMount() {\n const { theme, className, styles } = this.props;\n\n // Get classNames to create component styling\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n className,\n });\n\n // Call createTreeChart function in componentDidMount\n this.createTreeChart();\n\n this.setState({\n _width: this.props.width || 1500,\n _height: this.props.height || 700,\n });\n }\n\n public componentDidUpdate(prevProps: ITreeProps): void {\n if (prevProps.layoutWidth !== this.props.layoutWidth) {\n const svgText = selectAll('text');\n const svgRect = selectAll('rect');\n const svgLink = selectAll('path');\n\n if (this._nodeElements.length === 0 && this._linkElements.length === 0) {\n svgText.remove();\n svgRect.remove();\n svgLink.remove();\n }\n\n this.createTreeChart();\n }\n }\n public createTreeChart() {\n const nodeElements: JSX.Element[] = [];\n const linkElements: JSX.Element[] = [];\n\n // Instantiate inherited class and call createTree function for the object\n const treeObject = new LayeredTree(\n this._treeData,\n this._composition,\n this._classNames,\n nodeElements,\n linkElements,\n this._treeTraversal,\n );\n const width = this.state._width - this._margin.left! - this._margin.right!;\n treeObject.createTree(this.props.layoutWidth, width);\n this._nodeElements = nodeElements;\n this._linkElements = linkElements;\n }\n\n public render(): JSX.Element {\n return (\n <FocusZone>\n <div className={this._classNames?.root}>\n <svg\n className=\"svgTree\"\n width={this.state._width - this._margin.left! - this._margin.right!}\n height={this.state._height - this._margin.top! - this._margin.bottom!}\n >\n <g className=\"svgNode\">{this._nodeElements.map(element => element)}</g>\n <g className=\"svgLink\">{this._linkElements.map(element => element)}</g>\n </svg>\n </div>\n </FocusZone>\n );\n }\n}\n"]}
|
|
@@ -14,7 +14,7 @@ var NodesComposition;
|
|
|
14
14
|
* NodeComposition enum val for compact: number = 0
|
|
15
15
|
*/
|
|
16
16
|
NodesComposition[NodesComposition["compact"] = 0] = "compact";
|
|
17
|
-
})(NodesComposition
|
|
17
|
+
})(NodesComposition || (exports.NodesComposition = NodesComposition = {}));
|
|
18
18
|
/**
|
|
19
19
|
* {@docCategory TreeChart}
|
|
20
20
|
*/
|
|
@@ -28,5 +28,5 @@ var TreeTraverse;
|
|
|
28
28
|
* TreeTraverse enum val for levelOrder: number = 0
|
|
29
29
|
*/
|
|
30
30
|
TreeTraverse[TreeTraverse["levelOrder"] = 0] = "levelOrder";
|
|
31
|
-
})(TreeTraverse
|
|
31
|
+
})(TreeTraverse || (exports.TreeTraverse = TreeTraverse = {}));
|
|
32
32
|
//# sourceMappingURL=TreeChart.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeChart.types.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.types.ts"],"names":[],"mappings":";;;AAkCA;;GAEG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uDAAQ,CAAA;IACR;;OAEG;IACH,6DAAW,CAAA;AACb,CAAC,EATW,gBAAgB,
|
|
1
|
+
{"version":3,"file":"TreeChart.types.js","sourceRoot":"../src/","sources":["components/TreeChart/TreeChart.types.ts"],"names":[],"mappings":";;;AAkCA;;GAEG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uDAAQ,CAAA;IACR;;OAEG;IACH,6DAAW,CAAA;AACb,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B;AAED;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB;;OAEG;IACH,uDAAY,CAAA;IACZ;;OAEG;IACH,2DAAc,CAAA;AAChB,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB","sourcesContent":["import { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IMargins } from '../../types/index';\n\n/**\n * {@docCategory TreeChart}\n */\nexport interface ITreeChartDataPoint {\n /**\n * Node main text\n */\n name: string;\n /**\n * Subtext value (optional)\n */\n subname?: string;\n /**\n * Bodytext value (optional)\n */\n bodytext?: string;\n /**\n * Metric text value (optional)\n */\n metric?: string;\n /**\n * Color of the rectangular box\n */\n fill: string;\n /**\n * Recursive datastructure for child node object\n */\n children?: Array<ITreeChartDataPoint>;\n}\n\n/**\n * {@docCategory TreeChart}\n */\nexport enum NodesComposition {\n /**\n * NodeComposition enum val for long: number = 1\n */\n long = 1,\n /**\n * NodeComposition enum val for compact: number = 0\n */\n compact = 0,\n}\n\n/**\n * {@docCategory TreeChart}\n */\nexport enum TreeTraverse {\n /**\n * TreeTraverse enum val for preOrder: number = 1\n */\n preOrder = 1,\n /**\n * TreeTraverse enum val for levelOrder: number = 0\n */\n levelOrder = 0,\n}\n\n/**\n * Tree Chart properties\n * {@docCategory TreeChart}\n */\nexport interface ITreeProps {\n /**\n * An object of chart data points for the Tree chart\n */\n treeData: ITreeChartDataPoint;\n /**\n * compostion for three layer chart, long: composition = 1; compact: composition = 0\n */\n composition?: NodesComposition.long | NodesComposition.compact;\n /**\n * Node Width Size for the Tree Layout\n * * @default 75\n */\n layoutWidth?: number;\n /**\n * traversal order for tree chart, preOrder = 1, levelOrder = 0\n */\n treeTraversal?: TreeTraverse.preOrder | TreeTraverse.levelOrder;\n /**\n * Width of SVG tree chart\n * * @default 1500\n */\n width?: number;\n /**\n * Height of SVG tree chart\n * * @default 700\n */\n height?: number;\n\n /**\n * Margins for the chart\n * @default `{ top: 30, bottom: 30, left: 50, right: 20 }`\n * To avoid edge cuttings to the chart, we recommend you use default values or greater then default values\n */\n margins?: IMargins;\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ITreeStyleProps, ITreeStyles>;\n /**\n * Additional CSS class(es) to apply to the TreeChart.\n */\n className?: string;\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n}\n\nexport interface ITreeState {\n /**\n * Width of SVG tree chart\n * * @default 1500\n */\n _width: number;\n /**\n * Height of SVG tree chart\n * * @default 700\n */\n _height: number;\n /**\n * Layout Width of SVG tree chart\n * * @default 75\n */\n _layoutWidth?: number;\n}\n\nexport interface ITreeDataStructure {\n /**\n * Node id of each node\n */\n id: number;\n /**\n * Children node object\n */\n children: Array<ITreeDataStructure>;\n /**\n * Node main text\n */\n dataName: string;\n /**\n * Subtext value (optional)\n */\n subName?: string;\n /**\n * Bodytext value (optional)\n */\n bodyText?: string;\n /**\n * Metric text value (optional)\n */\n metricName?: string;\n /**\n * Color of the rectangular box\n */\n fill: string;\n /**\n * X-coordindate of node\n */\n x: number;\n /**\n * Y-coordindate of node\n */\n y: number;\n /**\n * Node id of each node's parent\n */\n parentID: number;\n}\n\n/**\n * Tree Chart style properties\n * {@docCategory TreeChart}\n */\nexport interface ITreeStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n /**\n * Additional CSS class(es) to apply to the TreeChart.\n */\n className?: string;\n}\n\n/**\n * Tree Chart styles\n * {@docCategory TreeChart}\n */\nexport interface ITreeStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n /**\n * Style for the Link/Path element.\n */\n link: IStyle;\n /**\n * Style for rectangular Node\n */\n rectNode: IStyle;\n /**\n * Style for the node main Text\n */\n rectText: IStyle;\n /**\n * Style for the node sub Text\n */\n rectSubText: IStyle;\n /**\n * Style for the node body Text\n */\n rectBodyText: IStyle;\n /**\n * Style for the node metric value Text\n */\n rectMetricText: IStyle;\n}\n"]}
|
|
@@ -19,7 +19,7 @@ var CircleVisbility;
|
|
|
19
19
|
})(CircleVisbility || (CircleVisbility = {}));
|
|
20
20
|
var getClassNames = (0, Utilities_1.classNamesFunction)();
|
|
21
21
|
var MIN_DOMAIN_MARGIN = 8;
|
|
22
|
-
var VerticalBarChartBase =
|
|
22
|
+
var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
23
23
|
tslib_1.__extends(VerticalBarChartBase, _super);
|
|
24
24
|
function VerticalBarChartBase(props) {
|
|
25
25
|
var _this = _super.call(this, props) || this;
|
|
@@ -44,15 +44,14 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
44
44
|
yScale, containerHeight, containerWidth,
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
46
|
yScaleSecondary) {
|
|
47
|
-
var _a
|
|
48
|
-
var _c;
|
|
47
|
+
var _a;
|
|
49
48
|
if (containerHeight === void 0) { containerHeight = 0; }
|
|
50
49
|
if (containerWidth === void 0) { containerWidth = 0; }
|
|
51
50
|
var isStringAxis = _this._xAxisType === index_2.XAxisTypes.StringAxis;
|
|
52
51
|
var xBarScale = _this._getScales(containerHeight, containerWidth).xBarScale;
|
|
53
52
|
var colorScale = _this._createColors();
|
|
54
53
|
var theme = _this.props.theme;
|
|
55
|
-
var
|
|
54
|
+
var _b = _this.props, data = _b.data, _c = _b.lineLegendColor, lineLegendColor = _c === void 0 ? theme.palette.yellow : _c, lineLegendText = _b.lineLegendText;
|
|
56
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
56
|
var lineData = [];
|
|
58
57
|
var line = [];
|
|
@@ -75,7 +74,7 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
75
74
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
75
|
.y(function (d) { return (d.useSecondaryYScale && yScaleSecondary ? yScaleSecondary(d.y) : yScale(d.y)); });
|
|
77
76
|
var shouldHighlight = _this._legendHighlighted(lineLegendText) || _this._noLegendHighlighted() ? true : false;
|
|
78
|
-
var lineBorderWidth = ((
|
|
77
|
+
var lineBorderWidth = ((_a = _this.props.lineOptions) === null || _a === void 0 ? void 0 : _a.lineBorderWidth)
|
|
79
78
|
? Number.parseFloat(_this.props.lineOptions.lineBorderWidth.toString())
|
|
80
79
|
: 0;
|
|
81
80
|
if (lineBorderWidth > 0) {
|
|
@@ -95,8 +94,7 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
95
94
|
dots));
|
|
96
95
|
};
|
|
97
96
|
_this._getCircleVisibilityAndRadius = function (xAxisPoint, legend) {
|
|
98
|
-
var _a;
|
|
99
|
-
var selectedLegend = (_a = _this.state, _a.selectedLegend), activeXdataPoint = _a.activeXdataPoint;
|
|
97
|
+
var _a = _this.state, selectedLegend = _a.selectedLegend, activeXdataPoint = _a.activeXdataPoint;
|
|
100
98
|
if (selectedLegend !== '') {
|
|
101
99
|
if (xAxisPoint === activeXdataPoint && selectedLegend === legend) {
|
|
102
100
|
return { visibility: CircleVisbility.show, radius: 8 };
|
|
@@ -125,16 +123,14 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
125
123
|
_this.margins = margins;
|
|
126
124
|
};
|
|
127
125
|
_this._renderContentForBothLineAndBars = function (point) {
|
|
128
|
-
var _a;
|
|
129
|
-
var YValueHover = (_a = _this._getCalloutContentForLineAndBar(point), _a.YValueHover), hoverXValue = _a.hoverXValue;
|
|
126
|
+
var _a = _this._getCalloutContentForLineAndBar(point), YValueHover = _a.YValueHover, hoverXValue = _a.hoverXValue;
|
|
130
127
|
var content = YValueHover.map(function (item, index) {
|
|
131
128
|
return (React.createElement(index_1.ChartHoverCard, tslib_1.__assign({ key: index, Legend: item.legend }, (index === 0 && { XValue: "".concat(hoverXValue || item.data) }), { color: item.color, YValue: item.data || item.y, culture: _this.props.culture })));
|
|
132
129
|
});
|
|
133
130
|
return React.createElement(React.Fragment, null, content);
|
|
134
131
|
};
|
|
135
132
|
_this._renderContentForOnlyBars = function (props) {
|
|
136
|
-
var _a;
|
|
137
|
-
var useSingleColor = (_a = _this.props.useSingleColor, _a === void 0 ? false : _a);
|
|
133
|
+
var _a = _this.props.useSingleColor, useSingleColor = _a === void 0 ? false : _a;
|
|
138
134
|
return (React.createElement(React.Fragment, null,
|
|
139
135
|
React.createElement(index_1.ChartHoverCard, { XValue: props.xAxisCalloutData || props.x, Legend: props.legend, YValue: props.yAxisCalloutData || props.y, color: !useSingleColor && props.color ? props.color : _this._createColors()(props.y), culture: _this.props.culture })));
|
|
140
136
|
};
|
|
@@ -164,11 +160,10 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
164
160
|
_this._refArray.push({ index: legendTitle, refElement: element });
|
|
165
161
|
};
|
|
166
162
|
_this._getCalloutContentForLineAndBar = function (point) {
|
|
167
|
-
var _a, _b, _c, _d;
|
|
168
|
-
var _e, _f, _g, _h, _j;
|
|
163
|
+
var _a, _b, _c, _d, _e;
|
|
169
164
|
var YValueHover = [];
|
|
170
|
-
var
|
|
171
|
-
var
|
|
165
|
+
var _f = _this.props, theme = _f.theme, _g = _f.useSingleColor, useSingleColor = _g === void 0 ? false : _g, enableGradient = _f.enableGradient;
|
|
166
|
+
var _h = _this.props, data = _h.data, lineLegendText = _h.lineLegendText, _j = _h.lineLegendColor, lineLegendColor = _j === void 0 ? theme.palette.yellow : _j;
|
|
172
167
|
var selectedPoint = data.filter(function (xDataPoint) { return xDataPoint.x === point.x; });
|
|
173
168
|
var pointIndex = data.indexOf(selectedPoint[0]);
|
|
174
169
|
var calloutColor = !useSingleColor
|
|
@@ -177,14 +172,14 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
177
172
|
: _this._createColors()(selectedPoint[0].y)
|
|
178
173
|
: _this._createColors()(1);
|
|
179
174
|
// there might be no y value of the line for the hovered bar. so we need to check this condition
|
|
180
|
-
if (_this._isHavingLine && ((
|
|
175
|
+
if (_this._isHavingLine && ((_a = selectedPoint[0].lineData) === null || _a === void 0 ? void 0 : _a.y) !== undefined) {
|
|
181
176
|
// callout data for the line
|
|
182
177
|
YValueHover.push({
|
|
183
178
|
legend: lineLegendText,
|
|
184
179
|
color: lineLegendColor,
|
|
185
|
-
y: (
|
|
186
|
-
data: (
|
|
187
|
-
yAxisCalloutData: (
|
|
180
|
+
y: (_b = selectedPoint[0].lineData) === null || _b === void 0 ? void 0 : _b.y,
|
|
181
|
+
data: (_c = selectedPoint[0].lineData) === null || _c === void 0 ? void 0 : _c.yAxisCalloutData,
|
|
182
|
+
yAxisCalloutData: (_d = selectedPoint[0].lineData) === null || _d === void 0 ? void 0 : _d.yAxisCalloutData,
|
|
188
183
|
});
|
|
189
184
|
}
|
|
190
185
|
// callout data for the bar
|
|
@@ -194,7 +189,7 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
194
189
|
color: enableGradient
|
|
195
190
|
? useSingleColor
|
|
196
191
|
? (0, index_2.getNextGradient)(0, 0)[0]
|
|
197
|
-
: ((
|
|
192
|
+
: ((_e = selectedPoint[0].gradient) === null || _e === void 0 ? void 0 : _e[0]) || (0, index_2.getNextGradient)(pointIndex, 0)[0]
|
|
198
193
|
: calloutColor,
|
|
199
194
|
data: selectedPoint[0].yAxisCalloutData,
|
|
200
195
|
yAxisCalloutData: selectedPoint[0].yAxisCalloutData,
|
|
@@ -218,8 +213,7 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
218
213
|
});
|
|
219
214
|
};
|
|
220
215
|
_this._onBarFocus = function (point, refArrayIndexNumber, color) {
|
|
221
|
-
var _a;
|
|
222
|
-
var YValueHover = (_a = _this._getCalloutContentForLineAndBar(point), _a.YValueHover), hoverXValue = _a.hoverXValue;
|
|
216
|
+
var _a = _this._getCalloutContentForLineAndBar(point), YValueHover = _a.YValueHover, hoverXValue = _a.hoverXValue;
|
|
223
217
|
_this._refArray.forEach(function (obj, index) {
|
|
224
218
|
if (obj.index === point.legend && refArrayIndexNumber === index) {
|
|
225
219
|
_this.setState({
|
|
@@ -251,9 +245,8 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
251
245
|
}
|
|
252
246
|
};
|
|
253
247
|
_this._lineHoverFocus = function (point, refSelected) {
|
|
254
|
-
var _a, _b, _c;
|
|
255
248
|
var theme = _this.props.theme;
|
|
256
|
-
var
|
|
249
|
+
var _a = _this.props, _b = _a.lineLegendText, lineLegendText = _b === void 0 ? '' : _b, _c = _a.lineLegendColor, lineLegendColor = _c === void 0 ? theme.palette.yellow : _c;
|
|
257
250
|
_this.setState({
|
|
258
251
|
refSelected: refSelected,
|
|
259
252
|
isCalloutVisible: true,
|
|
@@ -309,9 +302,8 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
309
302
|
});
|
|
310
303
|
};
|
|
311
304
|
_this._getLegendData = function (data, palette) {
|
|
312
|
-
var _a,
|
|
313
|
-
var
|
|
314
|
-
var lineLegendText = (_b = _this.props, _b.lineLegendText), lineLegendColor = (_c = _b.lineLegendColor, _c === void 0 ? theme.palette.yellow : _c);
|
|
305
|
+
var _a = _this.props, theme = _a.theme, useSingleColor = _a.useSingleColor;
|
|
306
|
+
var _b = _this.props, lineLegendText = _b.lineLegendText, _c = _b.lineLegendColor, lineLegendColor = _c === void 0 ? theme.palette.yellow : _c;
|
|
315
307
|
var actions = [];
|
|
316
308
|
data.forEach(function (point, _index) {
|
|
317
309
|
var _a, _b, _c;
|
|
@@ -433,8 +425,7 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
433
425
|
return tslib_1.__assign(tslib_1.__assign({}, _this.margins), { left: _this.margins.left + _this._domainMargin, right: _this.margins.right + _this._domainMargin });
|
|
434
426
|
};
|
|
435
427
|
_this._getChartTitle = function () {
|
|
436
|
-
var _a;
|
|
437
|
-
var chartTitle = (_a = _this.props, _a.chartTitle), data = _a.data;
|
|
428
|
+
var _a = _this.props, chartTitle = _a.chartTitle, data = _a.data;
|
|
438
429
|
return ((chartTitle ? "".concat(chartTitle, ". ") : '') +
|
|
439
430
|
"Vertical bar chart with ".concat((data === null || data === void 0 ? void 0 : data.length) || 0, " bars") +
|
|
440
431
|
(_this._isHavingLine ? ' and 1 line' : '') +
|
|
@@ -505,14 +496,12 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
505
496
|
this._xAxisOuterPadding = (0, index_2.getScalePadding)(this.props.xAxisOuterPadding, this.props.xAxisPadding, 0);
|
|
506
497
|
};
|
|
507
498
|
VerticalBarChartBase.prototype._createColors = function () {
|
|
508
|
-
var _a;
|
|
509
499
|
var _this = this;
|
|
510
500
|
var increment = this._colors.length <= 1 ? 1 : 1 / (this._colors.length - 1);
|
|
511
|
-
var
|
|
501
|
+
var _a = this.props.useSingleColor, useSingleColor = _a === void 0 ? false : _a;
|
|
512
502
|
if (useSingleColor) {
|
|
513
503
|
return function (_p) {
|
|
514
|
-
var _a;
|
|
515
|
-
var theme = (_a = _this.props, _a.theme), colors = _a.colors;
|
|
504
|
+
var _a = _this.props, theme = _a.theme, colors = _a.colors;
|
|
516
505
|
return colors && colors.length > 0 ? colors[0] : theme.palette.blueLight;
|
|
517
506
|
};
|
|
518
507
|
}
|
|
@@ -524,9 +513,8 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
524
513
|
return colorScale;
|
|
525
514
|
};
|
|
526
515
|
VerticalBarChartBase.prototype._onBarHover = function (point, color, mouseEvent) {
|
|
527
|
-
var _a;
|
|
528
516
|
mouseEvent.persist();
|
|
529
|
-
var
|
|
517
|
+
var _a = this._getCalloutContentForLineAndBar(point), YValueHover = _a.YValueHover, hoverXValue = _a.hoverXValue;
|
|
530
518
|
if (this._calloutAnchorPoint !== point) {
|
|
531
519
|
this._calloutAnchorPoint = point;
|
|
532
520
|
this.setState({
|
|
@@ -550,10 +538,9 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
550
538
|
}
|
|
551
539
|
};
|
|
552
540
|
VerticalBarChartBase.prototype._createNumericBars = function (containerHeight, containerWidth, xElement) {
|
|
553
|
-
var _a, _b;
|
|
554
541
|
var _this = this;
|
|
555
|
-
var
|
|
556
|
-
var
|
|
542
|
+
var _a = this.props.useSingleColor, useSingleColor = _a === void 0 ? false : _a;
|
|
543
|
+
var _b = this._getScales(containerHeight, containerWidth), xBarScale = _b.xBarScale, yBarScale = _b.yBarScale;
|
|
557
544
|
var colorScale = this._createColors();
|
|
558
545
|
var bars = this._points.map(function (point, index) {
|
|
559
546
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -624,10 +611,9 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
624
611
|
return bars;
|
|
625
612
|
};
|
|
626
613
|
VerticalBarChartBase.prototype._createStringBars = function (containerHeight, containerWidth, xElement) {
|
|
627
|
-
var _a, _b;
|
|
628
614
|
var _this = this;
|
|
629
|
-
var
|
|
630
|
-
var
|
|
615
|
+
var _a = this.props.useSingleColor, useSingleColor = _a === void 0 ? false : _a;
|
|
616
|
+
var _b = this._getScales(containerHeight, containerWidth), xBarScale = _b.xBarScale, yBarScale = _b.yBarScale;
|
|
631
617
|
var colorScale = this._createColors();
|
|
632
618
|
var bars = this._points.map(function (point, index) {
|
|
633
619
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -696,10 +682,9 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
696
682
|
return bars;
|
|
697
683
|
};
|
|
698
684
|
VerticalBarChartBase.prototype._createDateBars = function (containerHeight, containerWidth, xElement) {
|
|
699
|
-
var _a, _b;
|
|
700
685
|
var _this = this;
|
|
701
|
-
var
|
|
702
|
-
var
|
|
686
|
+
var _a = this.props.useSingleColor, useSingleColor = _a === void 0 ? false : _a;
|
|
687
|
+
var _b = this._getScales(containerHeight, containerWidth), xBarScale = _b.xBarScale, yBarScale = _b.yBarScale;
|
|
703
688
|
var colorScale = this._createColors();
|
|
704
689
|
var bars = this._points.map(function (point, index) {
|
|
705
690
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -809,4 +794,5 @@ var VerticalBarChartBase = exports.VerticalBarChartBase = /** @class */ (functio
|
|
|
809
794
|
};
|
|
810
795
|
return VerticalBarChartBase;
|
|
811
796
|
}(React.Component));
|
|
797
|
+
exports.VerticalBarChartBase = VerticalBarChartBase;
|
|
812
798
|
//# sourceMappingURL=VerticalBarChart.base.js.map
|