@fluentui/react-charting 5.25.5 → 5.25.7
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 +87 -1
- package/CHANGELOG.md +28 -2
- package/bundle-size/PolarChart.fixture.js +7 -0
- package/dist/react-charting.d.ts +388 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +85 -1
- package/lib/PolarChart.d.ts +1 -0
- package/lib/PolarChart.js +2 -0
- package/lib/PolarChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib/components/AreaChart/AreaChart.base.js +2 -31
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +12 -4
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.styles.js +3 -0
- package/lib/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +82 -42
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js +31 -27
- package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +24 -28
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +202 -217
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib/components/DonutChart/DonutChart.base.js +16 -4
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.styles.js +3 -1
- package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +14 -8
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.styles.js +3 -0
- package/lib/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.js +2 -2
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.styles.js +16 -22
- package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +2 -18
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib/components/LineChart/LineChart.base.js +1 -25
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib/components/PolarChart/PolarChart.base.js +426 -0
- package/lib/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib/components/PolarChart/PolarChart.js +9 -0
- package/lib/components/PolarChart/PolarChart.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib/components/PolarChart/PolarChart.styles.js +39 -0
- package/lib/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib/components/PolarChart/PolarChart.types.js +2 -0
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib/components/PolarChart/PolarChart.utils.js +180 -0
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib/components/PolarChart/index.d.ts +2 -0
- package/lib/components/PolarChart/index.js +3 -0
- package/lib/components/PolarChart/index.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.base.js +9 -2
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +1 -28
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +1 -73
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -26
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +88 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/ChartTitle.d.ts +55 -0
- package/lib/utilities/ChartTitle.js +45 -0
- package/lib/utilities/ChartTitle.js.map +1 -0
- package/lib/utilities/Common.styles.d.ts +51 -0
- package/lib/utilities/Common.styles.js +70 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/image-export-utils.js +4 -4
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.d.ts +1 -0
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.d.ts +28 -6
- package/lib/utilities/utilities.js +210 -104
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/PolarChart.d.ts +1 -0
- package/lib-amd/PolarChart.js +6 -0
- package/lib-amd/PolarChart.js.map +1 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +1 -29
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +12 -5
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.styles.js +3 -1
- package/lib-amd/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +81 -41
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js +30 -26
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +22 -28
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -219
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-amd/components/DonutChart/DonutChart.base.js +15 -3
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -0
- package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +14 -9
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js +3 -1
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib-amd/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js +16 -23
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +0 -16
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-amd/components/LineChart/LineChart.base.js +0 -24
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib-amd/components/PolarChart/PolarChart.base.js +421 -0
- package/lib-amd/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib-amd/components/PolarChart/PolarChart.js +11 -0
- package/lib-amd/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.js +43 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib-amd/components/PolarChart/PolarChart.types.js +5 -0
- package/lib-amd/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.js +183 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-amd/components/PolarChart/index.d.ts +2 -0
- package/lib-amd/components/PolarChart/index.js +7 -0
- package/lib-amd/components/PolarChart/index.js.map +1 -0
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +9 -3
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +0 -27
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +1 -72
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -25
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/index.d.ts +2 -0
- package/lib-amd/index.js +3 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +88 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/ChartTitle.d.ts +55 -0
- package/lib-amd/utilities/ChartTitle.js +46 -0
- package/lib-amd/utilities/ChartTitle.js.map +1 -0
- package/lib-amd/utilities/Common.styles.d.ts +51 -0
- package/lib-amd/utilities/Common.styles.js +74 -2
- package/lib-amd/utilities/Common.styles.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +3 -3
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/index.d.ts +1 -0
- package/lib-amd/utilities/index.js +2 -1
- package/lib-amd/utilities/index.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +28 -6
- package/lib-amd/utilities/utilities.js +217 -107
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/PolarChart.d.ts +1 -0
- package/lib-commonjs/PolarChart.js +5 -0
- package/lib-commonjs/PolarChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +0 -29
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +12 -4
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.styles.js +3 -0
- package/lib-commonjs/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +81 -41
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +30 -26
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +23 -27
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -219
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +15 -3
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -0
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +14 -8
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js +3 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +16 -22
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +0 -16
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +0 -24
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib-commonjs/components/PolarChart/PolarChart.base.js +429 -0
- package/lib-commonjs/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js +12 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.js +43 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +3 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +188 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-commonjs/components/PolarChart/index.d.ts +2 -0
- package/lib-commonjs/components/PolarChart/index.js +6 -0
- package/lib-commonjs/components/PolarChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +9 -2
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +0 -27
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +0 -72
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +0 -25
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -0
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +88 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.d.ts +55 -0
- package/lib-commonjs/utilities/ChartTitle.js +49 -0
- package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.d.ts +51 -0
- package/lib-commonjs/utilities/Common.styles.js +74 -2
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +3 -3
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/index.d.ts +1 -0
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +28 -6
- package/lib-commonjs/utilities/utilities.js +217 -107
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -12
- package/project.json +0 -1
- package/src/components/ChartTable/ChartTable.types.ts +13 -0
- package/src/components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts +5 -0
- package/src/components/CommonComponents/CartesianChart.types.ts +17 -1
- package/src/components/DonutChart/DonutChart.types.ts +16 -0
- package/src/components/FunnelChart/FunnelChart.types.ts +16 -0
- package/src/components/GaugeChart/GaugeChart.types.ts +11 -0
- package/src/components/PolarChart/PolarChart.types.ts +232 -0
- package/src/components/SankeyChart/SankeyChart.types.ts +22 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IAreaPolarSeries, AxisCategoryOrder, AxisProps, AxisScaleType, IChart, ILinePolarSeries, IMargins, IScatterPolarSeries } from '../../types/IDataPoint';
|
|
3
|
+
import { ILegendsProps } from '../Legends/Legends.types';
|
|
4
|
+
import { ICalloutProps, IStyle, IStyleFunctionOrObject, ITheme } from '@fluentui/react';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for a polar axis.
|
|
7
|
+
* {@docCategory PolarChart}
|
|
8
|
+
*/
|
|
9
|
+
export type PolarAxisProps = AxisProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Values at which ticks should be placed on the axis.
|
|
12
|
+
*/
|
|
13
|
+
tickValues?: number[] | Date[] | string[];
|
|
14
|
+
/**
|
|
15
|
+
* Format string for the axis ticks.
|
|
16
|
+
* For numbers, see: https://d3js.org/d3-format.
|
|
17
|
+
* And for dates see: https://d3js.org/d3-time-format.
|
|
18
|
+
*/
|
|
19
|
+
tickFormat?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Number of ticks to display on the axis.
|
|
22
|
+
*/
|
|
23
|
+
tickCount?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the order of categories on the axis.
|
|
26
|
+
* @default 'default'
|
|
27
|
+
*/
|
|
28
|
+
categoryOrder?: AxisCategoryOrder;
|
|
29
|
+
/**
|
|
30
|
+
* Scale type for the axis.
|
|
31
|
+
* @default 'default'
|
|
32
|
+
*/
|
|
33
|
+
scaleType?: AxisScaleType;
|
|
34
|
+
/**
|
|
35
|
+
* Start value of the axis range.
|
|
36
|
+
*/
|
|
37
|
+
rangeStart?: number | Date;
|
|
38
|
+
/**
|
|
39
|
+
* End value of the axis range.
|
|
40
|
+
*/
|
|
41
|
+
rangeEnd?: number | Date;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Polar Chart properties
|
|
45
|
+
* {@docCategory PolarChart}
|
|
46
|
+
*/
|
|
47
|
+
export interface IPolarChartProps {
|
|
48
|
+
/**
|
|
49
|
+
* Data series to be rendered in the polar chart.
|
|
50
|
+
*/
|
|
51
|
+
data: (IAreaPolarSeries | ILinePolarSeries | IScatterPolarSeries)[];
|
|
52
|
+
/**
|
|
53
|
+
* Width of the polar chart.
|
|
54
|
+
* @default 200
|
|
55
|
+
*/
|
|
56
|
+
width?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Height of the polar chart.
|
|
59
|
+
* @default 200
|
|
60
|
+
*/
|
|
61
|
+
height?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Margins around the chart area.
|
|
64
|
+
*/
|
|
65
|
+
margins?: IMargins;
|
|
66
|
+
/**
|
|
67
|
+
* If true, hides the legend.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
hideLegend?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* If true, hides the tooltip.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
hideTooltip?: boolean;
|
|
76
|
+
legendProps?: Partial<ILegendsProps>;
|
|
77
|
+
/**
|
|
78
|
+
* Title of the chart.
|
|
79
|
+
*/
|
|
80
|
+
chartTitle?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Fraction of the radius to cut out from the center of the chart.
|
|
83
|
+
* Accepts values in the range [0, 1].
|
|
84
|
+
*/
|
|
85
|
+
hole?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Shape of the polar chart.
|
|
88
|
+
* @default 'circle'
|
|
89
|
+
*/
|
|
90
|
+
shape?: 'circle' | 'polygon';
|
|
91
|
+
/**
|
|
92
|
+
* Direction in which the chart is drawn.
|
|
93
|
+
* @default 'counterclockwise'
|
|
94
|
+
*/
|
|
95
|
+
direction?: 'clockwise' | 'counterclockwise';
|
|
96
|
+
/**
|
|
97
|
+
* Configuration options for the radial axis.
|
|
98
|
+
*/
|
|
99
|
+
radialAxis?: PolarAxisProps;
|
|
100
|
+
/**
|
|
101
|
+
* Configuration options for the angular axis.
|
|
102
|
+
*/
|
|
103
|
+
angularAxis?: PolarAxisProps & {
|
|
104
|
+
/**
|
|
105
|
+
* Format unit for angular values.
|
|
106
|
+
* @default 'degrees'
|
|
107
|
+
*/
|
|
108
|
+
unit?: 'radians' | 'degrees';
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Optional callback to access the Chart interface. Use this instead of ref for accessing
|
|
112
|
+
* the public methods and properties of the component.
|
|
113
|
+
*/
|
|
114
|
+
componentRef?: React.Ref<IChart>;
|
|
115
|
+
/**
|
|
116
|
+
* Locale identifier string used to format numbers and dates according to the specified culture.
|
|
117
|
+
* Example: 'en-US', 'fr-FR'.
|
|
118
|
+
*/
|
|
119
|
+
culture?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Options for localizing date values.
|
|
122
|
+
*/
|
|
123
|
+
dateLocalizeOptions?: Intl.DateTimeFormatOptions;
|
|
124
|
+
/**
|
|
125
|
+
* If true, date values are treated as UTC dates.
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
128
|
+
useUTC?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Theme (provided through customization)
|
|
131
|
+
*/
|
|
132
|
+
theme?: ITheme;
|
|
133
|
+
/**
|
|
134
|
+
* Call to provide customized styling that will layer on top of the variant rules
|
|
135
|
+
*/
|
|
136
|
+
styles?: IStyleFunctionOrObject<IPolarChartStyleProps, IPolarChartStyles>;
|
|
137
|
+
/**
|
|
138
|
+
* Props for the callout in the chart
|
|
139
|
+
*/
|
|
140
|
+
calloutProps?: Partial<ICalloutProps>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Polar Chart style properties
|
|
144
|
+
* {@docCategory PolarChart}
|
|
145
|
+
*/
|
|
146
|
+
export interface IPolarChartStyleProps {
|
|
147
|
+
/**
|
|
148
|
+
* Theme (provided through customization)
|
|
149
|
+
*/
|
|
150
|
+
theme: ITheme;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Polar Chart styles
|
|
154
|
+
* {@docCategory PolarChart}
|
|
155
|
+
*/
|
|
156
|
+
export interface IPolarChartStyles {
|
|
157
|
+
/**
|
|
158
|
+
* Style for the root element.
|
|
159
|
+
*/
|
|
160
|
+
root?: IStyle;
|
|
161
|
+
/**
|
|
162
|
+
* Style for the chart wrapper element.
|
|
163
|
+
*/
|
|
164
|
+
chartWrapper?: IStyle;
|
|
165
|
+
/**
|
|
166
|
+
* Style for the chart element.
|
|
167
|
+
*/
|
|
168
|
+
chart?: IStyle;
|
|
169
|
+
/**
|
|
170
|
+
* Style for the inner grid lines.
|
|
171
|
+
*/
|
|
172
|
+
gridLineInner?: IStyle;
|
|
173
|
+
/**
|
|
174
|
+
* Style for the outer grid lines.
|
|
175
|
+
*/
|
|
176
|
+
gridLineOuter?: IStyle;
|
|
177
|
+
/**
|
|
178
|
+
* Style for the tick labels.
|
|
179
|
+
*/
|
|
180
|
+
tickLabel?: IStyle;
|
|
181
|
+
/**
|
|
182
|
+
* Style for the legend container.
|
|
183
|
+
*/
|
|
184
|
+
legendContainer?: IStyle;
|
|
185
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolarChart.types.js","sourceRoot":"../src/","sources":["components/PolarChart/PolarChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport {\n IAreaPolarSeries,\n AxisCategoryOrder,\n AxisProps,\n AxisScaleType,\n IChart,\n ILinePolarSeries,\n IMargins,\n IScatterPolarSeries,\n} from '../../types/IDataPoint';\nimport { ILegendsProps } from '../Legends/Legends.types';\nimport { ICalloutProps, IStyle, IStyleFunctionOrObject, ITheme } from '@fluentui/react';\n\n/**\n * Configuration options for a polar axis.\n * {@docCategory PolarChart}\n */\nexport type PolarAxisProps = AxisProps & {\n /**\n * Values at which ticks should be placed on the axis.\n */\n tickValues?: number[] | Date[] | string[];\n\n /**\n * Format string for the axis ticks.\n * For numbers, see: https://d3js.org/d3-format.\n * And for dates see: https://d3js.org/d3-time-format.\n */\n tickFormat?: string;\n\n /**\n * Number of ticks to display on the axis.\n */\n tickCount?: number;\n\n /**\n * Defines the order of categories on the axis.\n * @default 'default'\n */\n categoryOrder?: AxisCategoryOrder;\n\n /**\n * Scale type for the axis.\n * @default 'default'\n */\n scaleType?: AxisScaleType;\n\n /**\n * Start value of the axis range.\n */\n rangeStart?: number | Date;\n\n /**\n * End value of the axis range.\n */\n rangeEnd?: number | Date;\n};\n\n/**\n * Polar Chart properties\n * {@docCategory PolarChart}\n */\nexport interface IPolarChartProps {\n /**\n * Data series to be rendered in the polar chart.\n */\n data: (IAreaPolarSeries | ILinePolarSeries | IScatterPolarSeries)[];\n\n /**\n * Width of the polar chart.\n * @default 200\n */\n width?: number;\n\n /**\n * Height of the polar chart.\n * @default 200\n */\n height?: number;\n\n /**\n * Margins around the chart area.\n */\n margins?: IMargins;\n\n /**\n * If true, hides the legend.\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * If true, hides the tooltip.\n * @default false\n */\n hideTooltip?: boolean;\n\n /*\n * Properties for customizing the legend.\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Title of the chart.\n */\n chartTitle?: string;\n\n /**\n * Fraction of the radius to cut out from the center of the chart.\n * Accepts values in the range [0, 1].\n */\n hole?: number;\n\n /**\n * Shape of the polar chart.\n * @default 'circle'\n */\n shape?: 'circle' | 'polygon';\n\n /**\n * Direction in which the chart is drawn.\n * @default 'counterclockwise'\n */\n direction?: 'clockwise' | 'counterclockwise';\n\n /**\n * Configuration options for the radial axis.\n */\n radialAxis?: PolarAxisProps;\n\n /**\n * Configuration options for the angular axis.\n */\n angularAxis?: PolarAxisProps & {\n /**\n * Format unit for angular values.\n * @default 'degrees'\n */\n unit?: 'radians' | 'degrees';\n };\n\n /**\n * Optional callback to access the Chart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.Ref<IChart>;\n\n /**\n * Locale identifier string used to format numbers and dates according to the specified culture.\n * Example: 'en-US', 'fr-FR'.\n */\n culture?: string;\n\n /**\n * Options for localizing date values.\n */\n dateLocalizeOptions?: Intl.DateTimeFormatOptions;\n\n /**\n * If true, date values are treated as UTC dates.\n * @default false\n */\n useUTC?: boolean;\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<IPolarChartStyleProps, IPolarChartStyles>;\n\n /**\n * Props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n}\n\n/**\n * Polar Chart style properties\n * {@docCategory PolarChart}\n */\nexport interface IPolarChartStyleProps {\n /**\n * Theme (provided through customization)\n */\n theme: ITheme;\n}\n\n/**\n * Polar Chart styles\n * {@docCategory PolarChart}\n */\nexport interface IPolarChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the chart wrapper element.\n */\n chartWrapper?: IStyle;\n\n /**\n * Style for the chart element.\n */\n chart?: IStyle;\n\n /**\n * Style for the inner grid lines.\n */\n gridLineInner?: IStyle;\n\n /**\n * Style for the outer grid lines.\n */\n gridLineOuter?: IStyle;\n\n /**\n * Style for the tick labels.\n */\n tickLabel?: IStyle;\n\n /**\n * Style for the legend container.\n */\n legendContainer?: IStyle;\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ScaleBand, ScaleContinuousNumeric, ScaleTime } from 'd3-scale';
|
|
2
|
+
import { AxisScaleType } from '../../types/IDataPoint';
|
|
3
|
+
import { IPolarChartProps } from './PolarChart.types';
|
|
4
|
+
export declare const EPSILON = 0.000001;
|
|
5
|
+
export declare const createRadialScale: (scaleType: string, domain: (string | number | Date)[], range: number[], opts?: {
|
|
6
|
+
useUTC?: boolean;
|
|
7
|
+
tickCount?: number;
|
|
8
|
+
tickValues?: (string | number | Date)[];
|
|
9
|
+
tickText?: string[];
|
|
10
|
+
tickFormat?: string;
|
|
11
|
+
culture?: string;
|
|
12
|
+
tickStep?: number | string;
|
|
13
|
+
tick0?: number | Date;
|
|
14
|
+
dateLocalizeOptions?: Intl.DateTimeFormatOptions;
|
|
15
|
+
}) => {
|
|
16
|
+
scale: ScaleBand<string> | ScaleContinuousNumeric<number, number, undefined> | ScaleTime<number, number>;
|
|
17
|
+
tickValues: (string | number | Date)[];
|
|
18
|
+
tickLabels: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare const getScaleType: (values: (string | number | Date)[], opts?: {
|
|
21
|
+
scaleType?: AxisScaleType;
|
|
22
|
+
supportsLog?: boolean;
|
|
23
|
+
}) => string;
|
|
24
|
+
export declare const getContinuousScaleDomain: (scaleType: string, values: (number | Date)[], opts?: {
|
|
25
|
+
rangeStart?: number | Date;
|
|
26
|
+
rangeEnd?: number | Date;
|
|
27
|
+
}) => (number | Date)[];
|
|
28
|
+
export declare const createAngularScale: (scaleType: string, domain: (string | number | Date)[], opts?: {
|
|
29
|
+
tickCount?: number;
|
|
30
|
+
tickValues?: (string | number | Date)[];
|
|
31
|
+
tickText?: string[];
|
|
32
|
+
tickFormat?: string;
|
|
33
|
+
culture?: string;
|
|
34
|
+
tickStep?: number | string;
|
|
35
|
+
tick0?: number | Date;
|
|
36
|
+
direction?: IPolarChartProps["direction"];
|
|
37
|
+
unit?: NonNullable<IPolarChartProps["angularAxis"]>["unit"];
|
|
38
|
+
}) => {
|
|
39
|
+
scale: (v: string | number) => number;
|
|
40
|
+
tickValues: (string | number)[];
|
|
41
|
+
tickLabels: string[];
|
|
42
|
+
};
|
|
43
|
+
export declare const formatAngle: (value: string | number, unit: NonNullable<IPolarChartProps["angularAxis"]>["unit"]) => string;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
define(["require", "exports", "d3-scale", "d3-array", "d3-format", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-time-format", "@fluentui/react"], function (require, exports, d3_scale_1, d3_array_1, d3_format_1, utilities_1, chart_utilities_1, d3_time_format_1, react_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.formatAngle = exports.createAngularScale = exports.getContinuousScaleDomain = exports.getScaleType = exports.createRadialScale = exports.EPSILON = void 0;
|
|
5
|
+
exports.EPSILON = 1e-6;
|
|
6
|
+
var createRadialScale = function (scaleType, domain, range, opts) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
if (opts === void 0) { opts = {}; }
|
|
9
|
+
if (scaleType === 'category') {
|
|
10
|
+
var scale_1 = (0, d3_scale_1.scaleBand)()
|
|
11
|
+
.domain(domain)
|
|
12
|
+
.range(range)
|
|
13
|
+
.paddingInner(1);
|
|
14
|
+
var tickValues_1 = Array.isArray(opts.tickValues) ? opts.tickValues : domain;
|
|
15
|
+
var tickFormat_1 = function (domainValue, index) {
|
|
16
|
+
if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !(0, chart_utilities_1.isInvalidValue)(opts.tickText[index])) {
|
|
17
|
+
return opts.tickText[index];
|
|
18
|
+
}
|
|
19
|
+
return domainValue;
|
|
20
|
+
};
|
|
21
|
+
return { scale: scale_1, tickValues: tickValues_1, tickLabels: tickValues_1.map(tickFormat_1) };
|
|
22
|
+
}
|
|
23
|
+
var scale;
|
|
24
|
+
if (scaleType === 'date') {
|
|
25
|
+
scale = opts.useUTC ? (0, d3_scale_1.scaleUtc)() : (0, d3_scale_1.scaleTime)();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
scale = scaleType === 'log' ? (0, d3_scale_1.scaleLog)() : (0, d3_scale_1.scaleLinear)();
|
|
29
|
+
}
|
|
30
|
+
scale.domain(domain);
|
|
31
|
+
scale.range(range);
|
|
32
|
+
scale.nice();
|
|
33
|
+
var tickCount = (_a = opts.tickCount) !== null && _a !== void 0 ? _a : 4;
|
|
34
|
+
var tickFormat;
|
|
35
|
+
var customTickValues = Array.isArray(opts.tickValues) ? opts.tickValues : undefined;
|
|
36
|
+
if (scaleType === 'date') {
|
|
37
|
+
var lowestFormatLevel_1 = 100;
|
|
38
|
+
var highestFormatLevel_1 = -1;
|
|
39
|
+
scale.ticks().forEach(function (domainValue) {
|
|
40
|
+
var formatLevel = (0, utilities_1.getDateFormatLevel)(domainValue, opts.useUTC);
|
|
41
|
+
if (formatLevel > highestFormatLevel_1) {
|
|
42
|
+
highestFormatLevel_1 = formatLevel;
|
|
43
|
+
}
|
|
44
|
+
if (formatLevel < lowestFormatLevel_1) {
|
|
45
|
+
lowestFormatLevel_1 = formatLevel;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var formatOptions_1 = (_b = opts.dateLocalizeOptions) !== null && _b !== void 0 ? _b : (0, chart_utilities_1.getMultiLevelDateTimeFormatOptions)(lowestFormatLevel_1, highestFormatLevel_1);
|
|
49
|
+
tickFormat = function (domainValue, index) {
|
|
50
|
+
if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !(0, chart_utilities_1.isInvalidValue)(opts.tickText[index])) {
|
|
51
|
+
return opts.tickText[index];
|
|
52
|
+
}
|
|
53
|
+
if ((0, chart_utilities_1.isInvalidValue)(opts.culture) && typeof opts.tickFormat === 'string') {
|
|
54
|
+
if (opts.useUTC) {
|
|
55
|
+
return (0, d3_time_format_1.utcFormat)(opts.tickFormat)(domainValue);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return (0, d3_time_format_1.timeFormat)(opts.tickFormat)(domainValue);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return (0, chart_utilities_1.formatDateToLocaleString)(domainValue, opts.culture, opts.useUTC, false, formatOptions_1);
|
|
62
|
+
};
|
|
63
|
+
if (opts.tickStep) {
|
|
64
|
+
customTickValues = (0, utilities_1.generateDateTicks)(opts.tickStep, opts.tick0, scale.domain(), opts.useUTC);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
var defaultTickFormat_1 = scale.tickFormat(tickCount);
|
|
69
|
+
tickFormat = function (domainValue, index) {
|
|
70
|
+
if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !(0, chart_utilities_1.isInvalidValue)(opts.tickText[index])) {
|
|
71
|
+
return opts.tickText[index];
|
|
72
|
+
}
|
|
73
|
+
if (typeof opts.tickFormat === 'string') {
|
|
74
|
+
return (0, d3_format_1.format)(opts.tickFormat)(domainValue);
|
|
75
|
+
}
|
|
76
|
+
var value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
77
|
+
return defaultTickFormat_1(value) === '' ? '' : (0, chart_utilities_1.formatToLocaleString)(value, opts.culture);
|
|
78
|
+
};
|
|
79
|
+
if (opts.tickStep) {
|
|
80
|
+
customTickValues = (0, utilities_1.generateNumericTicks)(scaleType, opts.tickStep, opts.tick0, scale.domain());
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : scale.ticks(tickCount);
|
|
84
|
+
return { scale: scale, tickValues: tickValues, tickLabels: tickValues.map(tickFormat) };
|
|
85
|
+
};
|
|
86
|
+
exports.createRadialScale = createRadialScale;
|
|
87
|
+
var getScaleType = function (values, opts) {
|
|
88
|
+
if (opts === void 0) { opts = {}; }
|
|
89
|
+
var scaleType = 'category';
|
|
90
|
+
if (typeof values[0] === 'number') {
|
|
91
|
+
if (opts.supportsLog && opts.scaleType === 'log') {
|
|
92
|
+
scaleType = 'log';
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
scaleType = 'linear';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (values[0] instanceof Date) {
|
|
99
|
+
scaleType = 'date';
|
|
100
|
+
}
|
|
101
|
+
return scaleType;
|
|
102
|
+
};
|
|
103
|
+
exports.getScaleType = getScaleType;
|
|
104
|
+
var getContinuousScaleDomain = function (scaleType, values, opts) {
|
|
105
|
+
var _a;
|
|
106
|
+
if (opts === void 0) { opts = {}; }
|
|
107
|
+
var _b = (0, d3_array_1.extent)(values.filter(function (v) { return (0, utilities_1.isValidDomainValue)(v, scaleType); })), min = _b[0], max = _b[1];
|
|
108
|
+
if (scaleType === 'linear') {
|
|
109
|
+
_a = (0, d3_array_1.extent)([min, max, 0]), min = _a[0], max = _a[1];
|
|
110
|
+
}
|
|
111
|
+
if (!(0, chart_utilities_1.isInvalidValue)(opts.rangeStart)) {
|
|
112
|
+
min = opts.rangeStart;
|
|
113
|
+
}
|
|
114
|
+
if (!(0, chart_utilities_1.isInvalidValue)(opts.rangeEnd)) {
|
|
115
|
+
max = opts.rangeEnd;
|
|
116
|
+
}
|
|
117
|
+
if ((0, chart_utilities_1.isInvalidValue)(min) || (0, chart_utilities_1.isInvalidValue)(max)) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
return [min, max];
|
|
121
|
+
};
|
|
122
|
+
exports.getContinuousScaleDomain = getContinuousScaleDomain;
|
|
123
|
+
var degToRad = function (deg) { return (deg * Math.PI) / 180; };
|
|
124
|
+
var radToDeg = function (rad) { return (rad * 180) / Math.PI; };
|
|
125
|
+
var normalizeAngle = function (deg, direction) {
|
|
126
|
+
return (((direction === 'clockwise' ? deg : 450 - deg) % 360) + 360) % 360;
|
|
127
|
+
};
|
|
128
|
+
var createAngularScale = function (scaleType, domain, opts) {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
if (opts === void 0) { opts = {}; }
|
|
131
|
+
if (scaleType === 'category') {
|
|
132
|
+
var categoryIndexMap_1 = {};
|
|
133
|
+
domain.forEach(function (d, i) {
|
|
134
|
+
categoryIndexMap_1[d] = i;
|
|
135
|
+
});
|
|
136
|
+
var period_1 = 360 / domain.length;
|
|
137
|
+
var tickValues_2 = Array.isArray(opts.tickValues) ? opts.tickValues : domain;
|
|
138
|
+
var tickFormat_2 = function (domainValue, index) {
|
|
139
|
+
if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !(0, chart_utilities_1.isInvalidValue)(opts.tickText[index])) {
|
|
140
|
+
return opts.tickText[index];
|
|
141
|
+
}
|
|
142
|
+
return domainValue;
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
scale: function (v) { return degToRad(normalizeAngle(categoryIndexMap_1[v] * period_1, opts.direction)); },
|
|
146
|
+
tickValues: tickValues_2,
|
|
147
|
+
tickLabels: tickValues_2.map(tickFormat_2),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
var customTickValues = Array.isArray(opts.tickValues) ? opts.tickValues : undefined;
|
|
151
|
+
var tickFormat = function (domainValue, index) {
|
|
152
|
+
if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !(0, chart_utilities_1.isInvalidValue)(opts.tickText[index])) {
|
|
153
|
+
return opts.tickText[index];
|
|
154
|
+
}
|
|
155
|
+
if (typeof opts.tickFormat === 'string') {
|
|
156
|
+
return (0, d3_format_1.format)(opts.tickFormat)(domainValue);
|
|
157
|
+
}
|
|
158
|
+
return (0, exports.formatAngle)(domainValue, opts.unit);
|
|
159
|
+
};
|
|
160
|
+
if (opts.tickStep) {
|
|
161
|
+
customTickValues = (_a = (0, utilities_1.generateNumericTicks)(scaleType, opts.tickStep, opts.tick0, [
|
|
162
|
+
0,
|
|
163
|
+
(opts.unit === 'radians' ? 2 * Math.PI : 360) - exports.EPSILON,
|
|
164
|
+
])) === null || _a === void 0 ? void 0 : _a.map(function (v) { return (opts.unit === 'radians' ? radToDeg(v) : v); });
|
|
165
|
+
}
|
|
166
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : (0, d3_array_1.range)(0, 360, 360 / ((_b = opts.tickCount) !== null && _b !== void 0 ? _b : 8));
|
|
167
|
+
return {
|
|
168
|
+
scale: function (v) { return degToRad(normalizeAngle(v, opts.direction)); },
|
|
169
|
+
tickValues: tickValues,
|
|
170
|
+
tickLabels: tickValues.map(tickFormat),
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
exports.createAngularScale = createAngularScale;
|
|
174
|
+
var formatAngle = function (value, unit) {
|
|
175
|
+
return typeof value === 'string'
|
|
176
|
+
? value
|
|
177
|
+
: unit === 'radians'
|
|
178
|
+
? "".concat((0, react_1.precisionRound)(value / 180, 6), "\u03C0")
|
|
179
|
+
: "".concat((0, react_1.precisionRound)(value, 6), "\u00B0");
|
|
180
|
+
};
|
|
181
|
+
exports.formatAngle = formatAngle;
|
|
182
|
+
});
|
|
183
|
+
//# sourceMappingURL=PolarChart.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolarChart.utils.js","sourceRoot":"../src/","sources":["components/PolarChart/PolarChart.utils.ts"],"names":[],"mappings":";;;;IA8Ba,QAAA,OAAO,GAAG,IAAI,CAAC;IAErB,IAAM,iBAAiB,GAAG,UAC/B,SAAiB,EACjB,MAAkC,EAClC,KAAe,EACf,IAUM;;QAVN,qBAAA,EAAA,SAUM;QAMN,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC7B,IAAM,OAAK,GAAG,IAAA,oBAAW,GAAE;iBACxB,MAAM,CAAC,MAAkB,CAAC;iBAC1B,KAAK,CAAC,KAAK,CAAC;iBACZ,YAAY,CAAC,CAAC,CAAC,CAAC;YACnB,IAAM,YAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,IA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AO,EAAC,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,MAAA,IAAI,CAAC,SAAS,mCAAI,CAAC,CAAC,CAAC,CAAC;QAEpF,OAAO;YACL,KAAK,EAAE,UAAC,CAAS,IAAK,OAAA,QAAQ,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAA3C,CAA2C;YACjE,UAAU,YAAA;YACV,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC;SACvC,CAAC;IACJ,CAAC,CAAC;IA1DW,QAAA,kBAAkB,sBA0D7B;IAEK,IAAM,WAAW,GAAG,UACzB,KAAsB,EACtB,IAA0D;QAE1D,OAAA,OAAO,KAAK,KAAK,QAAQ;YACvB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,KAAK,SAAS;gBACpB,CAAC,CAAC,UAAG,IAAA,sBAAc,EAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,WAAG;gBACtC,CAAC,CAAC,UAAG,IAAA,sBAAc,EAAC,KAAK,EAAE,CAAC,CAAC,WAAG;IAJlC,CAIkC,CAAC;IARxB,QAAA,WAAW,eAQa","sourcesContent":["import {\n scaleBand as d3ScaleBand,\n scaleLinear as d3ScaleLinear,\n scaleLog as d3ScaleLog,\n scaleTime as d3ScaleTime,\n scaleUtc as d3ScaleUtc,\n NumberValue,\n ScaleBand,\n ScaleContinuousNumeric,\n ScaleTime,\n} from 'd3-scale';\nimport { extent as d3Extent, range as d3Range } from 'd3-array';\nimport { format as d3Format } from 'd3-format';\nimport { AxisScaleType } from '../../types/IDataPoint';\nimport {\n generateDateTicks,\n generateNumericTicks,\n getDateFormatLevel,\n isValidDomainValue,\n} from '../../utilities/utilities';\nimport {\n isInvalidValue,\n formatToLocaleString,\n getMultiLevelDateTimeFormatOptions,\n formatDateToLocaleString,\n} from '@fluentui/chart-utilities';\nimport { timeFormat as d3TimeFormat, utcFormat as d3UtcFormat } from 'd3-time-format';\nimport { IPolarChartProps } from './PolarChart.types';\nimport { precisionRound } from '@fluentui/react';\n\nexport const EPSILON = 1e-6;\n\nexport const createRadialScale = (\n scaleType: string,\n domain: (string | number | Date)[],\n range: number[],\n opts: {\n useUTC?: boolean;\n tickCount?: number;\n tickValues?: (string | number | Date)[];\n tickText?: string[];\n tickFormat?: string;\n culture?: string;\n tickStep?: number | string;\n tick0?: number | Date;\n dateLocalizeOptions?: Intl.DateTimeFormatOptions;\n } = {},\n): {\n scale: ScaleBand<string> | ScaleContinuousNumeric<number, number, undefined> | ScaleTime<number, number>;\n tickValues: (string | number | Date)[];\n tickLabels: string[];\n} => {\n if (scaleType === 'category') {\n const scale = d3ScaleBand()\n .domain(domain as string[])\n .range(range)\n .paddingInner(1);\n const tickValues = Array.isArray(opts.tickValues) ? (opts.tickValues as string[]) : (domain as string[]);\n const tickFormat = (domainValue: string, index: number) => {\n if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !isInvalidValue(opts.tickText[index])) {\n return opts.tickText[index];\n }\n return domainValue;\n };\n return { scale, tickValues, tickLabels: tickValues.map(tickFormat) };\n }\n\n let scale: ScaleContinuousNumeric<number, number, undefined> | ScaleTime<number, number>;\n if (scaleType === 'date') {\n scale = opts.useUTC ? d3ScaleUtc() : d3ScaleTime();\n } else {\n scale = scaleType === 'log' ? d3ScaleLog() : d3ScaleLinear();\n }\n\n scale.domain(domain as (number | Date)[]);\n scale.range(range);\n scale.nice();\n\n const tickCount = opts.tickCount ?? 4;\n let tickFormat;\n let customTickValues = Array.isArray(opts.tickValues) ? (opts.tickValues as (number | Date)[]) : undefined;\n if (scaleType === 'date') {\n let lowestFormatLevel = 100;\n let highestFormatLevel = -1;\n\n (scale as ScaleTime<number, number>).ticks().forEach((domainValue: Date) => {\n const formatLevel = getDateFormatLevel(domainValue, opts.useUTC);\n if (formatLevel > highestFormatLevel) {\n highestFormatLevel = formatLevel;\n }\n if (formatLevel < lowestFormatLevel) {\n lowestFormatLevel = formatLevel;\n }\n });\n const formatOptions =\n opts.dateLocalizeOptions ?? getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);\n tickFormat = (domainValue: Date, index: number) => {\n if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !isInvalidValue(opts.tickText[index])) {\n return opts.tickText[index];\n }\n if (isInvalidValue(opts.culture) && typeof opts.tickFormat === 'string') {\n if (opts.useUTC) {\n return d3UtcFormat(opts.tickFormat)(domainValue);\n } else {\n return d3TimeFormat(opts.tickFormat)(domainValue);\n }\n }\n return formatDateToLocaleString(domainValue, opts.culture, opts.useUTC, false, formatOptions);\n };\n if (opts.tickStep) {\n customTickValues = generateDateTicks(opts.tickStep, opts.tick0, scale.domain() as Date[], opts.useUTC);\n }\n } else {\n const defaultTickFormat = (scale as ScaleContinuousNumeric<number, number>).tickFormat(tickCount);\n tickFormat = (domainValue: NumberValue, index: number) => {\n if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !isInvalidValue(opts.tickText[index])) {\n return opts.tickText[index];\n }\n if (typeof opts.tickFormat === 'string') {\n return d3Format(opts.tickFormat)(domainValue);\n }\n const value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();\n return defaultTickFormat(value) === '' ? '' : (formatToLocaleString(value, opts.culture) as string);\n };\n if (opts.tickStep) {\n customTickValues = generateNumericTicks(\n scaleType as AxisScaleType,\n opts.tickStep,\n opts.tick0,\n scale.domain() as number[],\n );\n }\n }\n const tickValues = customTickValues ?? scale.ticks(tickCount);\n\n return { scale, tickValues, tickLabels: tickValues.map(tickFormat) };\n};\n\nexport const getScaleType = (\n values: (string | number | Date)[],\n opts: {\n scaleType?: AxisScaleType;\n supportsLog?: boolean;\n } = {},\n): string => {\n let scaleType = 'category';\n if (typeof values[0] === 'number') {\n if (opts.supportsLog && opts.scaleType === 'log') {\n scaleType = 'log';\n } else {\n scaleType = 'linear';\n }\n } else if (values[0] instanceof Date) {\n scaleType = 'date';\n }\n return scaleType;\n};\n\nexport const getContinuousScaleDomain = (\n scaleType: string,\n values: (number | Date)[],\n opts: {\n rangeStart?: number | Date;\n rangeEnd?: number | Date;\n } = {},\n): (number | Date)[] => {\n let [min, max] = d3Extent(values.filter(v => isValidDomainValue(v, scaleType as AxisScaleType)) as (number | Date)[]);\n if (scaleType === 'linear') {\n [min, max] = d3Extent([min, max, 0] as number[]);\n }\n if (!isInvalidValue(opts.rangeStart)) {\n min = opts.rangeStart;\n }\n if (!isInvalidValue(opts.rangeEnd)) {\n max = opts.rangeEnd;\n }\n\n if (isInvalidValue(min) || isInvalidValue(max)) {\n return [];\n }\n return [min!, max!];\n};\n\nconst degToRad = (deg: number) => (deg * Math.PI) / 180;\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI;\n\nconst normalizeAngle = (deg: number, direction: IPolarChartProps['direction']) =>\n (((direction === 'clockwise' ? deg : 450 - deg) % 360) + 360) % 360;\n\nexport const createAngularScale = (\n scaleType: string,\n domain: (string | number | Date)[],\n opts: {\n tickCount?: number;\n tickValues?: (string | number | Date)[];\n tickText?: string[];\n tickFormat?: string;\n culture?: string;\n tickStep?: number | string;\n tick0?: number | Date;\n direction?: IPolarChartProps['direction'];\n unit?: NonNullable<IPolarChartProps['angularAxis']>['unit'];\n } = {},\n): { scale: (v: string | number) => number; tickValues: (string | number)[]; tickLabels: string[] } => {\n if (scaleType === 'category') {\n const categoryIndexMap: Record<string, number> = {};\n (domain as string[]).forEach((d, i) => {\n categoryIndexMap[d] = i;\n });\n const period = 360 / domain.length;\n const tickValues = Array.isArray(opts.tickValues) ? (opts.tickValues as string[]) : (domain as string[]);\n const tickFormat = (domainValue: string, index: number) => {\n if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !isInvalidValue(opts.tickText[index])) {\n return opts.tickText[index];\n }\n return domainValue;\n };\n return {\n scale: (v: string) => degToRad(normalizeAngle(categoryIndexMap[v] * period, opts.direction)),\n tickValues,\n tickLabels: tickValues.map(tickFormat),\n };\n }\n\n let customTickValues = Array.isArray(opts.tickValues) ? (opts.tickValues as number[]) : undefined;\n const tickFormat = (domainValue: number, index: number) => {\n if (Array.isArray(opts.tickValues) && Array.isArray(opts.tickText) && !isInvalidValue(opts.tickText[index])) {\n return opts.tickText[index];\n }\n if (typeof opts.tickFormat === 'string') {\n return d3Format(opts.tickFormat)(domainValue);\n }\n return formatAngle(domainValue, opts.unit);\n };\n if (opts.tickStep) {\n customTickValues = generateNumericTicks(scaleType as AxisScaleType, opts.tickStep, opts.tick0, [\n 0,\n (opts.unit === 'radians' ? 2 * Math.PI : 360) - EPSILON,\n ])?.map(v => (opts.unit === 'radians' ? radToDeg(v) : v));\n }\n const tickValues = customTickValues ?? d3Range(0, 360, 360 / (opts.tickCount ?? 8));\n\n return {\n scale: (v: number) => degToRad(normalizeAngle(v, opts.direction)),\n tickValues,\n tickLabels: tickValues.map(tickFormat),\n };\n};\n\nexport const formatAngle = (\n value: string | number,\n unit: NonNullable<IPolarChartProps['angularAxis']>['unit'],\n): string =>\n typeof value === 'string'\n ? value\n : unit === 'radians'\n ? `${precisionRound(value / 180, 6)}π`\n : `${precisionRound(value, 6)}°`;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./PolarChart", "./PolarChart.types"], function (require, exports, tslib_1, PolarChart_1, PolarChart_types_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(PolarChart_1, exports);
|
|
5
|
+
tslib_1.__exportStar(PolarChart_types_1, exports);
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/PolarChart/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC","sourcesContent":["export * from './PolarChart';\nexport * from './PolarChart.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react/lib/Callout", "@fluentui/react/lib/Utilities", "d3-array", "d3-sankey", "d3-selection", "d3-shape", "react", "../../utilities/ChartHoverCard/ChartHoverCard", "../../utilities/image-export-utils"], function (require, exports, tslib_1, react_focus_1, Callout_1, Utilities_1, d3_array_1, d3_sankey_1, d3_selection_1, d3_shape_1, React, ChartHoverCard_1, image_export_utils_1) {
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react/lib/Callout", "@fluentui/react/lib/Utilities", "d3-array", "d3-sankey", "d3-selection", "d3-shape", "react", "../../utilities/ChartHoverCard/ChartHoverCard", "../../utilities/index", "../../utilities/image-export-utils"], function (require, exports, tslib_1, react_focus_1, Callout_1, Utilities_1, d3_array_1, d3_sankey_1, d3_selection_1, d3_shape_1, React, ChartHoverCard_1, index_1, image_export_utils_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.SankeyChartBase = void 0;
|
|
@@ -399,6 +399,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
399
399
|
var SankeyChartBase = /** @class */ (function (_super) {
|
|
400
400
|
tslib_1.__extends(SankeyChartBase, _super);
|
|
401
401
|
function SankeyChartBase(props) {
|
|
402
|
+
var _a, _b, _c;
|
|
402
403
|
var _this = _super.call(this, props) || this;
|
|
403
404
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
404
405
|
_this._numColumns = 0;
|
|
@@ -466,7 +467,11 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
466
467
|
_this._chartId = (0, Utilities_1.getId)('sankeyChart');
|
|
467
468
|
_this._emptyChartId = (0, Utilities_1.getId)('_SankeyChart_empty');
|
|
468
469
|
_this._labelTooltipId = (0, Utilities_1.getId)('tooltip');
|
|
469
|
-
|
|
470
|
+
var titleHeight = ((_a = props.data) === null || _a === void 0 ? void 0 : _a.chartTitle)
|
|
471
|
+
? Math.max((typeof ((_c = (_b = props.titleStyles) === null || _b === void 0 ? void 0 : _b.titleFont) === null || _c === void 0 ? void 0 : _c.size) === 'number' ? props.titleStyles.titleFont.size : 13) +
|
|
472
|
+
index_1.CHART_TITLE_PADDING, 36)
|
|
473
|
+
: 36;
|
|
474
|
+
_this._margins = { top: titleHeight, right: 48, bottom: 32, left: 48 };
|
|
470
475
|
// We memo-ize creation so that we only create a new object when any of the fields change.
|
|
471
476
|
_this._computeClassNamesProps = (0, Utilities_1.memoizeFunction)(function (theme, pathColor, className, containerWidth, containerHeight, enableReflow) { return ({
|
|
472
477
|
theme: theme,
|
|
@@ -598,6 +603,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
598
603
|
}, onMouseLeave: this._onCloseCallout },
|
|
599
604
|
React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.vertical, className: classNames_1.chartWrapper },
|
|
600
605
|
React.createElement("svg", { width: width, height: height, id: this._chartId, className: classNames_1.chart },
|
|
606
|
+
!this.props.hideLegend && this.props.data.chartTitle && (React.createElement(index_1.ChartTitle, { title: this.props.data.chartTitle, x: width / 2, maxWidth: width - 20, className: classNames_1.chartTitle, titleStyles: this.props.titleStyles, tooltipClassName: classNames_1.svgTooltip })),
|
|
601
607
|
nodeLinkDomOrderArray_1.map(function (item) {
|
|
602
608
|
if (item.type === 'node') {
|
|
603
609
|
return (React.createElement("g", { key: nodes_1[item.index].nodeId, className: classNames_1.nodes }, nodeData_1[item.index]));
|
|
@@ -892,7 +898,7 @@ define(["require", "exports", "tslib", "@fluentui/react-focus", "@fluentui/react
|
|
|
892
898
|
//Fixing tooltip position by attaching it to the element rather than page
|
|
893
899
|
div.style('opacity', 0.9).style('color', this.props.theme.palette.neutralPrimary);
|
|
894
900
|
div
|
|
895
|
-
.
|
|
901
|
+
.text(text)
|
|
896
902
|
.style('left', evt.pageX + 'px')
|
|
897
903
|
.style('top', evt.pageY - 28 + 'px');
|
|
898
904
|
}
|