@fluentui/react-charting 5.25.4 → 5.25.6
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 +107 -1
- package/CHANGELOG.md +30 -2
- package/bundle-size/PolarChart.fixture.js +7 -0
- package/dist/react-charting.d.ts +424 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +93 -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 +20 -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 +390 -267
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib/components/DonutChart/Pie/Pie.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 +6 -18
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +55 -5
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib/components/LineChart/LineChart.base.js +2 -26
- 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 +10 -3
- 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 +14 -32
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +12 -80
- 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 +19 -31
- 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 +107 -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 +32 -8
- package/lib/utilities/utilities.js +232 -111
- 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 +20 -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 +392 -269
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib-amd/components/DonutChart/Pie/Pie.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 +4 -16
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -2
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-amd/components/LineChart/LineChart.base.js +1 -25
- 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 +10 -4
- 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 +13 -31
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +12 -79
- 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 +19 -30
- 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 +107 -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 +32 -8
- package/lib-amd/utilities/utilities.js +239 -114
- 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 +20 -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 +392 -269
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib-commonjs/components/DonutChart/Pie/Pie.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 +4 -16
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +1 -25
- 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 +10 -3
- 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 +13 -31
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -79
- 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 +18 -30
- 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 +107 -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 +32 -8
- package/lib-commonjs/utilities/utilities.js +239 -114
- 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 +22 -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/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +11 -0
- package/src/components/PolarChart/PolarChart.types.ts +232 -0
- package/src/components/SankeyChart/SankeyChart.types.ts +22 -0
- package/src/components/ScatterChart/ScatterChart.types.ts +5 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.findCalloutPoints = exports.generateMonthlyTicks = exports.generateLinearTicks = exports.getRangeForScatterMarkerSize = exports.getScatterXDomainExtent = exports.isPlottable = exports.isValidDomainValue = exports.getDomainPaddingForMarkers = exports.getInvertedTextColor = exports.sortAxisCategories = exports.truncateString = exports.
|
|
4
|
+
exports.autoLayoutXAxisLabels = exports.findCalloutPoints = exports.generateDateTicks = exports.generateNumericTicks = exports.generateMonthlyTicks = exports.generateLinearTicks = exports.getRangeForScatterMarkerSize = exports.getScatterXDomainExtent = exports.isPlottable = exports.isValidDomainValue = exports.getDomainPaddingForMarkers = exports.getInvertedTextColor = exports.sortAxisCategories = exports.truncateString = exports.getTextSize = exports.measureTextWithDOM = exports.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.calculateLongestLabelWidth = exports.wrapContent = exports.DEFAULT_WRAP_WIDTH = exports.createStringYAxis = exports.createStringYAxisForHorizontalBarChartWithAxis = exports.YAxisType = exports.XAxisTypes = exports.ChartTypes = exports.CARTESIAN_XAXIS_CLASSNAME = exports.DEFAULT_DATE_STRING = exports.MIN_DONUT_RADIUS = exports.MIN_DOMAIN_MARGIN = void 0;
|
|
5
5
|
exports.defaultYAxisTickFormatter = defaultYAxisTickFormatter;
|
|
6
6
|
exports.createNumericXAxis = createNumericXAxis;
|
|
7
7
|
exports.getDateFormatLevel = getDateFormatLevel;
|
|
@@ -56,6 +56,8 @@ var colors_1 = require("./colors");
|
|
|
56
56
|
exports.MIN_DOMAIN_MARGIN = 8;
|
|
57
57
|
exports.MIN_DONUT_RADIUS = 1;
|
|
58
58
|
exports.DEFAULT_DATE_STRING = '2000-01-01';
|
|
59
|
+
exports.CARTESIAN_XAXIS_CLASSNAME = 'fui-cart__xAxis';
|
|
60
|
+
var CARTESIAN_XAXIS_TEXT_SELECTOR = ".".concat(exports.CARTESIAN_XAXIS_CLASSNAME, " text");
|
|
59
61
|
var ChartTypes;
|
|
60
62
|
(function (ChartTypes) {
|
|
61
63
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
@@ -114,8 +116,12 @@ function defaultYAxisTickFormatter(value) {
|
|
|
114
116
|
*/
|
|
115
117
|
function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType) {
|
|
116
118
|
var domainNRangeValues = xAxisParams.domainNRangeValues, _a = xAxisParams.showRoundOffXTickValues, showRoundOffXTickValues = _a === void 0 ? true : _a, _b = xAxisParams.xAxistickSize, xAxistickSize = _b === void 0 ? 6 : _b, _c = xAxisParams.tickPadding, tickPadding = _c === void 0 ? 10 : _c, xAxisCount = xAxisParams.xAxisCount, xAxisElement = xAxisParams.xAxisElement, hideTickOverlap = xAxisParams.hideTickOverlap, calcMaxLabelWidth = xAxisParams.calcMaxLabelWidth, tickStep = xAxisParams.tickStep, tick0 = xAxisParams.tick0, tickText = xAxisParams.tickText;
|
|
119
|
+
var dStartValue = domainNRangeValues.dStartValue;
|
|
120
|
+
var dEndValue = domainNRangeValues.dEndValue;
|
|
121
|
+
var finalXmin = xAxisParams.xMinValue !== undefined ? Math.min(dStartValue, xAxisParams.xMinValue) : dStartValue;
|
|
122
|
+
var finalXmax = xAxisParams.xMaxValue !== undefined ? Math.max(dEndValue, xAxisParams.xMaxValue) : dEndValue;
|
|
117
123
|
var xAxisScale = createNumericScale(scaleType)
|
|
118
|
-
.domain([
|
|
124
|
+
.domain([finalXmin, finalXmax])
|
|
119
125
|
.range([domainNRangeValues.rStartValue, domainNRangeValues.rEndValue]);
|
|
120
126
|
showRoundOffXTickValues && xAxisScale.nice();
|
|
121
127
|
var tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
@@ -129,7 +135,7 @@ function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleTy
|
|
|
129
135
|
var xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
130
136
|
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
|
|
131
137
|
};
|
|
132
|
-
if (hideTickOverlap
|
|
138
|
+
if (hideTickOverlap) {
|
|
133
139
|
var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(function (v, i) { return tickFormat(v, i); })) + 20;
|
|
134
140
|
var _d = xAxisScale.range(), start = _d[0], end = _d[1];
|
|
135
141
|
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
@@ -147,7 +153,7 @@ function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleTy
|
|
|
147
153
|
customTickValues = tickParams.tickValues;
|
|
148
154
|
}
|
|
149
155
|
else if (tickStep) {
|
|
150
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
156
|
+
customTickValues = (0, exports.generateNumericTicks)(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
151
157
|
}
|
|
152
158
|
if (customTickValues) {
|
|
153
159
|
xAxis.tickValues(customTickValues);
|
|
@@ -155,8 +161,8 @@ function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleTy
|
|
|
155
161
|
if (xAxisElement) {
|
|
156
162
|
(0, d3_selection_1.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
157
163
|
}
|
|
158
|
-
var tickValues =
|
|
159
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
164
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
165
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
160
166
|
}
|
|
161
167
|
/**
|
|
162
168
|
* This function returns a multilevel formatter for a given date range.
|
|
@@ -261,7 +267,7 @@ function isPowerOf10(num) {
|
|
|
261
267
|
* @param {ITickParams} tickParams
|
|
262
268
|
*/
|
|
263
269
|
function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC, chartType) {
|
|
264
|
-
var domainNRangeValues = xAxisParams.domainNRangeValues, xAxisElement = xAxisParams.xAxisElement, _a = xAxisParams.tickPadding, tickPadding = _a === void 0 ? 6 : _a, _b = xAxisParams.xAxistickSize, xAxistickSize = _b === void 0 ? 6 : _b, xAxisCount = xAxisParams.xAxisCount, calcMaxLabelWidth = xAxisParams.calcMaxLabelWidth, tickStep = xAxisParams.tickStep, tick0 = xAxisParams.tick0, tickText = xAxisParams.tickText;
|
|
270
|
+
var domainNRangeValues = xAxisParams.domainNRangeValues, xAxisElement = xAxisParams.xAxisElement, _a = xAxisParams.tickPadding, tickPadding = _a === void 0 ? 6 : _a, _b = xAxisParams.xAxistickSize, xAxistickSize = _b === void 0 ? 6 : _b, xAxisCount = xAxisParams.xAxisCount, hideTickOverlap = xAxisParams.hideTickOverlap, calcMaxLabelWidth = xAxisParams.calcMaxLabelWidth, tickStep = xAxisParams.tickStep, tick0 = xAxisParams.tick0, tickText = xAxisParams.tickText;
|
|
265
271
|
var xAxisScale = useUTC ? (0, d3_scale_1.scaleUtc)() : (0, d3_scale_1.scaleTime)();
|
|
266
272
|
xAxisScale
|
|
267
273
|
.domain([domainNRangeValues.dStartValue, domainNRangeValues.dEndValue])
|
|
@@ -302,10 +308,11 @@ function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLo
|
|
|
302
308
|
}
|
|
303
309
|
return (0, chart_utilities_1.formatDateToLocaleString)(domainValue, culture, useUTC, false, formatOptions);
|
|
304
310
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
311
|
+
if (hideTickOverlap) {
|
|
312
|
+
var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 40;
|
|
313
|
+
var _c = xAxisScale.range(), start = _c[0], end = _c[1];
|
|
314
|
+
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
315
|
+
}
|
|
309
316
|
var xAxis = (0, d3_axis_1.axisBottom)(xAxisScale)
|
|
310
317
|
.tickSize(xAxistickSize)
|
|
311
318
|
.tickPadding(tickPadding)
|
|
@@ -319,7 +326,7 @@ function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLo
|
|
|
319
326
|
customTickValues = tickParams.tickValues;
|
|
320
327
|
}
|
|
321
328
|
else if (tickStep) {
|
|
322
|
-
customTickValues = generateDateTicks(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
329
|
+
customTickValues = (0, exports.generateDateTicks)(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
323
330
|
}
|
|
324
331
|
if (customTickValues) {
|
|
325
332
|
xAxis.tickValues(customTickValues);
|
|
@@ -327,8 +334,8 @@ function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLo
|
|
|
327
334
|
if (xAxisElement) {
|
|
328
335
|
(0, d3_selection_1.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
329
336
|
}
|
|
330
|
-
var tickValues =
|
|
331
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
337
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
338
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
332
339
|
}
|
|
333
340
|
/**
|
|
334
341
|
* Create String X axis
|
|
@@ -390,7 +397,7 @@ function createStringXAxis(xAxisParams, tickParams, dataset, culture) {
|
|
|
390
397
|
if (xAxisParams.xAxisElement) {
|
|
391
398
|
(0, d3_selection_1.select)(xAxisParams.xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
392
399
|
}
|
|
393
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
400
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
394
401
|
}
|
|
395
402
|
/**
|
|
396
403
|
* This method is used to calculate the rounded tick values for the y-axis
|
|
@@ -484,7 +491,7 @@ function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData)
|
|
|
484
491
|
customTickValues = tickValues;
|
|
485
492
|
}
|
|
486
493
|
else if (tickStep) {
|
|
487
|
-
customTickValues = generateNumericTicks(undefined, tickStep, tick0, yAxisScale.domain());
|
|
494
|
+
customTickValues = (0, exports.generateNumericTicks)(undefined, tickStep, tick0, yAxisScale.domain());
|
|
488
495
|
}
|
|
489
496
|
if (customTickValues) {
|
|
490
497
|
yAxis.tickValues(customTickValues);
|
|
@@ -531,7 +538,7 @@ function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, use
|
|
|
531
538
|
customTickValues = tickValues;
|
|
532
539
|
}
|
|
533
540
|
else if (tickStep) {
|
|
534
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
541
|
+
customTickValues = (0, exports.generateNumericTicks)(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
535
542
|
}
|
|
536
543
|
if (customTickValues) {
|
|
537
544
|
yAxis.tickValues(customTickValues);
|
|
@@ -716,14 +723,15 @@ exports.DEFAULT_WRAP_WIDTH = 10;
|
|
|
716
723
|
* @returns
|
|
717
724
|
*/
|
|
718
725
|
function createWrapOfXLabels(wrapLabelProps) {
|
|
719
|
-
var
|
|
726
|
+
var _a, _b;
|
|
727
|
+
var node = wrapLabelProps.node, xAxis = wrapLabelProps.xAxis, noOfCharsToTruncate = wrapLabelProps.noOfCharsToTruncate, showXAxisLablesTooltip = wrapLabelProps.showXAxisLablesTooltip, _c = wrapLabelProps.width, width = _c === void 0 ? exports.DEFAULT_WRAP_WIDTH : _c, container = wrapLabelProps.container;
|
|
720
728
|
if (node === null) {
|
|
721
729
|
return;
|
|
722
730
|
}
|
|
723
731
|
var axisNode = (0, d3_selection_1.select)(node).call(xAxis);
|
|
724
732
|
var removeVal = 0;
|
|
725
733
|
var maxLines = 1;
|
|
726
|
-
axisNode.selectAll('.tick text').each(function () {
|
|
734
|
+
axisNode.selectAll('.tick text').each(function (_, tickIndex) {
|
|
727
735
|
var text = (0, d3_selection_1.select)(this);
|
|
728
736
|
var totalWord = text.text();
|
|
729
737
|
var truncatedWord = "".concat(text.text().slice(0, noOfCharsToTruncate), "...");
|
|
@@ -737,41 +745,27 @@ function createWrapOfXLabels(wrapLabelProps) {
|
|
|
737
745
|
var dy = parseFloat(text.attr('dy'));
|
|
738
746
|
var tspan = text
|
|
739
747
|
.text(null)
|
|
748
|
+
.attr('data-full', totalWord)
|
|
740
749
|
.append('tspan')
|
|
741
750
|
.attr('x', 0)
|
|
742
751
|
.attr('y', y)
|
|
743
|
-
.attr('
|
|
744
|
-
|
|
745
|
-
.
|
|
746
|
-
if (showXAxisLablesTooltip && totalWordLength > noOfCharsToTruncate) {
|
|
747
|
-
tspan = text
|
|
748
|
-
.append('tspan')
|
|
749
|
-
.attr('id', 'showDots')
|
|
750
|
-
.attr('x', 0)
|
|
751
|
-
.attr('y', y)
|
|
752
|
-
.attr('dy', dy + 'em')
|
|
753
|
-
.text(truncatedWord);
|
|
754
|
-
}
|
|
755
|
-
else if (showXAxisLablesTooltip && totalWordLength <= noOfCharsToTruncate) {
|
|
756
|
-
tspan = text
|
|
757
|
-
.append('tspan')
|
|
758
|
-
.attr('id', 'LessLength')
|
|
759
|
-
.attr('x', 0)
|
|
760
|
-
.attr('y', y)
|
|
761
|
-
.attr('dy', dy + 'em')
|
|
762
|
-
.text(totalWord);
|
|
752
|
+
.attr('dy', dy + 'em');
|
|
753
|
+
if (showXAxisLablesTooltip) {
|
|
754
|
+
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
763
755
|
}
|
|
764
756
|
else {
|
|
757
|
+
var maxWidth = Array.isArray(width) ? width[tickIndex] : width;
|
|
765
758
|
while ((word = words.pop())) {
|
|
766
759
|
line.push(word);
|
|
767
|
-
|
|
768
|
-
|
|
760
|
+
var label = line.join(' ');
|
|
761
|
+
tspan.text(label);
|
|
762
|
+
var labelWidth = (0, exports.getTextSize)(label, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
763
|
+
if (labelWidth > maxWidth && line.length > 1) {
|
|
769
764
|
line.pop();
|
|
770
765
|
tspan.text(line.join(' '));
|
|
771
766
|
line = [word];
|
|
772
767
|
tspan = text
|
|
773
768
|
.append('tspan')
|
|
774
|
-
.attr('id', 'WordBreakId')
|
|
775
769
|
.attr('x', 0)
|
|
776
770
|
.attr('y', y)
|
|
777
771
|
.attr('dy', ++lineNumber * lineHeight + dy + 'em')
|
|
@@ -783,10 +777,7 @@ function createWrapOfXLabels(wrapLabelProps) {
|
|
|
783
777
|
});
|
|
784
778
|
if (!showXAxisLablesTooltip) {
|
|
785
779
|
var maxHeight = 12; // intial value to render corretly first time
|
|
786
|
-
|
|
787
|
-
var outerHTMLElement = document.getElementById('WordBreakId');
|
|
788
|
-
var BoxCordinates = outerHTMLElement && outerHTMLElement.getBoundingClientRect();
|
|
789
|
-
var boxHeight = BoxCordinates && BoxCordinates.height;
|
|
780
|
+
var boxHeight = (_b = (_a = (container !== null && container !== void 0 ? container : document).querySelector(".".concat(exports.CARTESIAN_XAXIS_CLASSNAME, " tspan"))) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) !== null && _b !== void 0 ? _b : 0;
|
|
790
781
|
if (boxHeight > maxHeight) {
|
|
791
782
|
maxHeight = boxHeight;
|
|
792
783
|
}
|
|
@@ -811,53 +802,35 @@ yAxis, noOfCharsToTruncate, truncateLabel, isRtl) {
|
|
|
811
802
|
? "...".concat(text.text().slice(0, noOfCharsToTruncate))
|
|
812
803
|
: "".concat(text.text().slice(0, noOfCharsToTruncate), "...");
|
|
813
804
|
var totalWordLength = text.text().length;
|
|
814
|
-
var padding = 0; // ems
|
|
815
805
|
var y = text.attr('y');
|
|
816
806
|
var x = text.attr('x');
|
|
817
807
|
var dy = parseFloat(text.attr('dy'));
|
|
818
|
-
var
|
|
819
|
-
text
|
|
808
|
+
var tspan = text
|
|
820
809
|
.text(null)
|
|
810
|
+
.attr('data-full', totalWord)
|
|
821
811
|
.append('tspan')
|
|
822
812
|
.attr('x', x)
|
|
823
813
|
.attr('y', y)
|
|
824
|
-
.attr('
|
|
825
|
-
|
|
826
|
-
.
|
|
827
|
-
if (truncateLabel && totalWordLength > noOfCharsToTruncate) {
|
|
828
|
-
text
|
|
829
|
-
.append('tspan')
|
|
830
|
-
.attr('id', 'showDots')
|
|
831
|
-
.attr('x', x)
|
|
832
|
-
.attr('y', y)
|
|
833
|
-
.attr('dy', dy + 'em')
|
|
834
|
-
.attr('dx', padding + dx + 'em')
|
|
835
|
-
.text(truncatedWord);
|
|
836
|
-
}
|
|
837
|
-
else {
|
|
838
|
-
text
|
|
839
|
-
.append('tspan')
|
|
840
|
-
.attr('id', 'LessLength')
|
|
841
|
-
.attr('x', x)
|
|
842
|
-
.attr('y', y)
|
|
843
|
-
.attr('dx', padding + dx + 'em')
|
|
844
|
-
.text(totalWord);
|
|
814
|
+
.attr('dy', dy + 'em');
|
|
815
|
+
if (truncateLabel) {
|
|
816
|
+
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
845
817
|
}
|
|
846
818
|
});
|
|
847
819
|
}
|
|
848
820
|
var wrapContent = function (content, id, maxWidth) {
|
|
849
821
|
var textElement = (0, d3_selection_1.select)("#".concat(id));
|
|
850
822
|
textElement.text(content);
|
|
851
|
-
|
|
823
|
+
var node = textElement.node();
|
|
824
|
+
if (!node || typeof node.getComputedTextLength !== 'function') {
|
|
852
825
|
return false;
|
|
853
826
|
}
|
|
854
827
|
var isOverflowing = false;
|
|
855
|
-
var textLength =
|
|
828
|
+
var textLength = node.getComputedTextLength();
|
|
856
829
|
while (textLength > maxWidth && content.length > 0) {
|
|
857
830
|
content = content.slice(0, -1);
|
|
858
831
|
textElement.text(content + '...');
|
|
859
832
|
isOverflowing = true;
|
|
860
|
-
textLength =
|
|
833
|
+
textLength = node.getComputedTextLength();
|
|
861
834
|
}
|
|
862
835
|
return isOverflowing;
|
|
863
836
|
};
|
|
@@ -896,38 +869,41 @@ exports.calculateLongestLabelWidth = calculateLongestLabelWidth;
|
|
|
896
869
|
*/
|
|
897
870
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
898
871
|
function tooltipOfAxislabels(axistooltipProps) {
|
|
899
|
-
var tooltipCls = axistooltipProps.tooltipCls, axis = axistooltipProps.axis, id = axistooltipProps.id;
|
|
872
|
+
var tooltipCls = axistooltipProps.tooltipCls, axis = axistooltipProps.axis, id = axistooltipProps.id, container = axistooltipProps.container;
|
|
900
873
|
if (axis === null) {
|
|
901
874
|
return null;
|
|
902
875
|
}
|
|
903
|
-
var div = (0, d3_selection_1.select)(
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
var
|
|
915
|
-
|
|
876
|
+
var div = (container ? (0, d3_selection_1.select)(container) : (0, d3_selection_1.select)('body'))
|
|
877
|
+
.append('div')
|
|
878
|
+
.attr('id', id)
|
|
879
|
+
.attr('class', tooltipCls)
|
|
880
|
+
.style('opacity', 0);
|
|
881
|
+
axis.selectAll('.tick text').each(function () {
|
|
882
|
+
var tickSelection = (0, d3_selection_1.select)(this);
|
|
883
|
+
var fullLabel = tickSelection.attr('data-full');
|
|
884
|
+
if (tickSelection.text() === fullLabel) {
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
var tickEl = this;
|
|
888
|
+
tickSelection
|
|
916
889
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
890
|
.on('mouseover', function (event, d) {
|
|
918
|
-
|
|
891
|
+
var _a;
|
|
892
|
+
var containerBounds = container === null || container === void 0 ? void 0 : container.getBoundingClientRect();
|
|
893
|
+
var tickBounds = tickEl.getBoundingClientRect();
|
|
894
|
+
var tooltipBottom = containerBounds ? containerBounds.bottom - (tickBounds.top - 4) : tickBounds.top - 4;
|
|
895
|
+
var tooltipLeft = (tickBounds.left + tickBounds.right) / 2 - ((_a = containerBounds === null || containerBounds === void 0 ? void 0 : containerBounds.left) !== null && _a !== void 0 ? _a : 0);
|
|
919
896
|
div
|
|
920
|
-
.text(
|
|
921
|
-
.style('
|
|
922
|
-
.style('
|
|
897
|
+
.text(fullLabel)
|
|
898
|
+
.style('bottom', "".concat(tooltipBottom, "px"))
|
|
899
|
+
.style('left', "".concat(tooltipLeft, "px"))
|
|
900
|
+
.style('transform', 'translateX(-50%)')
|
|
901
|
+
.style('opacity', 0.9);
|
|
923
902
|
})
|
|
924
903
|
.on('mouseout', function (d) {
|
|
925
904
|
div.style('opacity', 0);
|
|
926
905
|
});
|
|
927
|
-
};
|
|
928
|
-
for (var i = 0; i < tickObjectLength; i++) {
|
|
929
|
-
_loop_1(i);
|
|
930
|
-
}
|
|
906
|
+
});
|
|
931
907
|
}
|
|
932
908
|
/**
|
|
933
909
|
* Find the axis type of line chart and area chart from given data
|
|
@@ -955,11 +931,11 @@ function getXAxisType(points) {
|
|
|
955
931
|
* @param {boolean} isRTL
|
|
956
932
|
* @returns {IDomainNRange}
|
|
957
933
|
*/
|
|
958
|
-
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode) {
|
|
934
|
+
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode, xMinVal, xMaxVal) {
|
|
959
935
|
var isScatterPolar = isScatterPolarSeries(points);
|
|
960
936
|
var _a = (0, exports.getScatterXDomainExtent)(points, scaleType), xMin = _a[0], xMax = _a[1];
|
|
961
937
|
if (hasMarkersMode) {
|
|
962
|
-
var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType);
|
|
938
|
+
var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType, xMinVal, xMaxVal);
|
|
963
939
|
xMin = xMin - xPadding.start;
|
|
964
940
|
xMax = xMax + xPadding.end;
|
|
965
941
|
}
|
|
@@ -1419,8 +1395,8 @@ function areArraysEqual(arr1, arr2) {
|
|
|
1419
1395
|
return true;
|
|
1420
1396
|
}
|
|
1421
1397
|
var cssVarRegExp = /var\((--[a-zA-Z0-9\-]+)\)/g;
|
|
1422
|
-
function resolveCSSVariables(
|
|
1423
|
-
var containerStyles = getComputedStyle(
|
|
1398
|
+
function resolveCSSVariables(container, styleRules) {
|
|
1399
|
+
var containerStyles = getComputedStyle(container);
|
|
1424
1400
|
return styleRules.replace(cssVarRegExp, function (match, group1) {
|
|
1425
1401
|
return containerStyles.getPropertyValue(group1);
|
|
1426
1402
|
});
|
|
@@ -1449,26 +1425,53 @@ var MEASUREMENT_SPAN_STYLE = {
|
|
|
1449
1425
|
border: 'none',
|
|
1450
1426
|
whiteSpace: 'pre',
|
|
1451
1427
|
};
|
|
1452
|
-
var MEASUREMENT_SPAN_ID =
|
|
1453
|
-
var
|
|
1428
|
+
var MEASUREMENT_SPAN_ID = 'fui_measurement_span';
|
|
1429
|
+
var TEXT_STYLE_PROPERTIES = [
|
|
1430
|
+
'font-size',
|
|
1431
|
+
'font-family',
|
|
1432
|
+
'font-weight',
|
|
1433
|
+
'font-style',
|
|
1434
|
+
'letter-spacing',
|
|
1435
|
+
'text-transform',
|
|
1436
|
+
];
|
|
1437
|
+
var measureTextWithDOM = function (text, cssSelector, container) {
|
|
1454
1438
|
var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
|
|
1455
1439
|
if (!measurementSpan) {
|
|
1456
1440
|
measurementSpan = document.createElement('span');
|
|
1457
1441
|
measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
|
|
1458
1442
|
measurementSpan.setAttribute('aria-hidden', 'true');
|
|
1459
|
-
|
|
1460
|
-
parentElement.appendChild(measurementSpan);
|
|
1461
|
-
}
|
|
1462
|
-
else {
|
|
1463
|
-
document.body.appendChild(measurementSpan);
|
|
1464
|
-
}
|
|
1443
|
+
(container !== null && container !== void 0 ? container : document.body).appendChild(measurementSpan);
|
|
1465
1444
|
}
|
|
1466
|
-
measurementSpan.setAttribute('class', className);
|
|
1467
1445
|
Object.assign(measurementSpan.style, MEASUREMENT_SPAN_STYLE);
|
|
1446
|
+
var refEl = (container !== null && container !== void 0 ? container : document).querySelector(cssSelector);
|
|
1447
|
+
if (refEl) {
|
|
1448
|
+
copyStyle(TEXT_STYLE_PROPERTIES, refEl, measurementSpan);
|
|
1449
|
+
}
|
|
1468
1450
|
measurementSpan.textContent = "".concat(text);
|
|
1469
|
-
|
|
1451
|
+
var rect = measurementSpan.getBoundingClientRect();
|
|
1452
|
+
return { node: measurementSpan, width: rect.width, height: rect.height };
|
|
1453
|
+
};
|
|
1454
|
+
exports.measureTextWithDOM = measureTextWithDOM;
|
|
1455
|
+
var CACHE_SIZE = 2000;
|
|
1456
|
+
var textSizeCache = new Map();
|
|
1457
|
+
var getTextSize = function (text, cssSelector, container) {
|
|
1458
|
+
var cacheKey = "".concat(text, "|").concat(cssSelector);
|
|
1459
|
+
var cachedResult = textSizeCache.get(cacheKey);
|
|
1460
|
+
if (cachedResult) {
|
|
1461
|
+
return cachedResult;
|
|
1462
|
+
}
|
|
1463
|
+
var _a = (0, exports.measureTextWithDOM)(text, cssSelector, container), width = _a.width, height = _a.height;
|
|
1464
|
+
// TODO: Improve cache eviction strategy if needed (e.g., LRU)
|
|
1465
|
+
if (textSizeCache.size >= CACHE_SIZE) {
|
|
1466
|
+
var firstKey = textSizeCache.keys().next().value;
|
|
1467
|
+
if (!(0, chart_utilities_1.isInvalidValue)(firstKey)) {
|
|
1468
|
+
textSizeCache.delete(firstKey);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
textSizeCache.set(cacheKey, { width: width, height: height });
|
|
1472
|
+
return { width: width, height: height };
|
|
1470
1473
|
};
|
|
1471
|
-
exports.
|
|
1474
|
+
exports.getTextSize = getTextSize;
|
|
1472
1475
|
function getCurveFactory(curve, defaultFactory) {
|
|
1473
1476
|
if (defaultFactory === void 0) { defaultFactory = d3_shape_1.curveLinear; }
|
|
1474
1477
|
if (typeof curve === 'function') {
|
|
@@ -1598,17 +1601,28 @@ var createNumericScale = function (scaleType) {
|
|
|
1598
1601
|
return (0, d3_scale_1.scaleLinear)();
|
|
1599
1602
|
}
|
|
1600
1603
|
};
|
|
1601
|
-
var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType) {
|
|
1604
|
+
var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType, userMinVal, userMaxVal) {
|
|
1602
1605
|
if (scaleType === 'log') {
|
|
1603
1606
|
return {
|
|
1604
1607
|
start: minVal * 0.5,
|
|
1605
1608
|
end: maxVal,
|
|
1606
1609
|
};
|
|
1607
1610
|
}
|
|
1608
|
-
|
|
1611
|
+
/* if user explicitly sets userMinVal or userMaxVal, we will check that to avoid excessive padding on either
|
|
1612
|
+
side.If the difference between minVal and userMinVal is more than 10% of the data range, we set padding
|
|
1613
|
+
to 0 on that side. this is to avoid cases where userMinVal is significantly smaller than minVal or
|
|
1614
|
+
userMaxVal is significantly larger than maxVal, which would lead to excessive padding. In other cases,
|
|
1615
|
+
we apply the default 10% padding on both sides.
|
|
1616
|
+
*/
|
|
1617
|
+
var rangePadding = (maxVal - minVal) * 0.1;
|
|
1618
|
+
// If explicit bounds are set and they're far from the data range, don't add extra padding
|
|
1619
|
+
var paddingAlreadySatisfiedAtMin = userMinVal !== undefined && rangePadding > Math.abs(minVal - Math.min(minVal, userMinVal));
|
|
1620
|
+
var paddingAlreadySatisfiedAtMax = userMaxVal !== undefined && rangePadding > Math.abs(maxVal - Math.max(maxVal, userMaxVal));
|
|
1621
|
+
var startPadding = paddingAlreadySatisfiedAtMin ? 0 : rangePadding;
|
|
1622
|
+
var endPadding = paddingAlreadySatisfiedAtMax ? 0 : rangePadding;
|
|
1609
1623
|
return {
|
|
1610
|
-
start:
|
|
1611
|
-
end:
|
|
1624
|
+
start: startPadding,
|
|
1625
|
+
end: endPadding,
|
|
1612
1626
|
};
|
|
1613
1627
|
};
|
|
1614
1628
|
exports.getDomainPaddingForMarkers = getDomainPaddingForMarkers;
|
|
@@ -1729,6 +1743,7 @@ var generateNumericTicks = function (scaleType, tickStep, tick0, scaleDomain) {
|
|
|
1729
1743
|
return (0, exports.generateLinearTicks)(refTick, tickStep, scaleDomain);
|
|
1730
1744
|
}
|
|
1731
1745
|
};
|
|
1746
|
+
exports.generateNumericTicks = generateNumericTicks;
|
|
1732
1747
|
var generateDateTicks = function (tickStep, tick0, scaleDomain, useUTC) {
|
|
1733
1748
|
var refTick = tick0 instanceof Date ? tick0 : new Date(exports.DEFAULT_DATE_STRING);
|
|
1734
1749
|
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
@@ -1742,6 +1757,7 @@ var generateDateTicks = function (tickStep, tick0, scaleDomain, useUTC) {
|
|
|
1742
1757
|
}
|
|
1743
1758
|
}
|
|
1744
1759
|
};
|
|
1760
|
+
exports.generateDateTicks = generateDateTicks;
|
|
1745
1761
|
var findCalloutPoints = function (calloutPointsByX, x) {
|
|
1746
1762
|
if (x === null) {
|
|
1747
1763
|
return undefined;
|
|
@@ -1756,4 +1772,113 @@ var findCalloutPoints = function (calloutPointsByX, x) {
|
|
|
1756
1772
|
};
|
|
1757
1773
|
};
|
|
1758
1774
|
exports.findCalloutPoints = findCalloutPoints;
|
|
1775
|
+
var autoLayoutXAxisLabels = function (tickValues, tickLabels, scale, axisNode, containerWidth, container) {
|
|
1776
|
+
var _a;
|
|
1777
|
+
var requiresWrap = false;
|
|
1778
|
+
var requiresTruncate = false;
|
|
1779
|
+
var maxWidths = [];
|
|
1780
|
+
var _b = scale.range(), rangeStart = _b[0], rangeEnd = _b[1];
|
|
1781
|
+
var isRTL = rangeEnd - rangeStart < 0;
|
|
1782
|
+
var start = isRTL ? containerWidth : 0;
|
|
1783
|
+
var end = isRTL ? 0 : containerWidth;
|
|
1784
|
+
var getTickPosition = function (index) {
|
|
1785
|
+
var _a;
|
|
1786
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1787
|
+
return ((_a = scale(tickValues[index])) !== null && _a !== void 0 ? _a : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1788
|
+
};
|
|
1789
|
+
var getLabelWidth = function (text) {
|
|
1790
|
+
return (0, exports.getTextSize)(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
1791
|
+
};
|
|
1792
|
+
for (var i = 0; i < tickValues.length; i++) {
|
|
1793
|
+
var position = getTickPosition(i);
|
|
1794
|
+
var leftSpace = Math.abs(i > 0 ? (position - getTickPosition(i - 1)) / 2 : position - start);
|
|
1795
|
+
var rightSpace = Math.abs(i + 1 < tickValues.length ? (getTickPosition(i + 1) - position) / 2 : end - position);
|
|
1796
|
+
var maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1797
|
+
var label = tickLabels[i];
|
|
1798
|
+
var labelWidth = getLabelWidth(label);
|
|
1799
|
+
maxWidths.push(maxAvailableWidth);
|
|
1800
|
+
if (labelWidth > maxAvailableWidth) {
|
|
1801
|
+
var longestWordWidth = Math.max.apply(Math, label.split(/\s+/).map(function (word) { return getLabelWidth(word); }));
|
|
1802
|
+
if (longestWordWidth <= maxAvailableWidth) {
|
|
1803
|
+
requiresWrap = true;
|
|
1804
|
+
}
|
|
1805
|
+
else {
|
|
1806
|
+
requiresTruncate = true;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
if (requiresTruncate) {
|
|
1811
|
+
return truncateAndStaggerXAxisLabels(tickValues, tickLabels, scale, axisNode, containerWidth, container);
|
|
1812
|
+
}
|
|
1813
|
+
if (requiresWrap) {
|
|
1814
|
+
return ((_a = createWrapOfXLabels({
|
|
1815
|
+
node: axisNode,
|
|
1816
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1817
|
+
xAxis: scale,
|
|
1818
|
+
noOfCharsToTruncate: 100,
|
|
1819
|
+
showXAxisLablesTooltip: false,
|
|
1820
|
+
width: maxWidths,
|
|
1821
|
+
container: container,
|
|
1822
|
+
})) !== null && _a !== void 0 ? _a : 0);
|
|
1823
|
+
}
|
|
1824
|
+
return 0;
|
|
1825
|
+
};
|
|
1826
|
+
exports.autoLayoutXAxisLabels = autoLayoutXAxisLabels;
|
|
1827
|
+
var truncateAndStaggerXAxisLabels = function (tickValues, tickLabels, scale, axisNode, containerWidth, container) {
|
|
1828
|
+
if (!axisNode) {
|
|
1829
|
+
return 0;
|
|
1830
|
+
}
|
|
1831
|
+
var maxHeight = 12;
|
|
1832
|
+
var _a = scale.range(), rangeStart = _a[0], rangeEnd = _a[1];
|
|
1833
|
+
var isRTL = rangeEnd - rangeStart < 0;
|
|
1834
|
+
var start = isRTL ? containerWidth : 0;
|
|
1835
|
+
var end = isRTL ? 0 : containerWidth;
|
|
1836
|
+
var getTickPosition = function (index) {
|
|
1837
|
+
var _a;
|
|
1838
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1839
|
+
return ((_a = scale(tickValues[index])) !== null && _a !== void 0 ? _a : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1840
|
+
};
|
|
1841
|
+
var getLabelSize = function (text) {
|
|
1842
|
+
return (0, exports.getTextSize)(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container);
|
|
1843
|
+
};
|
|
1844
|
+
(0, d3_selection_1.select)(axisNode)
|
|
1845
|
+
.selectAll('.tick text')
|
|
1846
|
+
.each(function (_, i) {
|
|
1847
|
+
var position = getTickPosition(i);
|
|
1848
|
+
var leftSpace = Math.abs(i > 0 ? position - getTickPosition(i - 1) : position - start);
|
|
1849
|
+
var rightSpace = Math.abs(i + 1 < tickValues.length ? getTickPosition(i + 1) - position : end - position);
|
|
1850
|
+
var maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1851
|
+
var label = tickLabels[i];
|
|
1852
|
+
var textNode = (0, d3_selection_1.select)(this).text(null).attr('data-full', label);
|
|
1853
|
+
var lineHeight = 1.1; // ems
|
|
1854
|
+
var y = textNode.attr('y');
|
|
1855
|
+
var dy = parseFloat(textNode.attr('dy'));
|
|
1856
|
+
textNode
|
|
1857
|
+
.append('tspan')
|
|
1858
|
+
.attr('x', 0)
|
|
1859
|
+
.attr('y', y)
|
|
1860
|
+
.attr('dy', (i % 2 === 1 ? lineHeight : 0) + dy + 'em')
|
|
1861
|
+
.text(truncateTextToFitWidth(label, maxAvailableWidth, function (s) { return getLabelSize(s).width; }));
|
|
1862
|
+
maxHeight = Math.max(maxHeight, getLabelSize(label).height);
|
|
1863
|
+
});
|
|
1864
|
+
return tickValues.length > 1 ? maxHeight : 0;
|
|
1865
|
+
};
|
|
1866
|
+
var truncateTextToFitWidth = function (text, maxWidth, measure) {
|
|
1867
|
+
if (measure(text) <= maxWidth) {
|
|
1868
|
+
return text;
|
|
1869
|
+
}
|
|
1870
|
+
var lo = 1;
|
|
1871
|
+
var hi = text.length;
|
|
1872
|
+
while (lo < hi) {
|
|
1873
|
+
var mid = Math.floor((lo + hi + 1) / 2);
|
|
1874
|
+
var candidate = text.slice(0, mid) + '...';
|
|
1875
|
+
if (measure(candidate) <= maxWidth) {
|
|
1876
|
+
lo = mid;
|
|
1877
|
+
}
|
|
1878
|
+
else {
|
|
1879
|
+
hi = mid - 1;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
return text.slice(0, lo) + '...';
|
|
1883
|
+
};
|
|
1759
1884
|
//# sourceMappingURL=utilities.js.map
|