@fluentui/react-charts 9.1.9 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -2
- package/dist/index.d.ts +348 -11
- package/lib/AreaChart.js.map +1 -1
- package/lib/CartesianChart.js.map +1 -1
- package/lib/DeclarativeChart.js.map +1 -1
- package/lib/DonutChart.js.map +1 -1
- package/lib/FunnelChart.js +1 -0
- package/lib/FunnelChart.js.map +1 -0
- package/lib/GanttChart.js +1 -0
- package/lib/GanttChart.js.map +1 -0
- package/lib/GaugeChart.js.map +1 -1
- package/lib/GroupedVerticalBarChart.js.map +1 -1
- package/lib/HeatMapChart.js.map +1 -1
- package/lib/HorizontalBarChart.js.map +1 -1
- package/lib/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/Legends.js.map +1 -1
- package/lib/LineChart.js.map +1 -1
- package/lib/Popover.js.map +1 -1
- package/lib/ResponsiveContainer.js.map +1 -1
- package/lib/SankeyChart.js.map +1 -1
- package/lib/ScatterChart.js.map +1 -1
- package/lib/Sparkline.js.map +1 -1
- package/lib/VerticalBarChart.js.map +1 -1
- package/lib/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +24 -8
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/AreaChart/index.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +12 -8
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -7
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +44 -13
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/imageExporter.js +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +5 -5
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js +18 -4
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/index.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
- package/lib/components/DonutChart/index.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.js +400 -0
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib/components/FunnelChart/funnelGeometry.js +220 -0
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib/components/FunnelChart/index.js +2 -0
- package/lib/components/FunnelChart/index.js.map +1 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +58 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.js +547 -0
- package/lib/components/GanttChart/GanttChart.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.types.js +4 -0
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib/components/GanttChart/index.js +2 -0
- package/lib/components/GanttChart/index.js.map +1 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +24 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js +9 -2
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/index.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +77 -60
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js +11 -3
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/index.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +5 -3
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +18 -5
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
- package/lib/components/Legends/Legends.js +28 -10
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js +3 -3
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +57 -14
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +23 -9
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js +2 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/index.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +5 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/index.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js +19 -5
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/index.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib/components/Sparkline/index.js.map +1 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +71 -31
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +26 -12
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +3 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/EventAnnotation.js.map +1 -1
- package/lib/types/LegendDataItem.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +2 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/async-utils.js.map +1 -1
- package/lib/utilities/colors.js +12 -0
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/image-export-utils.js +256 -0
- package/lib/utilities/image-export-utils.js.map +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data.js +236 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +140 -27
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js +2 -2
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/AreaChart.js.map +1 -1
- package/lib-commonjs/CartesianChart.js.map +1 -1
- package/lib-commonjs/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/DonutChart.js.map +1 -1
- package/lib-commonjs/FunnelChart.js +6 -0
- package/lib-commonjs/FunnelChart.js.map +1 -0
- package/lib-commonjs/GanttChart.js +6 -0
- package/lib-commonjs/GanttChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js.map +1 -1
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/HeatMapChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/Legends.js.map +1 -1
- package/lib-commonjs/LineChart.js.map +1 -1
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/SankeyChart.js.map +1 -1
- package/lib-commonjs/ScatterChart.js.map +1 -1
- package/lib-commonjs/Sparkline.js.map +1 -1
- package/lib-commonjs/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +23 -7
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib-commonjs/components/AreaChart/index.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +11 -7
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -6
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +47 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +5 -5
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js +17 -3
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +411 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +6 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +248 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/index.js +7 -0
- package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +79 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js +558 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +7 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib-commonjs/components/GanttChart/index.js +7 -0
- package/lib-commonjs/components/GanttChart/index.js.map +1 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +39 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +9 -2
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +77 -60
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +10 -2
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +18 -5
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +28 -10
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Legends/index.js.map +1 -1
- package/lib-commonjs/components/Legends/shape.js +2 -2
- package/lib-commonjs/components/Legends/shape.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +101 -28
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +23 -9
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +2 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-commonjs/components/LineChart/index.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +5 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +18 -4
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib-commonjs/components/Sparkline/index.js.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +71 -31
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +26 -12
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +2 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +3 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/types/EventAnnotation.js.map +1 -1
- package/lib-commonjs/types/LegendDataItem.js.map +1 -1
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/async-utils.js.map +1 -1
- package/lib-commonjs/utilities/colors.js +18 -0
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +274 -0
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
- package/lib-commonjs/utilities/string.js.map +1 -1
- package/lib-commonjs/utilities/test-data.js +245 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +142 -22
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.js +2 -2
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +12 -22
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { create as d3Create, select as d3Select } from 'd3-selection';
|
|
2
|
+
import { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';
|
|
3
|
+
import { LEGEND_CONTAINER_MARGIN_TOP, LEGEND_CONTAINER_MARGIN_START, LEGEND_PADDING, LEGEND_HEIGHT, LEGEND_SHAPE_BORDER, LEGEND_SHAPE_SIZE, LEGEND_SHAPE_MARGIN_END, INACTIVE_LEGEND_TEXT_OPACITY } from '../components/Legends/useLegendsStyles.styles';
|
|
4
|
+
export function toImage(chartContainer, legendsToSvgCallback, isRTL = false, opts = {}) {
|
|
5
|
+
return new Promise((resolve, reject)=>{
|
|
6
|
+
if (!chartContainer) {
|
|
7
|
+
return reject(new Error('Chart container is not defined'));
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const background = typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';
|
|
11
|
+
const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);
|
|
12
|
+
if (!svg.node) {
|
|
13
|
+
return reject(new Error('SVG node is null'));
|
|
14
|
+
}
|
|
15
|
+
let svgData = new XMLSerializer().serializeToString(svg.node);
|
|
16
|
+
// This node is already detached from the DOM, so there's no need to call remove() on it.
|
|
17
|
+
// Just clear the reference.
|
|
18
|
+
svg.node = null;
|
|
19
|
+
let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
svgData = null;
|
|
22
|
+
svgToPng(svgDataUrl, {
|
|
23
|
+
width: opts.width || svg.width,
|
|
24
|
+
height: opts.height || svg.height,
|
|
25
|
+
scale: opts.scale
|
|
26
|
+
}).then(resolve).catch(reject);
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
svgDataUrl = null;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
return reject(err);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const SVG_STYLE_PROPERTIES = [
|
|
35
|
+
'display',
|
|
36
|
+
'fill',
|
|
37
|
+
'fill-opacity',
|
|
38
|
+
'opacity',
|
|
39
|
+
'stroke',
|
|
40
|
+
'stroke-width',
|
|
41
|
+
'transform',
|
|
42
|
+
'border-collapse'
|
|
43
|
+
];
|
|
44
|
+
const SVG_TEXT_STYLE_PROPERTIES = [
|
|
45
|
+
'font-family',
|
|
46
|
+
'font-size',
|
|
47
|
+
'font-weight',
|
|
48
|
+
'text-anchor',
|
|
49
|
+
'background-color',
|
|
50
|
+
'color',
|
|
51
|
+
'padding',
|
|
52
|
+
'text-align',
|
|
53
|
+
'border'
|
|
54
|
+
];
|
|
55
|
+
function toSVG(chartContainer, legendsToSvgCallback, isRTL, background) {
|
|
56
|
+
const svg = chartContainer.querySelector('svg');
|
|
57
|
+
if (!svg) {
|
|
58
|
+
throw new Error('SVG not found');
|
|
59
|
+
}
|
|
60
|
+
let clonedSvg = d3Select(svg.cloneNode(true)).attr('width', null).attr('height', null).attr('viewBox', null);
|
|
61
|
+
let svgElements = svg.getElementsByTagName('*');
|
|
62
|
+
let clonedSvgElements = clonedSvg.node().getElementsByTagName('*');
|
|
63
|
+
const TEXT_ELEMENTS = [
|
|
64
|
+
'text'
|
|
65
|
+
];
|
|
66
|
+
const TABLE_ELEMENTS = [
|
|
67
|
+
'table',
|
|
68
|
+
'thead',
|
|
69
|
+
'tbody',
|
|
70
|
+
'tr',
|
|
71
|
+
'th',
|
|
72
|
+
'td'
|
|
73
|
+
];
|
|
74
|
+
for(let i = 0; i < svgElements.length; i++){
|
|
75
|
+
const tag = svgElements[i].tagName.toLowerCase();
|
|
76
|
+
if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {
|
|
77
|
+
copyStyle([
|
|
78
|
+
...SVG_STYLE_PROPERTIES,
|
|
79
|
+
...SVG_TEXT_STYLE_PROPERTIES
|
|
80
|
+
], svgElements[i], clonedSvgElements[i]);
|
|
81
|
+
} else {
|
|
82
|
+
copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
+
svgElements = null;
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
+
clonedSvgElements = null;
|
|
89
|
+
const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();
|
|
90
|
+
const legendGroup = typeof legendsToSvgCallback === 'function' ? legendsToSvgCallback(svgWidth, isRTL) : {
|
|
91
|
+
node: null,
|
|
92
|
+
width: 0,
|
|
93
|
+
height: 0
|
|
94
|
+
};
|
|
95
|
+
const w1 = Math.max(svgWidth, legendGroup.width);
|
|
96
|
+
const h1 = svgHeight + legendGroup.height;
|
|
97
|
+
if (legendGroup.node) {
|
|
98
|
+
d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);
|
|
99
|
+
clonedSvg.append(()=>legendGroup.node);
|
|
100
|
+
}
|
|
101
|
+
clonedSvg.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', w1).attr('height', h1).attr('fill', background);
|
|
102
|
+
clonedSvg.attr('width', w1).attr('height', h1).attr('viewBox', `0 0 ${w1} ${h1}`).attr('direction', isRTL ? 'rtl' : 'ltr');
|
|
103
|
+
const result = {
|
|
104
|
+
node: clonedSvg.node(),
|
|
105
|
+
width: w1,
|
|
106
|
+
height: h1
|
|
107
|
+
};
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
+
clonedSvg = null;
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
const LEGEND_TEXT_STYLE_PROPERTIES_MAP = {
|
|
113
|
+
color: 'fill',
|
|
114
|
+
'font-family': 'font-family',
|
|
115
|
+
'font-size': 'font-size',
|
|
116
|
+
'font-weight': 'font-weight'
|
|
117
|
+
};
|
|
118
|
+
export function cloneLegendsToSVG(legends, svgWidth, config, legendContainer) {
|
|
119
|
+
if (legends.length === 0) {
|
|
120
|
+
return {
|
|
121
|
+
node: null,
|
|
122
|
+
width: 0,
|
|
123
|
+
height: 0
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const { selectedLegends, centerLegends, textClassName, isRTL } = config;
|
|
127
|
+
const legendGroup = d3Create('svg:g');
|
|
128
|
+
let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;
|
|
129
|
+
let legendY = LEGEND_CONTAINER_MARGIN_TOP;
|
|
130
|
+
let legendLine = [];
|
|
131
|
+
const legendLines = [];
|
|
132
|
+
const legendLineWidths = [];
|
|
133
|
+
const noLegendsSelected = Object.keys(selectedLegends).length === 0;
|
|
134
|
+
for(let i = 0; i < legends.length; i++){
|
|
135
|
+
const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;
|
|
136
|
+
const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);
|
|
137
|
+
const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;
|
|
138
|
+
const legendItem = legendGroup.append('g');
|
|
139
|
+
legendLine.push({
|
|
140
|
+
elem: legendItem,
|
|
141
|
+
width: legendWidth
|
|
142
|
+
});
|
|
143
|
+
if (legendX + legendWidth > svgWidth && legendLine.length > 1) {
|
|
144
|
+
legendLine.pop();
|
|
145
|
+
legendLines.push(legendLine);
|
|
146
|
+
legendLineWidths.push(legendX);
|
|
147
|
+
legendLine = [
|
|
148
|
+
{
|
|
149
|
+
elem: legendItem,
|
|
150
|
+
width: legendWidth
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;
|
|
154
|
+
legendY += LEGEND_HEIGHT;
|
|
155
|
+
}
|
|
156
|
+
const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;
|
|
157
|
+
legendItem.append('rect').attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING)).attr('y', legendY + LEGEND_PADDING).attr('width', LEGEND_SHAPE_SIZE).attr('height', LEGEND_SHAPE_SIZE).style('fill', isLegendActive ? legends[i].color : 'transparent').style('stroke-width', LEGEND_SHAPE_BORDER).style('stroke', legends[i].color);
|
|
158
|
+
legendItem.append('text').attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset)).attr('y', legendY + LEGEND_PADDING).attr('dominant-baseline', 'hanging').style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY).text(legends[i].title).call((selection)=>copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()));
|
|
159
|
+
legendX += legendWidth;
|
|
160
|
+
}
|
|
161
|
+
legendLines.push(legendLine);
|
|
162
|
+
legendLineWidths.push(legendX);
|
|
163
|
+
legendY += LEGEND_HEIGHT;
|
|
164
|
+
if (centerLegends) {
|
|
165
|
+
legendLines.forEach((ln, idx)=>{
|
|
166
|
+
const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);
|
|
167
|
+
let remLineWidth = legendLineWidths[idx];
|
|
168
|
+
let itemOffsetX = 0;
|
|
169
|
+
ln.forEach((item)=>{
|
|
170
|
+
const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);
|
|
171
|
+
item.elem.attr('transform', `translate(${newOffsetX}, 0)`);
|
|
172
|
+
remLineWidth -= item.width;
|
|
173
|
+
itemOffsetX += item.width;
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
} else if (isRTL) {
|
|
177
|
+
const w1 = Math.max(svgWidth, ...legendLineWidths);
|
|
178
|
+
legendLines.forEach((ln)=>{
|
|
179
|
+
let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;
|
|
180
|
+
let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;
|
|
181
|
+
ln.forEach((item)=>{
|
|
182
|
+
const newOffsetX = remLineWidth - item.width - itemOffsetX;
|
|
183
|
+
item.elem.attr('transform', `translate(${newOffsetX}, 0)`);
|
|
184
|
+
remLineWidth -= item.width;
|
|
185
|
+
itemOffsetX += item.width;
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
node: legendGroup.node(),
|
|
191
|
+
width: Math.max(...legendLineWidths),
|
|
192
|
+
height: legendY
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function svgToPng(svgDataUrl, opts = {}) {
|
|
196
|
+
return new Promise((resolve, reject)=>{
|
|
197
|
+
const scale = opts.scale || 1;
|
|
198
|
+
const w0 = opts.width || 300;
|
|
199
|
+
const h0 = opts.height || 150;
|
|
200
|
+
const w1 = scale * w0;
|
|
201
|
+
const h1 = scale * h0;
|
|
202
|
+
const canvas = document.createElement('canvas');
|
|
203
|
+
const img = new Image();
|
|
204
|
+
canvas.width = w1;
|
|
205
|
+
canvas.height = h1;
|
|
206
|
+
img.onload = function() {
|
|
207
|
+
const ctx = canvas.getContext('2d');
|
|
208
|
+
if (!ctx) {
|
|
209
|
+
return reject(new Error('Canvas context is null'));
|
|
210
|
+
}
|
|
211
|
+
ctx.clearRect(0, 0, w1, h1);
|
|
212
|
+
ctx.drawImage(img, 0, 0, w1, h1);
|
|
213
|
+
const imgData = canvas.toDataURL('image/png');
|
|
214
|
+
resolve(imgData);
|
|
215
|
+
};
|
|
216
|
+
img.onerror = function(err) {
|
|
217
|
+
reject(err);
|
|
218
|
+
};
|
|
219
|
+
img.src = svgDataUrl;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const hex2 = /^[\da-f]{2}$/i;
|
|
223
|
+
const hex4 = /^[\da-f]{4}$/i;
|
|
224
|
+
/**
|
|
225
|
+
* A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.
|
|
226
|
+
*
|
|
227
|
+
* Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}
|
|
228
|
+
*/ function unescapePonyfill(str) {
|
|
229
|
+
let result = '';
|
|
230
|
+
const length = str.length;
|
|
231
|
+
let index = 0;
|
|
232
|
+
let chr;
|
|
233
|
+
let part;
|
|
234
|
+
while(index < length){
|
|
235
|
+
chr = str.charAt(index++);
|
|
236
|
+
if (chr === '%') {
|
|
237
|
+
if (str.charAt(index) === 'u') {
|
|
238
|
+
part = str.slice(index + 1, index + 5);
|
|
239
|
+
if (hex4.exec(part)) {
|
|
240
|
+
result += String.fromCharCode(parseInt(part, 16));
|
|
241
|
+
index += 5;
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
part = str.slice(index, index + 2);
|
|
246
|
+
if (hex2.exec(part)) {
|
|
247
|
+
result += String.fromCharCode(parseInt(part, 16));
|
|
248
|
+
index += 2;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
result += chr;
|
|
254
|
+
}
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utilities/image-export-utils.ts"],"sourcesContent":["import { create as d3Create, select as d3Select, Selection } from 'd3-selection';\nimport { copyStyle, createMeasurementSpan, resolveCSSVariables } from './index';\nimport { ImageExportOptions } from '../types/index';\nimport { Legend, LegendContainer } from '../Legends';\nimport {\n LEGEND_CONTAINER_MARGIN_TOP,\n LEGEND_CONTAINER_MARGIN_START,\n LEGEND_PADDING,\n LEGEND_HEIGHT,\n LEGEND_SHAPE_BORDER,\n LEGEND_SHAPE_SIZE,\n LEGEND_SHAPE_MARGIN_END,\n INACTIVE_LEGEND_TEXT_OPACITY,\n} from '../components/Legends/useLegendsStyles.styles';\n\nexport function toImage(\n chartContainer: HTMLElement | null | undefined,\n legendsToSvgCallback?: LegendContainer['toSVG'],\n isRTL: boolean = false,\n opts: ImageExportOptions = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n if (!chartContainer) {\n return reject(new Error('Chart container is not defined'));\n }\n\n try {\n const background =\n typeof opts.background === 'string' ? resolveCSSVariables(chartContainer, opts.background) : 'transparent';\n\n const svg = toSVG(chartContainer, legendsToSvgCallback, isRTL, background);\n if (!svg.node) {\n return reject(new Error('SVG node is null'));\n }\n\n let svgData = new XMLSerializer().serializeToString(svg.node);\n // This node is already detached from the DOM, so there's no need to call remove() on it.\n // Just clear the reference.\n svg.node = null;\n\n let svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescapePonyfill(encodeURIComponent(svgData)));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgData = null as any;\n\n svgToPng(svgDataUrl, {\n width: opts.width || svg.width,\n height: opts.height || svg.height,\n scale: opts.scale,\n })\n .then(resolve)\n .catch(reject);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgDataUrl = null as any;\n } catch (err) {\n return reject(err);\n }\n });\n}\n\nconst SVG_STYLE_PROPERTIES = [\n 'display',\n 'fill',\n 'fill-opacity',\n 'opacity',\n 'stroke',\n 'stroke-width',\n 'transform',\n 'border-collapse',\n];\nconst SVG_TEXT_STYLE_PROPERTIES = [\n 'font-family',\n 'font-size',\n 'font-weight',\n 'text-anchor',\n 'background-color',\n 'color',\n 'padding',\n 'text-align',\n 'border',\n];\n\nfunction toSVG(\n chartContainer: HTMLElement,\n legendsToSvgCallback: LegendContainer['toSVG'] | undefined,\n isRTL: boolean,\n background: string,\n) {\n const svg = chartContainer.querySelector<SVGSVGElement>('svg');\n if (!svg) {\n throw new Error('SVG not found');\n }\n\n let clonedSvg = d3Select(svg.cloneNode(true) as SVGSVGElement)\n .attr('width', null)\n .attr('height', null)\n .attr('viewBox', null);\n let svgElements = svg.getElementsByTagName('*');\n let clonedSvgElements = clonedSvg.node()!.getElementsByTagName('*');\n\n const TEXT_ELEMENTS = ['text'];\n const TABLE_ELEMENTS = ['table', 'thead', 'tbody', 'tr', 'th', 'td'];\n\n for (let i = 0; i < svgElements.length; i++) {\n const tag = svgElements[i].tagName.toLowerCase();\n\n if (TEXT_ELEMENTS.includes(tag) || TABLE_ELEMENTS.includes(tag)) {\n copyStyle([...SVG_STYLE_PROPERTIES, ...SVG_TEXT_STYLE_PROPERTIES], svgElements[i], clonedSvgElements[i]);\n } else {\n copyStyle(SVG_STYLE_PROPERTIES, svgElements[i], clonedSvgElements[i]);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n svgElements = null as any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvgElements = null as any;\n\n const { width: svgWidth, height: svgHeight } = svg.getBoundingClientRect();\n const legendGroup =\n typeof legendsToSvgCallback === 'function'\n ? legendsToSvgCallback(svgWidth, isRTL)\n : { node: null, width: 0, height: 0 };\n const w1 = Math.max(svgWidth, legendGroup.width);\n const h1 = svgHeight + legendGroup.height;\n\n if (legendGroup.node) {\n d3Select(legendGroup.node).attr('transform', `translate(0, ${svgHeight})`);\n clonedSvg.append(() => legendGroup.node);\n }\n clonedSvg\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', w1)\n .attr('height', h1)\n .attr('fill', background);\n clonedSvg\n .attr('width', w1)\n .attr('height', h1)\n .attr('viewBox', `0 0 ${w1} ${h1}`)\n .attr('direction', isRTL ? 'rtl' : 'ltr');\n\n const result = {\n node: clonedSvg.node(),\n width: w1,\n height: h1,\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n clonedSvg = null as any;\n\n return result;\n}\n\nconst LEGEND_TEXT_STYLE_PROPERTIES_MAP = {\n color: 'fill',\n 'font-family': 'font-family',\n 'font-size': 'font-size',\n 'font-weight': 'font-weight',\n};\n\nexport function cloneLegendsToSVG(\n legends: Legend[],\n svgWidth: number,\n config: {\n selectedLegends: Record<string, boolean>;\n centerLegends: boolean;\n textClassName: string;\n isRTL: boolean;\n },\n legendContainer?: HTMLElement | null,\n) {\n if (legends.length === 0) {\n return {\n node: null,\n width: 0,\n height: 0,\n };\n }\n\n const { selectedLegends, centerLegends, textClassName, isRTL } = config;\n const legendGroup = d3Create<SVGGElement>('svg:g');\n let legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n let legendY = LEGEND_CONTAINER_MARGIN_TOP;\n let legendLine: { elem: Selection<SVGGElement, unknown, null, undefined>; width: number }[] = [];\n const legendLines: (typeof legendLine)[] = [];\n const legendLineWidths: number[] = [];\n const noLegendsSelected = Object.keys(selectedLegends).length === 0;\n\n for (let i = 0; i < legends.length; i++) {\n const textOffset = LEGEND_PADDING + LEGEND_SHAPE_SIZE + LEGEND_SHAPE_MARGIN_END;\n const legendText = createMeasurementSpan(legends[i].title, textClassName, legendContainer);\n const legendWidth = textOffset + legendText.getBoundingClientRect().width + LEGEND_PADDING;\n const legendItem = legendGroup.append('g');\n\n legendLine.push({ elem: legendItem, width: legendWidth });\n if (legendX + legendWidth > svgWidth && legendLine.length > 1) {\n legendLine.pop();\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n\n legendLine = [{ elem: legendItem, width: legendWidth }];\n legendX = centerLegends ? 0 : LEGEND_CONTAINER_MARGIN_START;\n legendY += LEGEND_HEIGHT;\n }\n\n const isLegendActive = selectedLegends[legends[i].title] || noLegendsSelected;\n\n legendItem\n .append('rect')\n .attr('x', legendX + (isRTL ? legendWidth - LEGEND_PADDING - LEGEND_SHAPE_SIZE : LEGEND_PADDING))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('width', LEGEND_SHAPE_SIZE)\n .attr('height', LEGEND_SHAPE_SIZE)\n .style('fill', isLegendActive ? legends[i].color : 'transparent')\n .style('stroke-width', LEGEND_SHAPE_BORDER)\n .style('stroke', legends[i].color);\n\n legendItem\n .append('text')\n .attr('x', legendX + (isRTL ? legendWidth - textOffset : textOffset))\n .attr('y', legendY + LEGEND_PADDING)\n .attr('dominant-baseline', 'hanging')\n .style('opacity', isLegendActive ? 1 : INACTIVE_LEGEND_TEXT_OPACITY)\n .text(legends[i].title)\n .call(selection => copyStyle(LEGEND_TEXT_STYLE_PROPERTIES_MAP, legendText, selection.node()!));\n\n legendX += legendWidth;\n }\n\n legendLines.push(legendLine);\n legendLineWidths.push(legendX);\n legendY += LEGEND_HEIGHT;\n\n if (centerLegends) {\n legendLines.forEach((ln, idx) => {\n const lineOffsetX = Math.max((svgWidth - legendLineWidths[idx]) / 2, 0);\n let remLineWidth = legendLineWidths[idx];\n let itemOffsetX = 0;\n ln.forEach(item => {\n const newOffsetX = lineOffsetX + (isRTL ? remLineWidth - item.width - itemOffsetX : 0);\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n } else if (isRTL) {\n const w1 = Math.max(svgWidth, ...legendLineWidths);\n legendLines.forEach(ln => {\n let remLineWidth = w1 - LEGEND_CONTAINER_MARGIN_START;\n let itemOffsetX = LEGEND_CONTAINER_MARGIN_START;\n ln.forEach(item => {\n const newOffsetX = remLineWidth - item.width - itemOffsetX;\n item.elem.attr('transform', `translate(${newOffsetX}, 0)`);\n remLineWidth -= item.width;\n itemOffsetX += item.width;\n });\n });\n }\n\n return {\n node: legendGroup.node(),\n width: Math.max(...legendLineWidths),\n height: legendY,\n };\n}\n\nfunction svgToPng(svgDataUrl: string, opts: ImageExportOptions = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const scale = opts.scale || 1;\n const w0 = opts.width || 300;\n const h0 = opts.height || 150;\n const w1 = scale * w0;\n const h1 = scale * h0;\n\n const canvas = document.createElement('canvas');\n const img = new Image();\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function () {\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return reject(new Error('Canvas context is null'));\n }\n\n ctx.clearRect(0, 0, w1, h1);\n ctx.drawImage(img, 0, 0, w1, h1);\n\n const imgData = canvas.toDataURL('image/png');\n resolve(imgData);\n };\n\n img.onerror = function (err) {\n reject(err);\n };\n\n img.src = svgDataUrl;\n });\n}\n\nconst hex2 = /^[\\da-f]{2}$/i;\nconst hex4 = /^[\\da-f]{4}$/i;\n\n/**\n * A ponyfill for the deprecated `unescape` method, taken from the `core-js` library.\n *\n * Source: {@link https://github.com/zloirock/core-js/blob/167136f479d3b8519953f2e4c534ecdd1031d3cf/packages/core-js/modules/es.unescape.js core-js/packages/core-js/modules/es.unescape.js}\n */\nfunction unescapePonyfill(str: string) {\n let result = '';\n const length = str.length;\n let index = 0;\n let chr;\n let part;\n while (index < length) {\n chr = str.charAt(index++);\n if (chr === '%') {\n if (str.charAt(index) === 'u') {\n part = str.slice(index + 1, index + 5);\n if (hex4.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 5;\n continue;\n }\n } else {\n part = str.slice(index, index + 2);\n if (hex2.exec(part)) {\n result += String.fromCharCode(parseInt(part, 16));\n index += 2;\n continue;\n }\n }\n }\n result += chr;\n }\n return result;\n}\n"],"names":["create","d3Create","select","d3Select","copyStyle","createMeasurementSpan","resolveCSSVariables","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","toImage","chartContainer","legendsToSvgCallback","isRTL","opts","Promise","resolve","reject","Error","background","svg","toSVG","node","svgData","XMLSerializer","serializeToString","svgDataUrl","btoa","unescapePonyfill","encodeURIComponent","svgToPng","width","height","scale","then","catch","err","SVG_STYLE_PROPERTIES","SVG_TEXT_STYLE_PROPERTIES","querySelector","clonedSvg","cloneNode","attr","svgElements","getElementsByTagName","clonedSvgElements","TEXT_ELEMENTS","TABLE_ELEMENTS","i","length","tag","tagName","toLowerCase","includes","svgWidth","svgHeight","getBoundingClientRect","legendGroup","w1","Math","max","h1","append","insert","result","LEGEND_TEXT_STYLE_PROPERTIES_MAP","color","cloneLegendsToSVG","legends","config","legendContainer","selectedLegends","centerLegends","textClassName","legendX","legendY","legendLine","legendLines","legendLineWidths","noLegendsSelected","Object","keys","textOffset","legendText","title","legendWidth","legendItem","push","elem","pop","isLegendActive","style","text","call","selection","forEach","ln","idx","lineOffsetX","remLineWidth","itemOffsetX","item","newOffsetX","w0","h0","canvas","document","createElement","img","Image","onload","ctx","getContext","clearRect","drawImage","imgData","toDataURL","onerror","src","hex2","hex4","str","index","chr","part","charAt","slice","exec","String","fromCharCode","parseInt"],"mappings":"AAAA,SAASA,UAAUC,QAAQ,EAAEC,UAAUC,QAAQ,QAAmB,eAAe;AACjF,SAASC,SAAS,EAAEC,qBAAqB,EAAEC,mBAAmB,QAAQ,UAAU;AAGhF,SACEC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,cAAc,EACdC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,uBAAuB,EACvBC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B5D,UAAUgE,OAAOC,YAAY,CAACC,SAASN,MAAM;oBAC7CF,SAAS;oBACT;gBACF;YACF,OAAO;gBACLE,OAAOH,IAAIK,KAAK,CAACJ,OAAOA,QAAQ;gBAChC,IAAIH,KAAKQ,IAAI,CAACH,OAAO;oBACnB5D,UAAUgE,OAAOC,YAAY,CAACC,SAASN,MAAM;oBAC7CF,SAAS;oBACT;gBACF;YACF;QACF;QACA1D,UAAU2D;IACZ;IACA,OAAO3D;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './utilities';\nexport * from './colors';\nexport * from './vbc-utils';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/utilities/index.ts"],"sourcesContent":["export * from './utilities';\nexport * from './colors';\nexport * from './vbc-utils';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["overflow-utils.ts"],"sourcesContent":["/**\n * Detects whether an element's content has horizontal overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasHorizontalOverflow(element: HTMLElement): boolean {\n return element.clientWidth < element.scrollWidth;\n}\n\n/**\n * Detects whether an element's content has vertical overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasVerticalOverflow(element: HTMLElement): boolean {\n return element.clientHeight < element.scrollHeight;\n}\n\n/**\n * Detects whether an element's content has overflow in any direction\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasOverflow(element: HTMLElement): boolean {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}\n"],"names":["hasHorizontalOverflow","element","clientWidth","scrollWidth","hasVerticalOverflow","clientHeight","scrollHeight","hasOverflow"],"
|
|
1
|
+
{"version":3,"sources":["../src/utilities/overflow-utils.ts"],"sourcesContent":["/**\n * Detects whether an element's content has horizontal overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasHorizontalOverflow(element: HTMLElement): boolean {\n return element.clientWidth < element.scrollWidth;\n}\n\n/**\n * Detects whether an element's content has vertical overflow\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasVerticalOverflow(element: HTMLElement): boolean {\n return element.clientHeight < element.scrollHeight;\n}\n\n/**\n * Detects whether an element's content has overflow in any direction\n *\n * @public\n * @param element - Element to check for overflow\n * @returns True if element's content overflows\n */\nexport function hasOverflow(element: HTMLElement): boolean {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}\n"],"names":["hasHorizontalOverflow","element","clientWidth","scrollWidth","hasVerticalOverflow","clientHeight","scrollHeight","hasOverflow"],"mappings":"AAAA;;;;;;CAMC,GACD,OAAO,SAASA,sBAAsBC,OAAoB;IACxD,OAAOA,QAAQC,WAAW,GAAGD,QAAQE,WAAW;AAClD;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,oBAAoBH,OAAoB;IACtD,OAAOA,QAAQI,YAAY,GAAGJ,QAAQK,YAAY;AACpD;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,YAAYN,OAAoB;IAC9C,OAAOD,sBAAsBC,YAAYG,oBAAoBH;AAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["string.ts"],"sourcesContent":["// Regex that finds { and } so they can be removed on a lookup for string format\nconst FORMAT_ARGS_REGEX = /[\\{\\}]/g;\n\n// Regex that finds {#} so it can be replaced by the arguments in string format\nconst FORMAT_REGEX = /\\{\\d+\\}/g;\n\n/**\n * String format method, used for scenarios where at runtime you\n * need to evaluate a formatted string given a tokenized string. This\n * usually only is needed in localization scenarios.\n\n * @example\n * ```tsx\n * \"I love {0} every {1}\".format(\"CXP\")\n * ```\n * will result in a Debug Exception.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(s: string, ...values: any[]): string {\n const args = values;\n // Callback match function\n function replaceFunc(match: string): string {\n // looks up in the args\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let replacement = args[match.replace(FORMAT_ARGS_REGEX, '') as any];\n\n // catches undefined in nondebug and null in debug and nondebug\n if (replacement === null || replacement === undefined) {\n replacement = '';\n }\n\n return replacement;\n }\n return s.replace(FORMAT_REGEX, replaceFunc);\n}\n"],"names":["FORMAT_ARGS_REGEX","FORMAT_REGEX","format","s","values","args","replaceFunc","match","replacement","replace","undefined"],"
|
|
1
|
+
{"version":3,"sources":["../src/utilities/string.ts"],"sourcesContent":["// Regex that finds { and } so they can be removed on a lookup for string format\nconst FORMAT_ARGS_REGEX = /[\\{\\}]/g;\n\n// Regex that finds {#} so it can be replaced by the arguments in string format\nconst FORMAT_REGEX = /\\{\\d+\\}/g;\n\n/**\n * String format method, used for scenarios where at runtime you\n * need to evaluate a formatted string given a tokenized string. This\n * usually only is needed in localization scenarios.\n\n * @example\n * ```tsx\n * \"I love {0} every {1}\".format(\"CXP\")\n * ```\n * will result in a Debug Exception.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(s: string, ...values: any[]): string {\n const args = values;\n // Callback match function\n function replaceFunc(match: string): string {\n // looks up in the args\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let replacement = args[match.replace(FORMAT_ARGS_REGEX, '') as any];\n\n // catches undefined in nondebug and null in debug and nondebug\n if (replacement === null || replacement === undefined) {\n replacement = '';\n }\n\n return replacement;\n }\n return s.replace(FORMAT_REGEX, replaceFunc);\n}\n"],"names":["FORMAT_ARGS_REGEX","FORMAT_REGEX","format","s","values","args","replaceFunc","match","replacement","replace","undefined"],"mappings":"AAAA,gFAAgF;AAChF,MAAMA,oBAAoB;AAE1B,+EAA+E;AAC/E,MAAMC,eAAe;AAErB;;;;;;;;;;;;CAYC,GACD,8DAA8D;AAC9D,OAAO,SAASC,OAAOC,CAAS,EAAE,GAAGC,MAAa;IAChD,MAAMC,OAAOD;IACb,0BAA0B;IAC1B,SAASE,YAAYC,KAAa;QAChC,uBAAuB;QACvB,8DAA8D;QAC9D,IAAIC,cAAcH,IAAI,CAACE,MAAME,OAAO,CAACT,mBAAmB,IAAW;QAEnE,+DAA+D;QAC/D,IAAIQ,gBAAgB,QAAQA,gBAAgBE,WAAW;YACrDF,cAAc;QAChB;QAEA,OAAOA;IACT;IACA,OAAOL,EAAEM,OAAO,CAACR,cAAcK;AACjC"}
|
|
@@ -327,3 +327,239 @@ export const negativeChartPointsVBC = [
|
|
|
327
327
|
yAxisCalloutData: '37%'
|
|
328
328
|
}
|
|
329
329
|
];
|
|
330
|
+
export const ganttData = [
|
|
331
|
+
{
|
|
332
|
+
x: {
|
|
333
|
+
start: new Date('2017-01-01'),
|
|
334
|
+
end: new Date('2017-02-02')
|
|
335
|
+
},
|
|
336
|
+
y: 'Job-1',
|
|
337
|
+
legend: 'Complete',
|
|
338
|
+
color: DataVizPalette.success,
|
|
339
|
+
gradient: [
|
|
340
|
+
'#0C5E0C',
|
|
341
|
+
'#107C10'
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
x: {
|
|
346
|
+
start: new Date('2017-01-17'),
|
|
347
|
+
end: new Date('2017-02-17')
|
|
348
|
+
},
|
|
349
|
+
y: 'Job-2',
|
|
350
|
+
legend: 'Complete',
|
|
351
|
+
color: DataVizPalette.success,
|
|
352
|
+
gradient: [
|
|
353
|
+
'#0C5E0C',
|
|
354
|
+
'#107C10'
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
x: {
|
|
359
|
+
start: new Date('2017-01-14'),
|
|
360
|
+
end: new Date('2017-03-14')
|
|
361
|
+
},
|
|
362
|
+
y: 'Job-4',
|
|
363
|
+
legend: 'Complete',
|
|
364
|
+
color: DataVizPalette.success,
|
|
365
|
+
gradient: [
|
|
366
|
+
'#0C5E0C',
|
|
367
|
+
'#107C10'
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
x: {
|
|
372
|
+
start: new Date('2017-02-15'),
|
|
373
|
+
end: new Date('2017-03-15')
|
|
374
|
+
},
|
|
375
|
+
y: 'Job-1',
|
|
376
|
+
legend: 'Incomplete',
|
|
377
|
+
color: DataVizPalette.warning,
|
|
378
|
+
gradient: [
|
|
379
|
+
'#DE590B',
|
|
380
|
+
'#F7630C'
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
x: {
|
|
385
|
+
start: new Date('2017-01-17'),
|
|
386
|
+
end: new Date('2017-02-17')
|
|
387
|
+
},
|
|
388
|
+
y: 'Job-2',
|
|
389
|
+
legend: 'Not Started',
|
|
390
|
+
color: DataVizPalette.error,
|
|
391
|
+
gradient: [
|
|
392
|
+
'#B10E1C',
|
|
393
|
+
'#CC2635'
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
x: {
|
|
398
|
+
start: new Date('2017-03-10'),
|
|
399
|
+
end: new Date('2017-03-20')
|
|
400
|
+
},
|
|
401
|
+
y: 'Job-3',
|
|
402
|
+
legend: 'Not Started',
|
|
403
|
+
color: DataVizPalette.error,
|
|
404
|
+
gradient: [
|
|
405
|
+
'#B10E1C',
|
|
406
|
+
'#CC2635'
|
|
407
|
+
]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
x: {
|
|
411
|
+
start: new Date('2017-04-01'),
|
|
412
|
+
end: new Date('2017-04-20')
|
|
413
|
+
},
|
|
414
|
+
y: 'Job-3',
|
|
415
|
+
legend: 'Not Started',
|
|
416
|
+
color: DataVizPalette.error,
|
|
417
|
+
gradient: [
|
|
418
|
+
'#B10E1C',
|
|
419
|
+
'#CC2635'
|
|
420
|
+
]
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
x: {
|
|
424
|
+
start: new Date('2017-05-18'),
|
|
425
|
+
end: new Date(new Date('2017-06-18'))
|
|
426
|
+
},
|
|
427
|
+
y: 'Job-3',
|
|
428
|
+
legend: 'Not Started',
|
|
429
|
+
color: DataVizPalette.error,
|
|
430
|
+
gradient: [
|
|
431
|
+
'#B10E1C',
|
|
432
|
+
'#CC2635'
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
];
|
|
436
|
+
export const ganttDataWithLongY = [
|
|
437
|
+
{
|
|
438
|
+
x: {
|
|
439
|
+
start: new Date('2024-05-01'),
|
|
440
|
+
end: new Date('2024-05-07')
|
|
441
|
+
},
|
|
442
|
+
y: 'Site Preparation',
|
|
443
|
+
legend: 'No',
|
|
444
|
+
color: '#637cefff'
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
x: {
|
|
448
|
+
start: new Date('2024-05-08'),
|
|
449
|
+
end: new Date('2024-05-21')
|
|
450
|
+
},
|
|
451
|
+
y: 'Foundation Work',
|
|
452
|
+
legend: 'No',
|
|
453
|
+
color: '#637cefff'
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
x: {
|
|
457
|
+
start: new Date('2024-05-22'),
|
|
458
|
+
end: new Date('2024-06-02')
|
|
459
|
+
},
|
|
460
|
+
y: 'Framing',
|
|
461
|
+
legend: 'No',
|
|
462
|
+
color: '#637cefff'
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
x: {
|
|
466
|
+
start: new Date('2024-06-03'),
|
|
467
|
+
end: new Date('2024-06-09')
|
|
468
|
+
},
|
|
469
|
+
y: 'Roof Installation',
|
|
470
|
+
legend: 'No',
|
|
471
|
+
color: '#637cefff'
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
x: {
|
|
475
|
+
start: new Date('2024-06-10'),
|
|
476
|
+
end: new Date('2024-06-23')
|
|
477
|
+
},
|
|
478
|
+
y: 'Plumbing/Electrical',
|
|
479
|
+
legend: 'No',
|
|
480
|
+
color: '#637cefff'
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
x: {
|
|
484
|
+
start: new Date('2024-07-08'),
|
|
485
|
+
end: new Date('2024-07-17')
|
|
486
|
+
},
|
|
487
|
+
y: 'Exterior Finishing',
|
|
488
|
+
legend: 'No',
|
|
489
|
+
color: '#637cefff'
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
x: {
|
|
493
|
+
start: new Date('2024-06-24'),
|
|
494
|
+
end: new Date('2024-07-07')
|
|
495
|
+
},
|
|
496
|
+
y: 'Interior Finishing',
|
|
497
|
+
legend: 'Yes (Phase 1)',
|
|
498
|
+
color: '#f7630cff'
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
x: {
|
|
502
|
+
start: new Date('2024-07-18'),
|
|
503
|
+
end: new Date('2024-07-24')
|
|
504
|
+
},
|
|
505
|
+
y: 'Final Inspections',
|
|
506
|
+
legend: 'Yes (Phase 2)',
|
|
507
|
+
color: '#57811bff'
|
|
508
|
+
}
|
|
509
|
+
];
|
|
510
|
+
export const ganttDataWithNumericY = [
|
|
511
|
+
{
|
|
512
|
+
x: {
|
|
513
|
+
start: new Date('2021-01-01'),
|
|
514
|
+
end: new Date('2022-01-10')
|
|
515
|
+
},
|
|
516
|
+
y: 1,
|
|
517
|
+
legend: 'HR',
|
|
518
|
+
color: '#637cefff'
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
x: {
|
|
522
|
+
start: new Date('2022-01-15'),
|
|
523
|
+
end: new Date('2022-01-20')
|
|
524
|
+
},
|
|
525
|
+
y: 2,
|
|
526
|
+
legend: 'Finance',
|
|
527
|
+
color: '#f7630cff'
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
x: {
|
|
531
|
+
start: new Date('2022-02-01'),
|
|
532
|
+
end: new Date('2022-02-08')
|
|
533
|
+
},
|
|
534
|
+
y: 3,
|
|
535
|
+
legend: 'IT',
|
|
536
|
+
color: '#57811bff'
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
x: {
|
|
540
|
+
start: new Date('2022-02-10'),
|
|
541
|
+
end: new Date('2022-02-20')
|
|
542
|
+
},
|
|
543
|
+
y: 4,
|
|
544
|
+
legend: 'Operations',
|
|
545
|
+
color: '#9373c0ff'
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
x: {
|
|
549
|
+
start: new Date('2022-03-01'),
|
|
550
|
+
end: new Date('2022-03-10')
|
|
551
|
+
},
|
|
552
|
+
y: 5,
|
|
553
|
+
legend: 'Customer Support',
|
|
554
|
+
color: '#ca5010ff'
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
x: {
|
|
558
|
+
start: new Date('2022-03-05'),
|
|
559
|
+
end: new Date('2022-03-15')
|
|
560
|
+
},
|
|
561
|
+
y: 6,
|
|
562
|
+
legend: 'Legal',
|
|
563
|
+
color: '#3a96ddff'
|
|
564
|
+
}
|
|
565
|
+
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["test-data.ts"],"sourcesContent":["import {\n ChartDataPoint,\n ChartProps,\n HorizontalBarChartWithAxisDataPoint,\n VSChartDataPoint,\n VerticalStackedChartProps,\n VerticalBarChartDataPoint,\n DataVizPalette,\n} from '../index';\n\nexport const chartPointsVBC = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: 50000,\n legend: 'Second',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nconst firstChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 40,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '40%',\n },\n {\n legend: 'Metadata2',\n data: 5,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '5%',\n },\n];\n\nconst secondChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 30,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '30%',\n },\n {\n legend: 'Metadata2',\n data: 20,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n];\n\nexport const chartPointsVSBC: VerticalStackedChartProps[] = [\n { chartData: firstChartPointsVSBC, xAxisPoint: 0 },\n { chartData: secondChartPointsVSBC, xAxisPoint: 20 },\n];\n\nexport const chartPoints2VSBC: VerticalStackedChartProps[] = [\n {\n chartData: firstChartPointsVSBC,\n xAxisPoint: 0,\n lineData: [{ y: 15, legend: 'Line1', color: 'yellow' }],\n },\n {\n chartData: secondChartPointsVSBC,\n xAxisPoint: 20,\n lineData: [{ y: 30, legend: 'Line1', color: 'yellow' }],\n },\n];\n\nexport const emptychartPointsVSBC: VerticalStackedChartProps[] = [{ chartData: [], xAxisPoint: 0 }];\n\nexport const pointsHBCWA = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Dogs',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '88%',\n },\n];\n\nexport const pointsDC: ChartDataPoint[] = [\n { legend: 'first', data: 20000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 39000, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 45000, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const pointsDCElevateMinimumsExample: ChartDataPoint[] = [\n { legend: 'first', data: 39000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 20, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fourth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fifth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'sixth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const chartPointsDC: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsDCElevateMinimums: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Grapes',\n color: 'blue',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '88%',\n },\n];\n\nexport const chartPointsWithStringYAxisHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n y: 'String One',\n x: 1000,\n color: 'aqua',\n },\n {\n y: 'String Two',\n x: 5000,\n color: 'blue',\n },\n {\n y: 'String Three',\n x: 3000,\n color: 'navy',\n },\n {\n y: 'String Four',\n x: 2000,\n color: 'blue',\n },\n];\n\nexport const chartPointsWithAxisToolTipHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 1000,\n y: 1000,\n color: 'aqua',\n },\n {\n x: 2000,\n y: 5000,\n color: 'blue',\n },\n {\n x: 3000,\n y: 3000,\n color: 'navy',\n },\n {\n x: 4000,\n y: 2000,\n color: 'blue',\n },\n];\n\nexport const allNegativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: -10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: -30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const negativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n"],"names":["DataVizPalette","chartPointsVBC","x","y","legend","color","xAxisCalloutData","yAxisCalloutData","firstChartPointsVSBC","data","secondChartPointsVSBC","chartPointsVSBC","chartData","xAxisPoint","chartPoints2VSBC","lineData","emptychartPointsVSBC","pointsHBCWA","pointsDC","pointsDCElevateMinimumsExample","chartPointsDC","chartTitle","chartPointsDCElevateMinimums","chartPointsHBCWA","chartPointsWithStringYAxisHBCWA","chartPointsWithAxisToolTipHBCWA","allNegativeChartPointsVBC","color1","color2","color3","negativeChartPointsVBC"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG,CAAC;QACJC,QAAQ;QACRC,OAAOL,eAAe4B,MAAM;QAC5BtB,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG,CAAC;QACJC,QAAQ;QACRC,OAAOL,eAAe6B,MAAM;QAC5BvB,kBAAkB;QAClBC,kBAAkB;IACpB;CACD,CAAC;AAEF,OAAO,MAAMuB,yBAAsD;IACjE;QACE5B,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAOL,eAAe2B,MAAM;QAC5BrB,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG,CAAC;QACJC,QAAQ;QACRC,OAAOL,eAAe4B,MAAM;QAC5BtB,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAOL,eAAe6B,MAAM;QAC5BvB,kBAAkB;QAClBC,kBAAkB;IACpB;CACD,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../src/utilities/test-data.ts"],"sourcesContent":["import {\n ChartDataPoint,\n ChartProps,\n HorizontalBarChartWithAxisDataPoint,\n VSChartDataPoint,\n GanttChartDataPoint,\n VerticalStackedChartProps,\n VerticalBarChartDataPoint,\n DataVizPalette,\n} from '../index';\n\nexport const chartPointsVBC = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: 50000,\n legend: 'Second',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nconst firstChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 40,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '40%',\n },\n {\n legend: 'Metadata2',\n data: 5,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '5%',\n },\n];\n\nconst secondChartPointsVSBC: VSChartDataPoint[] = [\n {\n legend: 'Metadata1',\n data: 30,\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '30%',\n },\n {\n legend: 'Metadata2',\n data: 20,\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n];\n\nexport const chartPointsVSBC: VerticalStackedChartProps[] = [\n { chartData: firstChartPointsVSBC, xAxisPoint: 0 },\n { chartData: secondChartPointsVSBC, xAxisPoint: 20 },\n];\n\nexport const chartPoints2VSBC: VerticalStackedChartProps[] = [\n {\n chartData: firstChartPointsVSBC,\n xAxisPoint: 0,\n lineData: [{ y: 15, legend: 'Line1', color: 'yellow' }],\n },\n {\n chartData: secondChartPointsVSBC,\n xAxisPoint: 20,\n lineData: [{ y: 30, legend: 'Line1', color: 'yellow' }],\n },\n];\n\nexport const emptychartPointsVSBC: VerticalStackedChartProps[] = [{ chartData: [], xAxisPoint: 0 }];\n\nexport const pointsHBCWA = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Dogs',\n color: 'blue',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '88%',\n },\n];\n\nexport const pointsDC: ChartDataPoint[] = [\n { legend: 'first', data: 20000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 39000, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 45000, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const pointsDCElevateMinimumsExample: ChartDataPoint[] = [\n { legend: 'first', data: 39000, color: '#E5E5E5', xAxisCalloutData: '2020/04/30' },\n { legend: 'second', data: 20, color: '#0078D4', xAxisCalloutData: '2020/04/20' },\n { legend: 'third', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fourth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'fifth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n { legend: 'sixth', data: 20, color: '#DADADA', xAxisCalloutData: '2020/04/25' },\n];\n\nexport const chartPointsDC: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsDCElevateMinimums: ChartProps = {\n chartTitle: 'Donut chart example',\n chartData: pointsDC,\n};\n\nexport const chartPointsHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 10000,\n y: 5000,\n legend: 'Oranges',\n color: 'aqua',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '10%',\n },\n {\n x: 20000,\n y: 50000,\n legend: 'Grapes',\n color: 'blue',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Apples',\n color: 'navy',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '37%',\n },\n\n {\n x: 40000,\n y: 13000,\n legend: 'Bananas',\n color: 'teal',\n yAxisCalloutData: '2020/04/30',\n xAxisCalloutData: '88%',\n },\n];\n\nexport const chartPointsWithStringYAxisHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n y: 'String One',\n x: 1000,\n color: 'aqua',\n },\n {\n y: 'String Two',\n x: 5000,\n color: 'blue',\n },\n {\n y: 'String Three',\n x: 3000,\n color: 'navy',\n },\n {\n y: 'String Four',\n x: 2000,\n color: 'blue',\n },\n];\n\nexport const chartPointsWithAxisToolTipHBCWA: HorizontalBarChartWithAxisDataPoint[] = [\n {\n x: 1000,\n y: 1000,\n color: 'aqua',\n },\n {\n x: 2000,\n y: 5000,\n color: 'blue',\n },\n {\n x: 3000,\n y: 3000,\n color: 'navy',\n },\n {\n x: 4000,\n y: 2000,\n color: 'blue',\n },\n];\n\nexport const allNegativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: -10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: -30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const negativeChartPointsVBC: VerticalBarChartDataPoint[] = [\n {\n x: 0,\n y: 10000,\n legend: 'First',\n color: DataVizPalette.color1,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '10%',\n },\n {\n x: 10000,\n y: -50000,\n legend: 'Second',\n color: DataVizPalette.color2,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '20%',\n },\n {\n x: 25000,\n y: 30000,\n legend: 'Third',\n color: DataVizPalette.color3,\n xAxisCalloutData: '2020/04/30',\n yAxisCalloutData: '37%',\n },\n];\n\nexport const ganttData: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2017-01-01'),\n end: new Date('2017-02-02'),\n },\n y: 'Job-1',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-01-14'),\n end: new Date('2017-03-14'),\n },\n y: 'Job-4',\n legend: 'Complete',\n color: DataVizPalette.success,\n gradient: ['#0C5E0C', '#107C10'],\n },\n {\n x: {\n start: new Date('2017-02-15'),\n end: new Date('2017-03-15'),\n },\n y: 'Job-1',\n legend: 'Incomplete',\n color: DataVizPalette.warning,\n gradient: ['#DE590B', '#F7630C'],\n },\n {\n x: {\n start: new Date('2017-01-17'),\n end: new Date('2017-02-17'),\n },\n y: 'Job-2',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-03-10'),\n end: new Date('2017-03-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-04-01'),\n end: new Date('2017-04-20'),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n {\n x: {\n start: new Date('2017-05-18'),\n end: new Date(new Date('2017-06-18')),\n },\n y: 'Job-3',\n legend: 'Not Started',\n color: DataVizPalette.error,\n gradient: ['#B10E1C', '#CC2635'],\n },\n];\n\nexport const ganttDataWithLongY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2024-05-01'),\n end: new Date('2024-05-07'),\n },\n y: 'Site Preparation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-08'),\n end: new Date('2024-05-21'),\n },\n y: 'Foundation Work',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-05-22'),\n end: new Date('2024-06-02'),\n },\n y: 'Framing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-03'),\n end: new Date('2024-06-09'),\n },\n y: 'Roof Installation',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-10'),\n end: new Date('2024-06-23'),\n },\n y: 'Plumbing/Electrical',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-07-08'),\n end: new Date('2024-07-17'),\n },\n y: 'Exterior Finishing',\n legend: 'No',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2024-06-24'),\n end: new Date('2024-07-07'),\n },\n y: 'Interior Finishing',\n legend: 'Yes (Phase 1)',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2024-07-18'),\n end: new Date('2024-07-24'),\n },\n y: 'Final Inspections',\n legend: 'Yes (Phase 2)',\n color: '#57811bff',\n },\n];\n\nexport const ganttDataWithNumericY: GanttChartDataPoint[] = [\n {\n x: {\n start: new Date('2021-01-01'),\n end: new Date('2022-01-10'),\n },\n y: 1,\n legend: 'HR',\n color: '#637cefff',\n },\n {\n x: {\n start: new Date('2022-01-15'),\n end: new Date('2022-01-20'),\n },\n y: 2,\n legend: 'Finance',\n color: '#f7630cff',\n },\n {\n x: {\n start: new Date('2022-02-01'),\n end: new Date('2022-02-08'),\n },\n y: 3,\n legend: 'IT',\n color: '#57811bff',\n },\n {\n x: {\n start: new Date('2022-02-10'),\n end: new Date('2022-02-20'),\n },\n y: 4,\n legend: 'Operations',\n color: '#9373c0ff',\n },\n {\n x: {\n start: new Date('2022-03-01'),\n end: new Date('2022-03-10'),\n },\n y: 5,\n legend: 'Customer Support',\n color: '#ca5010ff',\n },\n {\n x: {\n start: new Date('2022-03-05'),\n end: new Date('2022-03-15'),\n },\n y: 6,\n legend: 'Legal',\n color: '#3a96ddff',\n },\n];\n"],"names":["DataVizPalette","chartPointsVBC","x","y","legend","color","xAxisCalloutData","yAxisCalloutData","firstChartPointsVSBC","data","secondChartPointsVSBC","chartPointsVSBC","chartData","xAxisPoint","chartPoints2VSBC","lineData","emptychartPointsVSBC","pointsHBCWA","pointsDC","pointsDCElevateMinimumsExample","chartPointsDC","chartTitle","chartPointsDCElevateMinimums","chartPointsHBCWA","chartPointsWithStringYAxisHBCWA","chartPointsWithAxisToolTipHBCWA","allNegativeChartPointsVBC","color1","color2","color3","negativeChartPointsVBC","ganttData","start","Date","end","success","gradient","warning","error","ganttDataWithLongY","ganttDataWithNumericY"],"mappings":"AAAA,SAQEA,cAAc,QACT,WAAW;AAElB,OAAO,MAAMC,iBAAiB;IAC5B;QACEC,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEL,GAAG;QACHC,GAAG;QACHC,QAAQ;QACRC,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD,CAAC;AAEF,MAAMC,uBAA2C;IAC/C;QACEJ,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEH,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD;AAED,MAAMG,wBAA4C;IAChD;QACEN,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;IACA;QACEH,QAAQ;QACRK,MAAM;QACNJ,OAAO;QACPC,kBAAkB;QAClBC,kBAAkB;IACpB;CACD;AAED,OAAO,MAAMI,kBAA+C;IAC1D;QAAEC,WAAWJ;QAAsBK,YAAY;IAAE;IACjD;QAAED,WAAWF;QAAuBG,YAAY;IAAG;CACpD,CAAC;AAEF,OAAO,MAAMC,mBAAgD;IAC3D;QACEF,WAAWJ;QACXK,YAAY;QACZE,UAAU;YAAC;gBAAEZ,GAAG;gBAAIC,QAAQ;gBAASC,OAAO;YAAS;SAAE;IACzD;IACA;QACEO,WAAWF;QACXG,YAAY;QACZE,UAAU;YAAC;gBAAEZ,GAAG;gBAAIC,QAAQ;gBAASC,OAAO;YAAS;SAAE;IACzD;CACD,CAAC;AAEF,OAAO,MAAMW,uBAAoD;IAA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