@fluentui/react-charts 0.0.0-nightly-20260109-0406.1 → 0.0.0-nightly-20260113-0406.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.
- package/CHANGELOG.md +13 -13
- package/dist/index.d.ts +361 -0
- package/lib/PolarChart.js +1 -0
- package/lib/PolarChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +21 -7
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +24 -3
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +7 -5
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +47 -3
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +24 -17
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +5 -3
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +33 -29
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +250 -153
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +12 -4
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +25 -5
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +16 -5
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +27 -5
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +26 -4
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +5 -5
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +8 -5
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -5
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +4 -1
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +576 -0
- package/lib/components/PolarChart/PolarChart.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.types.js +1 -0
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.utils.js +174 -0
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib/components/PolarChart/index.js +2 -0
- package/lib/components/PolarChart/index.js.map +1 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.js +72 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js +61 -0
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.js +13 -3
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +23 -6
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +15 -5
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +25 -36
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/ChartTitle.js +33 -0
- package/lib/utilities/ChartTitle.js.map +1 -0
- package/lib/utilities/Common.styles.js +73 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +70 -0
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.js +2 -2
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/PolarChart.js +6 -0
- package/lib-commonjs/PolarChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +21 -7
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +34 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +14 -2
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +7 -5
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +58 -4
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +24 -17
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +4 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +59 -56
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +256 -156
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +11 -3
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +31 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +15 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +26 -4
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +36 -4
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +15 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +4 -4
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +10 -4
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -5
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +4 -1
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.js +586 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +6 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +204 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-commonjs/components/PolarChart/index.js +7 -0
- package/lib-commonjs/components/PolarChart/index.js.map +1 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js +107 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js +75 -0
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +13 -3
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +28 -4
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +14 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +25 -36
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.js +41 -0
- package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.js +69 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +69 -0
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +6 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SankeyChart/useSankeyChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SankeyChartProps, SankeyChartStyles } from './SankeyChart.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector
|
|
1
|
+
{"version":3,"sources":["../src/components/SankeyChart/useSankeyChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SankeyChartProps, SankeyChartStyles } from './SankeyChart.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector, getTooltipStyle, getChartTitleStyles } from '../../utilities/index';\n\nexport const sankeyChartClassNames: SlotClassNames<SankeyChartStyles> = {\n root: 'fui-sc__root',\n nodes: 'fui-sc__nodes',\n links: 'fui-sc__links',\n nodeTextContainer: 'fui-sc__nodeTextContainer',\n toolTip: 'fui-sc__toolTip',\n chartWrapper: 'fui-sc__chartWrapper',\n chart: 'fui-sc__chart',\n chartTitle: 'fui-sc__chartTitle',\n svgTooltip: 'fui-sc__svgTooltip',\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n textAlign: 'left',\n },\n links: {\n fill: tokens.colorNeutralBackground1,\n strokeWidth: '3px',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n nodes: {\n fill: '#F5F5F5',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n toolTip: getTooltipStyle() as GriffelStyle,\n nodeTextContainer: {\n '& text': {\n [HighContrastSelector]: {\n fill: 'CanvasText',\n },\n },\n\n marginTop: '4px',\n marginLeft: '8px',\n marginBottom: '4px',\n marginRight: '8px',\n },\n chartWrapper: {\n overflow: 'auto',\n },\n chart: {\n display: 'block',\n },\n chartTitle: getChartTitleStyles() as GriffelStyle,\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n});\n\nexport const useSankeyChartStyles = (props: SankeyChartProps): SankeyChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(sankeyChartClassNames.root, baseStyles.root, props.styles?.root),\n nodes: mergeClasses(sankeyChartClassNames.nodes, baseStyles.nodes /*, props.styles?.nodes*/),\n links: mergeClasses(sankeyChartClassNames.links, baseStyles.links /*, props.styles?.links*/),\n nodeTextContainer: mergeClasses(\n sankeyChartClassNames.nodeTextContainer,\n baseStyles.nodeTextContainer /*, props.styles?.nodeTextContainer*/,\n ),\n toolTip: mergeClasses(sankeyChartClassNames.toolTip, baseStyles.toolTip /*, props.styles?.toolTip*/),\n chartWrapper: mergeClasses(\n sankeyChartClassNames.chartWrapper,\n props.reflowProps?.mode === 'min-width' ? baseStyles.chartWrapper : '',\n props.styles?.chartWrapper,\n ),\n chart: mergeClasses(sankeyChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n chartTitle: mergeClasses(sankeyChartClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n svgTooltip: mergeClasses(sankeyChartClassNames.svgTooltip, baseStyles.svgTooltip, props.styles?.svgTooltip),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","HighContrastSelector","getTooltipStyle","getChartTitleStyles","sankeyChartClassNames","root","nodes","links","nodeTextContainer","toolTip","chartWrapper","chart","chartTitle","svgTooltip","useStyles","body1","display","width","height","flexDirection","overflow","textAlign","fill","colorNeutralBackground1","strokeWidth","marginTop","marginLeft","marginBottom","marginRight","useSankeyChartStyles","props","baseStyles","styles","reflowProps","mode"],"mappings":"AAAA;AAEA,SAAuBA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAGxE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,mBAAmB,QAAQ,wBAAwB;AAEnG,OAAO,MAAMC,wBAA2D;IACtEC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,mBAAmB;IACnBC,SAAS;IACTC,cAAc;IACdC,OAAO;IACPC,YAAY;IACZC,YAAY;AACd,EAAE;AACF,MAAMC,YAAYjB,WAAW;IAC3BQ,MAAM;QACJ,GAAGL,iBAAiBe,KAAK;QACzBC,SAAS;QACTC,OAAO;QACPC,QAAQ;QACRC,eAAe;QACfC,UAAU;QACVC,WAAW;IACb;IACAd,OAAO;QACLe,MAAMvB,OAAOwB,uBAAuB;QACpCC,aAAa;QACb,CAACvB,qBAAqB,EAAE;YACtBqB,MAAM;QACR;IACF;IACAhB,OAAO;QACLgB,MAAM;QACN,CAACrB,qBAAqB,EAAE;YACtBqB,MAAM;QACR;IACF;IACAb,SAASP;IACTM,mBAAmB;QACjB,UAAU;YACR,CAACP,qBAAqB,EAAE;gBACtBqB,MAAM;YACR;QACF;QAEAG,WAAW;QACXC,YAAY;QACZC,cAAc;QACdC,aAAa;IACf;IACAlB,cAAc;QACZU,UAAU;IACZ;IACAT,OAAO;QACLK,SAAS;IACX;IACAJ,YAAYT;IACZU,YAAY;QACVS,MAAMvB,OAAOwB,uBAAuB;QACpC,CAACtB,qBAAqB,EAAE;YACtBqB,MAAM;QACR;IACF;AACF;AAEA,OAAO,MAAMO,uBAAuB,CAACC;QAI+BA,eAU9DA,oBACAA,gBAEiEA,gBACeA,gBACAA;IAlBpF,MAAMC,aAAajB;IAEnB,OAAO;QACLT,MAAMP,aAAaM,sBAAsBC,IAAI,EAAE0B,WAAW1B,IAAI,GAAEyB,gBAAAA,MAAME,MAAM,cAAZF,oCAAAA,cAAczB,IAAI;QAClFC,OAAOR,aAAaM,sBAAsBE,KAAK,EAAEyB,WAAWzB,KAAK,CAAC,uBAAuB;QACzFC,OAAOT,aAAaM,sBAAsBG,KAAK,EAAEwB,WAAWxB,KAAK,CAAC,uBAAuB;QACzFC,mBAAmBV,aACjBM,sBAAsBI,iBAAiB,EACvCuB,WAAWvB,iBAAiB,CAAC,mCAAmC;QAElEC,SAASX,aAAaM,sBAAsBK,OAAO,EAAEsB,WAAWtB,OAAO,CAAC,yBAAyB;QACjGC,cAAcZ,aACZM,sBAAsBM,YAAY,EAClCoB,EAAAA,qBAAAA,MAAMG,WAAW,cAAjBH,yCAAAA,mBAAmBI,IAAI,MAAK,cAAcH,WAAWrB,YAAY,GAAG,KACpEoB,iBAAAA,MAAME,MAAM,cAAZF,qCAAAA,eAAcpB,YAAY;QAE5BC,OAAOb,aAAaM,sBAAsBO,KAAK,EAAEoB,WAAWpB,KAAK,GAAEmB,iBAAAA,MAAME,MAAM,cAAZF,qCAAAA,eAAcnB,KAAK;QACtFC,YAAYd,aAAaM,sBAAsBQ,UAAU,EAAEmB,WAAWnB,UAAU,GAAEkB,iBAAAA,MAAME,MAAM,cAAZF,qCAAAA,eAAclB,UAAU;QAC1GC,YAAYf,aAAaM,sBAAsBS,UAAU,EAAEkB,WAAWlB,UAAU,GAAEiB,iBAAAA,MAAME,MAAM,cAAZF,qCAAAA,eAAcjB,UAAU;IAC5G;AACF,EAAE"}
|
|
@@ -5,6 +5,7 @@ import { useVerticalStackedBarChartStyles } from './useVerticalStackedBarChartSt
|
|
|
5
5
|
import { scaleLinear as d3ScaleLinear, scaleBand as d3ScaleBand, scaleUtc as d3ScaleUtc, scaleTime as d3ScaleTime } from 'd3-scale';
|
|
6
6
|
import { useId } from '@fluentui/react-utilities';
|
|
7
7
|
import { tokens } from '@fluentui/react-theme';
|
|
8
|
+
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
8
9
|
import { CartesianChart, ChartPopover, Legends } from '../../index';
|
|
9
10
|
import { ChartTypes, getAccessibleDataObject, XAxisTypes, getTypeOfAxis, formatScientificLimitWidth, getBarWidth, getScalePadding, isScalePaddingDefined, calculateAppropriateBarWidth, areArraysEqual, calculateLongestLabelWidth, useRtl, DataVizPalette, getColorFromToken, findVSBCNumericMinMaxOfY, YAxisType, createNumericYAxis, domainRangeOfDateForAreaLineScatterVerticalBarCharts, domainRangeOfVSBCNumeric, domainRangeOfXStringAxis, createStringYAxis, calcTotalWidth, calcBandwidth, calcRequiredWidth, sortAxisCategories } from '../../utilities/index';
|
|
10
11
|
import { formatDateToLocaleString, isInvalidValue } from '@fluentui/chart-utilities';
|
|
@@ -23,6 +24,10 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
23
24
|
const _isRtl = useRtl();
|
|
24
25
|
const _createLegendsForLine = (data)=>_getLineLegends(data);
|
|
25
26
|
const _emptyChartId = useId('_VSBC_empty');
|
|
27
|
+
const _arrowNavigationAttributes = useArrowNavigationGroup({
|
|
28
|
+
axis: 'vertical',
|
|
29
|
+
circular: true
|
|
30
|
+
});
|
|
26
31
|
let _points = [];
|
|
27
32
|
let _dataset;
|
|
28
33
|
let _xAxisLabels = [];
|
|
@@ -152,17 +157,14 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
152
157
|
clientX = boundingRect.left + boundingRect.width / 2;
|
|
153
158
|
clientY = boundingRect.top + boundingRect.height / 2;
|
|
154
159
|
}
|
|
155
|
-
if (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
} else {
|
|
165
|
-
_onStackHoverFocus(lineData.xItem, event);
|
|
160
|
+
if (_noLegendHighlighted() || _isLegendHighlighted(lineData.legend)) {
|
|
161
|
+
_updatePosition(clientX, clientY);
|
|
162
|
+
setPopoverOpen(true);
|
|
163
|
+
setXCalloutValue(`${lineData.xItem.xAxisPoint}`);
|
|
164
|
+
setYCalloutValue(`${lineData.yAxisCalloutData || lineData.data || lineData.y}`);
|
|
165
|
+
setCalloutLegend(lineData.legend);
|
|
166
|
+
setActiveXAxisDataPoint(lineData.xItem.xAxisPoint);
|
|
167
|
+
setColor(lineData.color);
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
function _onStackHoverFocus(stack, event) {
|
|
@@ -326,19 +328,9 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
326
328
|
const _isHavingLines = props.data.some((item)=>item.lineData && item.lineData.length > 0);
|
|
327
329
|
return props.onRenderCalloutPerStack ? props.onRenderCalloutPerStack(stackCalloutProps) : props.onRenderCalloutPerDataPoint && !_isHavingLines ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout) : null;
|
|
328
330
|
}
|
|
329
|
-
function _toFocusWholeStack(
|
|
331
|
+
function _toFocusWholeStack() {
|
|
330
332
|
const { isCalloutForStack = false } = props;
|
|
331
|
-
|
|
332
|
-
if (_isHavingLines) {
|
|
333
|
-
if (_getHighlightedLegend().length === 1) {
|
|
334
|
-
shouldFocusStackOnly = false;
|
|
335
|
-
} else {
|
|
336
|
-
shouldFocusStackOnly = true;
|
|
337
|
-
}
|
|
338
|
-
} else {
|
|
339
|
-
shouldFocusStackOnly = isCalloutForStack;
|
|
340
|
-
}
|
|
341
|
-
return shouldFocusStackOnly;
|
|
333
|
+
return isCalloutForStack;
|
|
342
334
|
}
|
|
343
335
|
function _getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues) {
|
|
344
336
|
let domainNRangeValue;
|
|
@@ -444,8 +436,8 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
444
436
|
const circleRef = {
|
|
445
437
|
refElement: null
|
|
446
438
|
};
|
|
447
|
-
const noBarsAndLinesActive = circlePoint.xItem.chartData.filter((dataPoint)=>_noLegendHighlighted() || _isLegendHighlighted(dataPoint.legend)).length === 0;
|
|
448
439
|
const yScaleBandwidthTranslate = !circlePoint.useSecondaryYScale && _yAxisType === YAxisType.StringAxis ? yScalePrimary.bandwidth() / 2 : 0;
|
|
440
|
+
const shouldHighlight = _isLegendHighlighted(circlePoint.legend) || _noLegendHighlighted() ? true : false;
|
|
449
441
|
dots.push(/*#__PURE__*/ React.createElement("circle", {
|
|
450
442
|
key: `${index}-${subIndex}-dot`,
|
|
451
443
|
cx: xScale(circlePoint.xItem.xAxisPoint),
|
|
@@ -463,13 +455,11 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
463
455
|
ref: (e)=>{
|
|
464
456
|
circleRef.refElement = e;
|
|
465
457
|
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
'aria-label': _getAriaLabel(circlePoint.xItem, circlePoint)
|
|
472
|
-
} : {}
|
|
458
|
+
tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined,
|
|
459
|
+
onFocus: (event)=>_lineFocus(event, circlePoint, circleRef),
|
|
460
|
+
onBlur: _handleMouseOut,
|
|
461
|
+
role: "img",
|
|
462
|
+
"aria-label": _getAriaLabel(circlePoint.xItem, circlePoint, true)
|
|
473
463
|
}));
|
|
474
464
|
});
|
|
475
465
|
});
|
|
@@ -736,8 +726,7 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
736
726
|
const classes = useVerticalStackedBarChartStyles(props);
|
|
737
727
|
function _createBar(xBarScale, yBarScale, containerHeight, xElement) {
|
|
738
728
|
const { barCornerRadius = 0, barMinimumHeight = 0 } = props;
|
|
739
|
-
const
|
|
740
|
-
const shouldFocusWholeStack = _toFocusWholeStack(_isHavingLines);
|
|
729
|
+
const shouldFocusWholeStack = _toFocusWholeStack();
|
|
741
730
|
if (_xAxisType === XAxisTypes.StringAxis) {
|
|
742
731
|
_barWidth = getBarWidth(props.barWidth, props.maxBarWidth, xBarScale.bandwidth());
|
|
743
732
|
}
|
|
@@ -1010,7 +999,7 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
1010
999
|
if (!_isChartEmpty()) {
|
|
1011
1000
|
_adjustProps();
|
|
1012
1001
|
const _isHavingLines = props.data.some((item)=>item.lineData && item.lineData.length > 0);
|
|
1013
|
-
const shouldFocusWholeStack = _toFocusWholeStack(
|
|
1002
|
+
const shouldFocusWholeStack = _toFocusWholeStack();
|
|
1014
1003
|
_dataset = _createDataSetLayer();
|
|
1015
1004
|
const legendBars = _getLegendData(_points, _createLegendsForLine(props.data));
|
|
1016
1005
|
const calloutProps = {
|
|
@@ -1024,7 +1013,7 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
1024
1013
|
...getAccessibleDataObject(callOutAccessibilityData),
|
|
1025
1014
|
clickPosition: clickPosition,
|
|
1026
1015
|
isPopoverOpen: isPopoverOpen,
|
|
1027
|
-
isCalloutForStack:
|
|
1016
|
+
isCalloutForStack: shouldFocusWholeStack,
|
|
1028
1017
|
isCartesian: true,
|
|
1029
1018
|
customCallout: {
|
|
1030
1019
|
customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout() : undefined,
|
|
@@ -1069,7 +1058,7 @@ export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
1069
1058
|
],
|
|
1070
1059
|
getYDomainMargins: _getYDomainMargins,
|
|
1071
1060
|
/* eslint-disable react/jsx-no-bind */ children: (props)=>{
|
|
1072
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("g",
|
|
1061
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("g", _arrowNavigationAttributes, _bars), /*#__PURE__*/ React.createElement("g", null, _isHavingLines && _createLines(props.xScale, props.yScalePrimary, props.containerHeight, props.containerWidth, props.yScaleSecondary)));
|
|
1073
1062
|
}
|
|
1074
1063
|
});
|
|
1075
1064
|
}
|