@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
|
@@ -2,7 +2,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
2
2
|
"use strict";
|
|
3
3
|
var _a;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.findCalloutPoints = exports.generateMonthlyTicks = exports.generateLinearTicks = exports.getRangeForScatterMarkerSize = exports.getScatterXDomainExtent = exports.isPlottable = exports.isValidDomainValue = exports.getDomainPaddingForMarkers = exports.getInvertedTextColor = exports.sortAxisCategories = exports.truncateString = exports.
|
|
5
|
+
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;
|
|
6
6
|
exports.defaultYAxisTickFormatter = defaultYAxisTickFormatter;
|
|
7
7
|
exports.createNumericXAxis = createNumericXAxis;
|
|
8
8
|
exports.getDateFormatLevel = getDateFormatLevel;
|
|
@@ -44,6 +44,8 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
44
44
|
exports.MIN_DOMAIN_MARGIN = 8;
|
|
45
45
|
exports.MIN_DONUT_RADIUS = 1;
|
|
46
46
|
exports.DEFAULT_DATE_STRING = '2000-01-01';
|
|
47
|
+
exports.CARTESIAN_XAXIS_CLASSNAME = 'fui-cart__xAxis';
|
|
48
|
+
var CARTESIAN_XAXIS_TEXT_SELECTOR = ".".concat(exports.CARTESIAN_XAXIS_CLASSNAME, " text");
|
|
47
49
|
var ChartTypes;
|
|
48
50
|
(function (ChartTypes) {
|
|
49
51
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
@@ -102,8 +104,12 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
102
104
|
*/
|
|
103
105
|
function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType) {
|
|
104
106
|
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;
|
|
107
|
+
var dStartValue = domainNRangeValues.dStartValue;
|
|
108
|
+
var dEndValue = domainNRangeValues.dEndValue;
|
|
109
|
+
var finalXmin = xAxisParams.xMinValue !== undefined ? Math.min(dStartValue, xAxisParams.xMinValue) : dStartValue;
|
|
110
|
+
var finalXmax = xAxisParams.xMaxValue !== undefined ? Math.max(dEndValue, xAxisParams.xMaxValue) : dEndValue;
|
|
105
111
|
var xAxisScale = createNumericScale(scaleType)
|
|
106
|
-
.domain([
|
|
112
|
+
.domain([finalXmin, finalXmax])
|
|
107
113
|
.range([domainNRangeValues.rStartValue, domainNRangeValues.rEndValue]);
|
|
108
114
|
showRoundOffXTickValues && xAxisScale.nice();
|
|
109
115
|
var tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
|
|
@@ -117,7 +123,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
117
123
|
var xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
|
|
118
124
|
return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
|
|
119
125
|
};
|
|
120
|
-
if (hideTickOverlap
|
|
126
|
+
if (hideTickOverlap) {
|
|
121
127
|
var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(function (v, i) { return tickFormat(v, i); })) + 20;
|
|
122
128
|
var _d = xAxisScale.range(), start = _d[0], end = _d[1];
|
|
123
129
|
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
@@ -135,7 +141,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
135
141
|
customTickValues = tickParams.tickValues;
|
|
136
142
|
}
|
|
137
143
|
else if (tickStep) {
|
|
138
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
144
|
+
customTickValues = (0, exports.generateNumericTicks)(scaleType, tickStep, tick0, xAxisScale.domain());
|
|
139
145
|
}
|
|
140
146
|
if (customTickValues) {
|
|
141
147
|
xAxis.tickValues(customTickValues);
|
|
@@ -143,8 +149,8 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
143
149
|
if (xAxisElement) {
|
|
144
150
|
(0, d3_selection_1.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
145
151
|
}
|
|
146
|
-
var tickValues =
|
|
147
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
152
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
153
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
148
154
|
}
|
|
149
155
|
/**
|
|
150
156
|
* This function returns a multilevel formatter for a given date range.
|
|
@@ -249,7 +255,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
249
255
|
* @param {ITickParams} tickParams
|
|
250
256
|
*/
|
|
251
257
|
function createDateXAxis(xAxisParams, tickParams, culture, options, timeFormatLocale, customDateTimeFormatter, useUTC, chartType) {
|
|
252
|
-
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;
|
|
258
|
+
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;
|
|
253
259
|
var xAxisScale = useUTC ? (0, d3_scale_1.scaleUtc)() : (0, d3_scale_1.scaleTime)();
|
|
254
260
|
xAxisScale
|
|
255
261
|
.domain([domainNRangeValues.dStartValue, domainNRangeValues.dEndValue])
|
|
@@ -290,10 +296,11 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
290
296
|
}
|
|
291
297
|
return (0, chart_utilities_1.formatDateToLocaleString)(domainValue, culture, useUTC, false, formatOptions);
|
|
292
298
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
299
|
+
if (hideTickOverlap) {
|
|
300
|
+
var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 40;
|
|
301
|
+
var _c = xAxisScale.range(), start = _c[0], end = _c[1];
|
|
302
|
+
tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
|
|
303
|
+
}
|
|
297
304
|
var xAxis = (0, d3_axis_1.axisBottom)(xAxisScale)
|
|
298
305
|
.tickSize(xAxistickSize)
|
|
299
306
|
.tickPadding(tickPadding)
|
|
@@ -307,7 +314,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
307
314
|
customTickValues = tickParams.tickValues;
|
|
308
315
|
}
|
|
309
316
|
else if (tickStep) {
|
|
310
|
-
customTickValues = generateDateTicks(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
317
|
+
customTickValues = (0, exports.generateDateTicks)(tickStep, tick0, xAxisScale.domain(), useUTC);
|
|
311
318
|
}
|
|
312
319
|
if (customTickValues) {
|
|
313
320
|
xAxis.tickValues(customTickValues);
|
|
@@ -315,8 +322,8 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
315
322
|
if (xAxisElement) {
|
|
316
323
|
(0, d3_selection_1.select)(xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
317
324
|
}
|
|
318
|
-
var tickValues =
|
|
319
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
325
|
+
var tickValues = customTickValues !== null && customTickValues !== void 0 ? customTickValues : xAxisScale.ticks(tickCount);
|
|
326
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
320
327
|
}
|
|
321
328
|
/**
|
|
322
329
|
* Create String X axis
|
|
@@ -378,7 +385,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
378
385
|
if (xAxisParams.xAxisElement) {
|
|
379
386
|
(0, d3_selection_1.select)(xAxisParams.xAxisElement).call(xAxis).selectAll('text').attr('aria-hidden', 'true');
|
|
380
387
|
}
|
|
381
|
-
return { xScale: xAxisScale, tickValues: tickValues };
|
|
388
|
+
return { xScale: xAxisScale, tickValues: tickValues, tickLabels: tickValues.map(xAxis.tickFormat()) };
|
|
382
389
|
}
|
|
383
390
|
/**
|
|
384
391
|
* This method is used to calculate the rounded tick values for the y-axis
|
|
@@ -472,7 +479,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
472
479
|
customTickValues = tickValues;
|
|
473
480
|
}
|
|
474
481
|
else if (tickStep) {
|
|
475
|
-
customTickValues = generateNumericTicks(undefined, tickStep, tick0, yAxisScale.domain());
|
|
482
|
+
customTickValues = (0, exports.generateNumericTicks)(undefined, tickStep, tick0, yAxisScale.domain());
|
|
476
483
|
}
|
|
477
484
|
if (customTickValues) {
|
|
478
485
|
yAxis.tickValues(customTickValues);
|
|
@@ -519,7 +526,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
519
526
|
customTickValues = tickValues;
|
|
520
527
|
}
|
|
521
528
|
else if (tickStep) {
|
|
522
|
-
customTickValues = generateNumericTicks(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
529
|
+
customTickValues = (0, exports.generateNumericTicks)(scaleType, tickStep, tick0, yAxisScale.domain());
|
|
523
530
|
}
|
|
524
531
|
if (customTickValues) {
|
|
525
532
|
yAxis.tickValues(customTickValues);
|
|
@@ -704,14 +711,15 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
704
711
|
* @returns
|
|
705
712
|
*/
|
|
706
713
|
function createWrapOfXLabels(wrapLabelProps) {
|
|
707
|
-
var
|
|
714
|
+
var _a, _b;
|
|
715
|
+
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;
|
|
708
716
|
if (node === null) {
|
|
709
717
|
return;
|
|
710
718
|
}
|
|
711
719
|
var axisNode = (0, d3_selection_1.select)(node).call(xAxis);
|
|
712
720
|
var removeVal = 0;
|
|
713
721
|
var maxLines = 1;
|
|
714
|
-
axisNode.selectAll('.tick text').each(function () {
|
|
722
|
+
axisNode.selectAll('.tick text').each(function (_, tickIndex) {
|
|
715
723
|
var text = (0, d3_selection_1.select)(this);
|
|
716
724
|
var totalWord = text.text();
|
|
717
725
|
var truncatedWord = "".concat(text.text().slice(0, noOfCharsToTruncate), "...");
|
|
@@ -725,41 +733,27 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
725
733
|
var dy = parseFloat(text.attr('dy'));
|
|
726
734
|
var tspan = text
|
|
727
735
|
.text(null)
|
|
736
|
+
.attr('data-full', totalWord)
|
|
728
737
|
.append('tspan')
|
|
729
738
|
.attr('x', 0)
|
|
730
739
|
.attr('y', y)
|
|
731
|
-
.attr('
|
|
732
|
-
|
|
733
|
-
.
|
|
734
|
-
if (showXAxisLablesTooltip && totalWordLength > noOfCharsToTruncate) {
|
|
735
|
-
tspan = text
|
|
736
|
-
.append('tspan')
|
|
737
|
-
.attr('id', 'showDots')
|
|
738
|
-
.attr('x', 0)
|
|
739
|
-
.attr('y', y)
|
|
740
|
-
.attr('dy', dy + 'em')
|
|
741
|
-
.text(truncatedWord);
|
|
742
|
-
}
|
|
743
|
-
else if (showXAxisLablesTooltip && totalWordLength <= noOfCharsToTruncate) {
|
|
744
|
-
tspan = text
|
|
745
|
-
.append('tspan')
|
|
746
|
-
.attr('id', 'LessLength')
|
|
747
|
-
.attr('x', 0)
|
|
748
|
-
.attr('y', y)
|
|
749
|
-
.attr('dy', dy + 'em')
|
|
750
|
-
.text(totalWord);
|
|
740
|
+
.attr('dy', dy + 'em');
|
|
741
|
+
if (showXAxisLablesTooltip) {
|
|
742
|
+
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
751
743
|
}
|
|
752
744
|
else {
|
|
745
|
+
var maxWidth = Array.isArray(width) ? width[tickIndex] : width;
|
|
753
746
|
while ((word = words.pop())) {
|
|
754
747
|
line.push(word);
|
|
755
|
-
|
|
756
|
-
|
|
748
|
+
var label = line.join(' ');
|
|
749
|
+
tspan.text(label);
|
|
750
|
+
var labelWidth = (0, exports.getTextSize)(label, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
751
|
+
if (labelWidth > maxWidth && line.length > 1) {
|
|
757
752
|
line.pop();
|
|
758
753
|
tspan.text(line.join(' '));
|
|
759
754
|
line = [word];
|
|
760
755
|
tspan = text
|
|
761
756
|
.append('tspan')
|
|
762
|
-
.attr('id', 'WordBreakId')
|
|
763
757
|
.attr('x', 0)
|
|
764
758
|
.attr('y', y)
|
|
765
759
|
.attr('dy', ++lineNumber * lineHeight + dy + 'em')
|
|
@@ -771,10 +765,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
771
765
|
});
|
|
772
766
|
if (!showXAxisLablesTooltip) {
|
|
773
767
|
var maxHeight = 12; // intial value to render corretly first time
|
|
774
|
-
|
|
775
|
-
var outerHTMLElement = document.getElementById('WordBreakId');
|
|
776
|
-
var BoxCordinates = outerHTMLElement && outerHTMLElement.getBoundingClientRect();
|
|
777
|
-
var boxHeight = BoxCordinates && BoxCordinates.height;
|
|
768
|
+
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;
|
|
778
769
|
if (boxHeight > maxHeight) {
|
|
779
770
|
maxHeight = boxHeight;
|
|
780
771
|
}
|
|
@@ -799,53 +790,35 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
799
790
|
? "...".concat(text.text().slice(0, noOfCharsToTruncate))
|
|
800
791
|
: "".concat(text.text().slice(0, noOfCharsToTruncate), "...");
|
|
801
792
|
var totalWordLength = text.text().length;
|
|
802
|
-
var padding = 0; // ems
|
|
803
793
|
var y = text.attr('y');
|
|
804
794
|
var x = text.attr('x');
|
|
805
795
|
var dy = parseFloat(text.attr('dy'));
|
|
806
|
-
var
|
|
807
|
-
text
|
|
796
|
+
var tspan = text
|
|
808
797
|
.text(null)
|
|
798
|
+
.attr('data-full', totalWord)
|
|
809
799
|
.append('tspan')
|
|
810
800
|
.attr('x', x)
|
|
811
801
|
.attr('y', y)
|
|
812
|
-
.attr('
|
|
813
|
-
|
|
814
|
-
.
|
|
815
|
-
if (truncateLabel && totalWordLength > noOfCharsToTruncate) {
|
|
816
|
-
text
|
|
817
|
-
.append('tspan')
|
|
818
|
-
.attr('id', 'showDots')
|
|
819
|
-
.attr('x', x)
|
|
820
|
-
.attr('y', y)
|
|
821
|
-
.attr('dy', dy + 'em')
|
|
822
|
-
.attr('dx', padding + dx + 'em')
|
|
823
|
-
.text(truncatedWord);
|
|
824
|
-
}
|
|
825
|
-
else {
|
|
826
|
-
text
|
|
827
|
-
.append('tspan')
|
|
828
|
-
.attr('id', 'LessLength')
|
|
829
|
-
.attr('x', x)
|
|
830
|
-
.attr('y', y)
|
|
831
|
-
.attr('dx', padding + dx + 'em')
|
|
832
|
-
.text(totalWord);
|
|
802
|
+
.attr('dy', dy + 'em');
|
|
803
|
+
if (truncateLabel) {
|
|
804
|
+
tspan.text(totalWordLength > noOfCharsToTruncate ? truncatedWord : totalWord);
|
|
833
805
|
}
|
|
834
806
|
});
|
|
835
807
|
}
|
|
836
808
|
var wrapContent = function (content, id, maxWidth) {
|
|
837
809
|
var textElement = (0, d3_selection_1.select)("#".concat(id));
|
|
838
810
|
textElement.text(content);
|
|
839
|
-
|
|
811
|
+
var node = textElement.node();
|
|
812
|
+
if (!node || typeof node.getComputedTextLength !== 'function') {
|
|
840
813
|
return false;
|
|
841
814
|
}
|
|
842
815
|
var isOverflowing = false;
|
|
843
|
-
var textLength =
|
|
816
|
+
var textLength = node.getComputedTextLength();
|
|
844
817
|
while (textLength > maxWidth && content.length > 0) {
|
|
845
818
|
content = content.slice(0, -1);
|
|
846
819
|
textElement.text(content + '...');
|
|
847
820
|
isOverflowing = true;
|
|
848
|
-
textLength =
|
|
821
|
+
textLength = node.getComputedTextLength();
|
|
849
822
|
}
|
|
850
823
|
return isOverflowing;
|
|
851
824
|
};
|
|
@@ -884,38 +857,41 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
884
857
|
*/
|
|
885
858
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
886
859
|
function tooltipOfAxislabels(axistooltipProps) {
|
|
887
|
-
var tooltipCls = axistooltipProps.tooltipCls, axis = axistooltipProps.axis, id = axistooltipProps.id;
|
|
860
|
+
var tooltipCls = axistooltipProps.tooltipCls, axis = axistooltipProps.axis, id = axistooltipProps.id, container = axistooltipProps.container;
|
|
888
861
|
if (axis === null) {
|
|
889
862
|
return null;
|
|
890
863
|
}
|
|
891
|
-
var div = (0, d3_selection_1.select)(
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
var
|
|
903
|
-
|
|
864
|
+
var div = (container ? (0, d3_selection_1.select)(container) : (0, d3_selection_1.select)('body'))
|
|
865
|
+
.append('div')
|
|
866
|
+
.attr('id', id)
|
|
867
|
+
.attr('class', tooltipCls)
|
|
868
|
+
.style('opacity', 0);
|
|
869
|
+
axis.selectAll('.tick text').each(function () {
|
|
870
|
+
var tickSelection = (0, d3_selection_1.select)(this);
|
|
871
|
+
var fullLabel = tickSelection.attr('data-full');
|
|
872
|
+
if (tickSelection.text() === fullLabel) {
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
var tickEl = this;
|
|
876
|
+
tickSelection
|
|
904
877
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
905
878
|
.on('mouseover', function (event, d) {
|
|
906
|
-
|
|
879
|
+
var _a;
|
|
880
|
+
var containerBounds = container === null || container === void 0 ? void 0 : container.getBoundingClientRect();
|
|
881
|
+
var tickBounds = tickEl.getBoundingClientRect();
|
|
882
|
+
var tooltipBottom = containerBounds ? containerBounds.bottom - (tickBounds.top - 4) : tickBounds.top - 4;
|
|
883
|
+
var tooltipLeft = (tickBounds.left + tickBounds.right) / 2 - ((_a = containerBounds === null || containerBounds === void 0 ? void 0 : containerBounds.left) !== null && _a !== void 0 ? _a : 0);
|
|
907
884
|
div
|
|
908
|
-
.text(
|
|
909
|
-
.style('
|
|
910
|
-
.style('
|
|
885
|
+
.text(fullLabel)
|
|
886
|
+
.style('bottom', "".concat(tooltipBottom, "px"))
|
|
887
|
+
.style('left', "".concat(tooltipLeft, "px"))
|
|
888
|
+
.style('transform', 'translateX(-50%)')
|
|
889
|
+
.style('opacity', 0.9);
|
|
911
890
|
})
|
|
912
891
|
.on('mouseout', function (d) {
|
|
913
892
|
div.style('opacity', 0);
|
|
914
893
|
});
|
|
915
|
-
};
|
|
916
|
-
for (var i = 0; i < tickObjectLength; i++) {
|
|
917
|
-
_loop_1(i);
|
|
918
|
-
}
|
|
894
|
+
});
|
|
919
895
|
}
|
|
920
896
|
/**
|
|
921
897
|
* Find the axis type of line chart and area chart from given data
|
|
@@ -943,11 +919,11 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
943
919
|
* @param {boolean} isRTL
|
|
944
920
|
* @returns {IDomainNRange}
|
|
945
921
|
*/
|
|
946
|
-
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode) {
|
|
922
|
+
function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode, xMinVal, xMaxVal) {
|
|
947
923
|
var isScatterPolar = isScatterPolarSeries(points);
|
|
948
924
|
var _a = (0, exports.getScatterXDomainExtent)(points, scaleType), xMin = _a[0], xMax = _a[1];
|
|
949
925
|
if (hasMarkersMode) {
|
|
950
|
-
var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType);
|
|
926
|
+
var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType, xMinVal, xMaxVal);
|
|
951
927
|
xMin = xMin - xPadding.start;
|
|
952
928
|
xMax = xMax + xPadding.end;
|
|
953
929
|
}
|
|
@@ -1407,8 +1383,8 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1407
1383
|
return true;
|
|
1408
1384
|
}
|
|
1409
1385
|
var cssVarRegExp = /var\((--[a-zA-Z0-9\-]+)\)/g;
|
|
1410
|
-
function resolveCSSVariables(
|
|
1411
|
-
var containerStyles = getComputedStyle(
|
|
1386
|
+
function resolveCSSVariables(container, styleRules) {
|
|
1387
|
+
var containerStyles = getComputedStyle(container);
|
|
1412
1388
|
return styleRules.replace(cssVarRegExp, function (match, group1) {
|
|
1413
1389
|
return containerStyles.getPropertyValue(group1);
|
|
1414
1390
|
});
|
|
@@ -1437,26 +1413,53 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1437
1413
|
border: 'none',
|
|
1438
1414
|
whiteSpace: 'pre',
|
|
1439
1415
|
};
|
|
1440
|
-
var MEASUREMENT_SPAN_ID =
|
|
1441
|
-
var
|
|
1416
|
+
var MEASUREMENT_SPAN_ID = 'fui_measurement_span';
|
|
1417
|
+
var TEXT_STYLE_PROPERTIES = [
|
|
1418
|
+
'font-size',
|
|
1419
|
+
'font-family',
|
|
1420
|
+
'font-weight',
|
|
1421
|
+
'font-style',
|
|
1422
|
+
'letter-spacing',
|
|
1423
|
+
'text-transform',
|
|
1424
|
+
];
|
|
1425
|
+
var measureTextWithDOM = function (text, cssSelector, container) {
|
|
1442
1426
|
var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
|
|
1443
1427
|
if (!measurementSpan) {
|
|
1444
1428
|
measurementSpan = document.createElement('span');
|
|
1445
1429
|
measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
|
|
1446
1430
|
measurementSpan.setAttribute('aria-hidden', 'true');
|
|
1447
|
-
|
|
1448
|
-
parentElement.appendChild(measurementSpan);
|
|
1449
|
-
}
|
|
1450
|
-
else {
|
|
1451
|
-
document.body.appendChild(measurementSpan);
|
|
1452
|
-
}
|
|
1431
|
+
(container !== null && container !== void 0 ? container : document.body).appendChild(measurementSpan);
|
|
1453
1432
|
}
|
|
1454
|
-
measurementSpan.setAttribute('class', className);
|
|
1455
1433
|
Object.assign(measurementSpan.style, MEASUREMENT_SPAN_STYLE);
|
|
1434
|
+
var refEl = (container !== null && container !== void 0 ? container : document).querySelector(cssSelector);
|
|
1435
|
+
if (refEl) {
|
|
1436
|
+
copyStyle(TEXT_STYLE_PROPERTIES, refEl, measurementSpan);
|
|
1437
|
+
}
|
|
1456
1438
|
measurementSpan.textContent = "".concat(text);
|
|
1457
|
-
|
|
1439
|
+
var rect = measurementSpan.getBoundingClientRect();
|
|
1440
|
+
return { node: measurementSpan, width: rect.width, height: rect.height };
|
|
1441
|
+
};
|
|
1442
|
+
exports.measureTextWithDOM = measureTextWithDOM;
|
|
1443
|
+
var CACHE_SIZE = 2000;
|
|
1444
|
+
var textSizeCache = new Map();
|
|
1445
|
+
var getTextSize = function (text, cssSelector, container) {
|
|
1446
|
+
var cacheKey = "".concat(text, "|").concat(cssSelector);
|
|
1447
|
+
var cachedResult = textSizeCache.get(cacheKey);
|
|
1448
|
+
if (cachedResult) {
|
|
1449
|
+
return cachedResult;
|
|
1450
|
+
}
|
|
1451
|
+
var _a = (0, exports.measureTextWithDOM)(text, cssSelector, container), width = _a.width, height = _a.height;
|
|
1452
|
+
// TODO: Improve cache eviction strategy if needed (e.g., LRU)
|
|
1453
|
+
if (textSizeCache.size >= CACHE_SIZE) {
|
|
1454
|
+
var firstKey = textSizeCache.keys().next().value;
|
|
1455
|
+
if (!(0, chart_utilities_1.isInvalidValue)(firstKey)) {
|
|
1456
|
+
textSizeCache.delete(firstKey);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
textSizeCache.set(cacheKey, { width: width, height: height });
|
|
1460
|
+
return { width: width, height: height };
|
|
1458
1461
|
};
|
|
1459
|
-
exports.
|
|
1462
|
+
exports.getTextSize = getTextSize;
|
|
1460
1463
|
function getCurveFactory(curve, defaultFactory) {
|
|
1461
1464
|
if (defaultFactory === void 0) { defaultFactory = d3_shape_1.curveLinear; }
|
|
1462
1465
|
if (typeof curve === 'function') {
|
|
@@ -1586,17 +1589,28 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1586
1589
|
return (0, d3_scale_1.scaleLinear)();
|
|
1587
1590
|
}
|
|
1588
1591
|
};
|
|
1589
|
-
var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType) {
|
|
1592
|
+
var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType, userMinVal, userMaxVal) {
|
|
1590
1593
|
if (scaleType === 'log') {
|
|
1591
1594
|
return {
|
|
1592
1595
|
start: minVal * 0.5,
|
|
1593
1596
|
end: maxVal,
|
|
1594
1597
|
};
|
|
1595
1598
|
}
|
|
1596
|
-
|
|
1599
|
+
/* if user explicitly sets userMinVal or userMaxVal, we will check that to avoid excessive padding on either
|
|
1600
|
+
side.If the difference between minVal and userMinVal is more than 10% of the data range, we set padding
|
|
1601
|
+
to 0 on that side. this is to avoid cases where userMinVal is significantly smaller than minVal or
|
|
1602
|
+
userMaxVal is significantly larger than maxVal, which would lead to excessive padding. In other cases,
|
|
1603
|
+
we apply the default 10% padding on both sides.
|
|
1604
|
+
*/
|
|
1605
|
+
var rangePadding = (maxVal - minVal) * 0.1;
|
|
1606
|
+
// If explicit bounds are set and they're far from the data range, don't add extra padding
|
|
1607
|
+
var paddingAlreadySatisfiedAtMin = userMinVal !== undefined && rangePadding > Math.abs(minVal - Math.min(minVal, userMinVal));
|
|
1608
|
+
var paddingAlreadySatisfiedAtMax = userMaxVal !== undefined && rangePadding > Math.abs(maxVal - Math.max(maxVal, userMaxVal));
|
|
1609
|
+
var startPadding = paddingAlreadySatisfiedAtMin ? 0 : rangePadding;
|
|
1610
|
+
var endPadding = paddingAlreadySatisfiedAtMax ? 0 : rangePadding;
|
|
1597
1611
|
return {
|
|
1598
|
-
start:
|
|
1599
|
-
end:
|
|
1612
|
+
start: startPadding,
|
|
1613
|
+
end: endPadding,
|
|
1600
1614
|
};
|
|
1601
1615
|
};
|
|
1602
1616
|
exports.getDomainPaddingForMarkers = getDomainPaddingForMarkers;
|
|
@@ -1717,6 +1731,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1717
1731
|
return (0, exports.generateLinearTicks)(refTick, tickStep, scaleDomain);
|
|
1718
1732
|
}
|
|
1719
1733
|
};
|
|
1734
|
+
exports.generateNumericTicks = generateNumericTicks;
|
|
1720
1735
|
var generateDateTicks = function (tickStep, tick0, scaleDomain, useUTC) {
|
|
1721
1736
|
var refTick = tick0 instanceof Date ? tick0 : new Date(exports.DEFAULT_DATE_STRING);
|
|
1722
1737
|
if (typeof tickStep === 'number' && tickStep > 0) {
|
|
@@ -1730,6 +1745,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1730
1745
|
}
|
|
1731
1746
|
}
|
|
1732
1747
|
};
|
|
1748
|
+
exports.generateDateTicks = generateDateTicks;
|
|
1733
1749
|
var findCalloutPoints = function (calloutPointsByX, x) {
|
|
1734
1750
|
if (x === null) {
|
|
1735
1751
|
return undefined;
|
|
@@ -1744,5 +1760,114 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
1744
1760
|
};
|
|
1745
1761
|
};
|
|
1746
1762
|
exports.findCalloutPoints = findCalloutPoints;
|
|
1763
|
+
var autoLayoutXAxisLabels = function (tickValues, tickLabels, scale, axisNode, containerWidth, container) {
|
|
1764
|
+
var _a;
|
|
1765
|
+
var requiresWrap = false;
|
|
1766
|
+
var requiresTruncate = false;
|
|
1767
|
+
var maxWidths = [];
|
|
1768
|
+
var _b = scale.range(), rangeStart = _b[0], rangeEnd = _b[1];
|
|
1769
|
+
var isRTL = rangeEnd - rangeStart < 0;
|
|
1770
|
+
var start = isRTL ? containerWidth : 0;
|
|
1771
|
+
var end = isRTL ? 0 : containerWidth;
|
|
1772
|
+
var getTickPosition = function (index) {
|
|
1773
|
+
var _a;
|
|
1774
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1775
|
+
return ((_a = scale(tickValues[index])) !== null && _a !== void 0 ? _a : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1776
|
+
};
|
|
1777
|
+
var getLabelWidth = function (text) {
|
|
1778
|
+
return (0, exports.getTextSize)(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container).width;
|
|
1779
|
+
};
|
|
1780
|
+
for (var i = 0; i < tickValues.length; i++) {
|
|
1781
|
+
var position = getTickPosition(i);
|
|
1782
|
+
var leftSpace = Math.abs(i > 0 ? (position - getTickPosition(i - 1)) / 2 : position - start);
|
|
1783
|
+
var rightSpace = Math.abs(i + 1 < tickValues.length ? (getTickPosition(i + 1) - position) / 2 : end - position);
|
|
1784
|
+
var maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1785
|
+
var label = tickLabels[i];
|
|
1786
|
+
var labelWidth = getLabelWidth(label);
|
|
1787
|
+
maxWidths.push(maxAvailableWidth);
|
|
1788
|
+
if (labelWidth > maxAvailableWidth) {
|
|
1789
|
+
var longestWordWidth = Math.max.apply(Math, label.split(/\s+/).map(function (word) { return getLabelWidth(word); }));
|
|
1790
|
+
if (longestWordWidth <= maxAvailableWidth) {
|
|
1791
|
+
requiresWrap = true;
|
|
1792
|
+
}
|
|
1793
|
+
else {
|
|
1794
|
+
requiresTruncate = true;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
if (requiresTruncate) {
|
|
1799
|
+
return truncateAndStaggerXAxisLabels(tickValues, tickLabels, scale, axisNode, containerWidth, container);
|
|
1800
|
+
}
|
|
1801
|
+
if (requiresWrap) {
|
|
1802
|
+
return ((_a = createWrapOfXLabels({
|
|
1803
|
+
node: axisNode,
|
|
1804
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1805
|
+
xAxis: scale,
|
|
1806
|
+
noOfCharsToTruncate: 100,
|
|
1807
|
+
showXAxisLablesTooltip: false,
|
|
1808
|
+
width: maxWidths,
|
|
1809
|
+
container: container,
|
|
1810
|
+
})) !== null && _a !== void 0 ? _a : 0);
|
|
1811
|
+
}
|
|
1812
|
+
return 0;
|
|
1813
|
+
};
|
|
1814
|
+
exports.autoLayoutXAxisLabels = autoLayoutXAxisLabels;
|
|
1815
|
+
var truncateAndStaggerXAxisLabels = function (tickValues, tickLabels, scale, axisNode, containerWidth, container) {
|
|
1816
|
+
if (!axisNode) {
|
|
1817
|
+
return 0;
|
|
1818
|
+
}
|
|
1819
|
+
var maxHeight = 12;
|
|
1820
|
+
var _a = scale.range(), rangeStart = _a[0], rangeEnd = _a[1];
|
|
1821
|
+
var isRTL = rangeEnd - rangeStart < 0;
|
|
1822
|
+
var start = isRTL ? containerWidth : 0;
|
|
1823
|
+
var end = isRTL ? 0 : containerWidth;
|
|
1824
|
+
var getTickPosition = function (index) {
|
|
1825
|
+
var _a;
|
|
1826
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1827
|
+
return ((_a = scale(tickValues[index])) !== null && _a !== void 0 ? _a : 0) + ('bandwidth' in scale ? scale.bandwidth() / 2 : 0);
|
|
1828
|
+
};
|
|
1829
|
+
var getLabelSize = function (text) {
|
|
1830
|
+
return (0, exports.getTextSize)(text, CARTESIAN_XAXIS_TEXT_SELECTOR, container);
|
|
1831
|
+
};
|
|
1832
|
+
(0, d3_selection_1.select)(axisNode)
|
|
1833
|
+
.selectAll('.tick text')
|
|
1834
|
+
.each(function (_, i) {
|
|
1835
|
+
var position = getTickPosition(i);
|
|
1836
|
+
var leftSpace = Math.abs(i > 0 ? position - getTickPosition(i - 1) : position - start);
|
|
1837
|
+
var rightSpace = Math.abs(i + 1 < tickValues.length ? getTickPosition(i + 1) - position : end - position);
|
|
1838
|
+
var maxAvailableWidth = Math.min(leftSpace, rightSpace) * 2 - 8; // 4px padding on both sides
|
|
1839
|
+
var label = tickLabels[i];
|
|
1840
|
+
var textNode = (0, d3_selection_1.select)(this).text(null).attr('data-full', label);
|
|
1841
|
+
var lineHeight = 1.1; // ems
|
|
1842
|
+
var y = textNode.attr('y');
|
|
1843
|
+
var dy = parseFloat(textNode.attr('dy'));
|
|
1844
|
+
textNode
|
|
1845
|
+
.append('tspan')
|
|
1846
|
+
.attr('x', 0)
|
|
1847
|
+
.attr('y', y)
|
|
1848
|
+
.attr('dy', (i % 2 === 1 ? lineHeight : 0) + dy + 'em')
|
|
1849
|
+
.text(truncateTextToFitWidth(label, maxAvailableWidth, function (s) { return getLabelSize(s).width; }));
|
|
1850
|
+
maxHeight = Math.max(maxHeight, getLabelSize(label).height);
|
|
1851
|
+
});
|
|
1852
|
+
return tickValues.length > 1 ? maxHeight : 0;
|
|
1853
|
+
};
|
|
1854
|
+
var truncateTextToFitWidth = function (text, maxWidth, measure) {
|
|
1855
|
+
if (measure(text) <= maxWidth) {
|
|
1856
|
+
return text;
|
|
1857
|
+
}
|
|
1858
|
+
var lo = 1;
|
|
1859
|
+
var hi = text.length;
|
|
1860
|
+
while (lo < hi) {
|
|
1861
|
+
var mid = Math.floor((lo + hi + 1) / 2);
|
|
1862
|
+
var candidate = text.slice(0, mid) + '...';
|
|
1863
|
+
if (measure(candidate) <= maxWidth) {
|
|
1864
|
+
lo = mid;
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
hi = mid - 1;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
return text.slice(0, lo) + '...';
|
|
1871
|
+
};
|
|
1747
1872
|
});
|
|
1748
1873
|
//# sourceMappingURL=utilities.js.map
|