@fluentui/react-charts 1.1.0 → 9.0.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 +181 -11
- package/LICENSE +11 -17
- package/README.md +174 -23
- package/dist/index.d.ts +2143 -0
- package/lib/CartesianChart.js +1 -0
- package/lib/CartesianChart.js.map +1 -0
- package/lib/DeclarativeChart.js +1 -0
- package/lib/DeclarativeChart.js.map +1 -0
- package/lib/DonutChart.js +1 -0
- package/lib/DonutChart.js.map +1 -0
- package/lib/HorizontalBarChart.js +1 -0
- package/lib/HorizontalBarChart.js.map +1 -0
- package/lib/Legends.js +1 -0
- package/lib/Legends.js.map +1 -0
- package/lib/LineChart.js +1 -0
- package/lib/LineChart.js.map +1 -0
- package/lib/Popover.js +1 -0
- package/lib/Popover.js.map +1 -0
- package/lib/ResponsiveContainer.js +1 -0
- package/lib/ResponsiveContainer.js.map +1 -0
- package/lib/Sparkline.js +1 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/VerticalBarChart.js +1 -0
- package/lib/VerticalBarChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +462 -0
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.js +187 -0
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib/components/CommonComponents/index.js +4 -0
- package/lib/components/CommonComponents/index.js.map +1 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +229 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +150 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchema.js +7 -0
- package/lib/components/DeclarativeChart/PlotlySchema.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +400 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js +221 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib/components/DeclarativeChart/index.js +1 -0
- package/lib/components/DeclarativeChart/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.js +110 -0
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib/components/DonutChart/Arc/index.js +2 -0
- package/lib/components/DonutChart/Arc/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js +291 -0
- package/lib/components/DonutChart/DonutChart.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.types.js +1 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.js +72 -0
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/index.js +2 -0
- package/lib/components/DonutChart/Pie/index.js.map +1 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +44 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/index.js +3 -0
- package/lib/components/DonutChart/index.js.map +1 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib/components/HorizontalBarChart/index.js +3 -0
- package/lib/components/HorizontalBarChart/index.js.map +1 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +163 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.js +302 -0
- package/lib/components/Legends/Legends.js.map +1 -0
- package/lib/components/Legends/Legends.types.js +1 -0
- package/lib/components/Legends/Legends.types.js.map +1 -0
- package/lib/components/Legends/OverflowMenu.js +25 -0
- package/lib/components/Legends/OverflowMenu.js.map +1 -0
- package/lib/components/Legends/index.js +3 -0
- package/lib/components/Legends/index.js.map +1 -0
- package/lib/components/Legends/shape.js +35 -0
- package/lib/components/Legends/shape.js.map +1 -0
- package/lib/components/Legends/useLegendsStyles.styles.js +147 -0
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +1026 -0
- package/lib/components/LineChart/LineChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.types.js +3 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib/components/LineChart/index.js +4 -0
- package/lib/components/LineChart/index.js.map +1 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js +65 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib/components/ResponsiveContainer/index.js +1 -0
- package/lib/components/ResponsiveContainer/index.js.map +1 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js +119 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.js +4 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +849 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib/components/VerticalBarChart/index.js +3 -0
- package/lib/components/VerticalBarChart/index.js.map +1 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +74 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/index.js +12 -8
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +3 -0
- package/lib/types/DataPoint.js.map +1 -0
- package/lib/types/EventAnnotation.js +1 -0
- package/lib/types/EventAnnotation.js.map +1 -0
- package/lib/types/LegendDataItem.js +1 -0
- package/lib/types/LegendDataItem.js.map +1 -0
- package/lib/types/index.js +2 -2
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +65 -0
- package/lib/utilities/FocusableTooltipText.js.map +1 -0
- package/lib/utilities/KeyCodes.js +8 -0
- package/lib/utilities/KeyCodes.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js +138 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -0
- package/lib/utilities/async-utils.js +380 -0
- package/lib/utilities/async-utils.js.map +1 -0
- package/lib/utilities/colors.js +249 -0
- package/lib/utilities/colors.js.map +1 -0
- package/lib/utilities/getWindow.js +25 -0
- package/lib/utilities/getWindow.js.map +1 -0
- package/lib/utilities/index.js +3 -0
- package/lib/utilities/index.js.map +1 -0
- package/lib/utilities/locale-util.js +15 -0
- package/lib/utilities/locale-util.js.map +1 -0
- package/lib/utilities/overflow-utils.js +27 -0
- package/lib/utilities/overflow-utils.js.map +1 -0
- package/lib/utilities/test-data.js +276 -0
- package/lib/utilities/test-data.js.map +1 -0
- package/lib/utilities/utilities.js +1215 -0
- package/lib/utilities/utilities.js.map +1 -0
- package/lib/utilities/vbc-utils.js +27 -0
- package/lib/utilities/vbc-utils.js.map +1 -0
- package/lib-commonjs/CartesianChart.js +6 -0
- package/lib-commonjs/CartesianChart.js.map +1 -0
- package/lib-commonjs/DeclarativeChart.js +6 -0
- package/lib-commonjs/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/DonutChart.js +6 -0
- package/lib-commonjs/DonutChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChart.js +6 -0
- package/lib-commonjs/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/Legends.js +6 -0
- package/lib-commonjs/Legends.js.map +1 -0
- package/lib-commonjs/LineChart.js +6 -0
- package/lib-commonjs/LineChart.js.map +1 -0
- package/lib-commonjs/Popover.js +6 -0
- package/lib-commonjs/Popover.js.map +1 -0
- package/lib-commonjs/ResponsiveContainer.js +6 -0
- package/lib-commonjs/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/Sparkline.js +6 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/VerticalBarChart.js +6 -0
- package/lib-commonjs/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +469 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/index.js +9 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +356 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +158 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +10 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +445 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +61 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js +8 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +251 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +313 -0
- package/lib-commonjs/components/Legends/Legends.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.types.js +6 -0
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
- package/lib-commonjs/components/Legends/index.js +8 -0
- package/lib-commonjs/components/Legends/index.js.map +1 -0
- package/lib-commonjs/components/Legends/shape.js +46 -0
- package/lib-commonjs/components/Legends/shape.js.map +1 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +1032 -0
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib-commonjs/components/LineChart/index.js +9 -0
- package/lib-commonjs/components/LineChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +96 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.js +8 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +851 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +117 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +17 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/types/DataPoint.js +6 -0
- package/lib-commonjs/types/DataPoint.js.map +1 -0
- package/lib-commonjs/types/EventAnnotation.js +6 -0
- package/lib-commonjs/types/EventAnnotation.js.map +1 -0
- package/lib-commonjs/types/LegendDataItem.js +4 -0
- package/lib-commonjs/types/LegendDataItem.js.map +1 -0
- package/lib-commonjs/types/index.js +7 -0
- package/lib-commonjs/types/index.js.map +1 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/KeyCodes.js +18 -0
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js +148 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/async-utils.js +382 -0
- package/lib-commonjs/utilities/async-utils.js.map +1 -0
- package/lib-commonjs/utilities/colors.js +270 -0
- package/lib-commonjs/utilities/colors.js.map +1 -0
- package/lib-commonjs/utilities/getWindow.js +28 -0
- package/lib-commonjs/utilities/getWindow.js.map +1 -0
- package/lib-commonjs/utilities/index.js +8 -0
- package/lib-commonjs/utilities/index.js.map +1 -0
- package/lib-commonjs/utilities/locale-util.js +25 -0
- package/lib-commonjs/utilities/locale-util.js.map +1 -0
- package/lib-commonjs/utilities/overflow-utils.js +36 -0
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +324 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +1184 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -0
- package/lib-commonjs/utilities/vbc-utils.js +45 -0
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
- package/package.json +80 -71
- package/CHANGELOG.json +0 -50
- package/lib/chart/chart-legend.d.ts +0 -6
- package/lib/chart/chart-legend.js +0 -446
- package/lib/chart/chart-legend.js.map +0 -1
- package/lib/chart/chart-render.d.ts +0 -3
- package/lib/chart/chart-render.js +0 -50
- package/lib/chart/chart-render.js.map +0 -1
- package/lib/chart/chart.d.ts +0 -3
- package/lib/chart/chart.js +0 -11
- package/lib/chart/chart.js.map +0 -1
- package/lib/chart/index.d.ts +0 -1
- package/lib/chart/index.js +0 -2
- package/lib/chart/index.js.map +0 -1
- package/lib/index.d.ts +0 -7
- package/lib/lib/builder.d.ts +0 -82
- package/lib/lib/builder.js +0 -341
- package/lib/lib/builder.js.map +0 -1
- package/lib/lib/datasets.d.ts +0 -99
- package/lib/lib/datasets.js +0 -240
- package/lib/lib/datasets.js.map +0 -1
- package/lib/lib/patterns.d.ts +0 -43
- package/lib/lib/patterns.js +0 -433
- package/lib/lib/patterns.js.map +0 -1
- package/lib/lib/plugins.d.ts +0 -11
- package/lib/lib/plugins.js +0 -403
- package/lib/lib/plugins.js.map +0 -1
- package/lib/lib/settings.d.ts +0 -11
- package/lib/lib/settings.js +0 -342
- package/lib/lib/settings.js.map +0 -1
- package/lib/lib/storybook.d.ts +0 -11
- package/lib/lib/storybook.js +0 -13
- package/lib/lib/storybook.js.map +0 -1
- package/lib/lib/utils.d.ts +0 -34
- package/lib/lib/utils.js +0 -253
- package/lib/lib/utils.js.map +0 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/types.d.ts +0 -94
- package/lib/types/types.js +0 -41
- package/lib/types/types.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PlotlySchema.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * This interface is extracted from Plotly.js typescript definitions.\n * All the unsupported types are removed to align with fluent charts.\n * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/index.d.ts\n */\n\nexport type PieColor = string | number;\nexport type PieColors = Array<PieColor | null | undefined>;\n\nexport interface PieFont {\n family: string | string[];\n size: number | number[];\n color: PieColor | PieColors;\n}\n\nexport interface PieDataTitle extends Pick<DataTitle, 'text' | 'position'> {\n font: Partial<PieFont>;\n}\n\nexport type PieTextPosition = 'inside' | 'outside' | 'auto' | 'none';\n\nexport type PieHoverInfo =\n | 'all'\n | 'none'\n | 'skip'\n | 'label'\n | 'text'\n | 'value'\n | 'percent'\n | 'name'\n | 'label+text'\n | 'label+value'\n | 'label+percent'\n | 'label+name'\n | 'text+value'\n | 'text+percent'\n | 'text+name'\n | 'value+percent'\n | 'value+name'\n | 'percent+name'\n | 'label+text+value'\n | 'label+text+percent'\n | 'label+text+name'\n | 'label+value+percent'\n | 'label+value+name'\n | 'label+percent+name'\n | 'text+value+percent'\n | 'text+value+name'\n | 'text+percent+name'\n | 'value+percent+name'\n | 'label+text+value+percent'\n | 'label+text+value+name'\n | 'label+text+percent+name'\n | 'label+value+percent+name'\n | 'text+value+percent+name';\n\nexport interface PieDomain {\n x: number[];\n y: number[];\n row: number;\n column: number;\n}\n\nexport interface PieLine {\n color: PieColor | PieColors;\n width: number | number[];\n}\n\nexport interface PieMarker {\n colors: PieColors;\n line: Partial<PieLine>;\n}\n\nexport interface PieHoverLabel {\n bgcolor: PieColor | PieColors;\n bordercolor: PieColor | PieColors;\n font: PieFont;\n align: HoverLabel['align'] | Array<HoverLabel['align']>;\n namelength: number | number[];\n}\n\nexport type PieInsideTextOrientation = 'horizontal' | 'radial' | 'tangential' | 'auto';\n\nexport interface PieData\n extends Pick<\n PlotData,\n | 'name'\n | 'visible'\n | 'showlegend'\n | 'legendgroup'\n | 'opacity'\n | 'ids'\n | 'labels'\n | 'hovertext'\n | 'automargin'\n | 'textinfo'\n | 'direction'\n | 'hole'\n | 'rotation'\n > {\n type: 'pie';\n title: Partial<PieDataTitle>;\n values: Array<number | string>;\n dlabel: number;\n label0: number;\n pull: number | number[];\n text: Datum | Datum[];\n textposition: PieTextPosition | PieTextPosition[];\n texttemplate: string | string[];\n hoverinfo: PieHoverInfo;\n hovertemplate: string | string[];\n meta: number | string;\n customdata: Datum[];\n domain: Partial<PieDomain>;\n marker: Partial<PieMarker>;\n textfont: PieFont;\n hoverlabel: Partial<PieHoverLabel>;\n insidetextfont: PieFont;\n insidetextorientation: PieInsideTextOrientation;\n outsidetextfont: PieFont;\n scalegroup: string;\n sort: boolean;\n uirevision: number | string;\n}\n\nexport type SankeyColor = string | number;\nexport type SankeyColors = Array<SankeyColor | null | undefined>;\n\nexport interface SankeyFont {\n family: string | string[];\n size: number | number[];\n color: SankeyColor | SankeyColors;\n}\n\nexport interface SankeyDataTitle {\n font: Partial<SankeyFont>;\n title: string;\n}\n\nexport type SankeyOrientation = 'v' | 'h';\n\nexport interface SankeyHoverLabel {\n bgcolor: SankeyColor | SankeyColors;\n bordercolor: SankeyColor | SankeyColors;\n font: SankeyFont;\n align: HoverLabel['align'] | Array<HoverLabel['align']>;\n namelength: number | number[];\n}\n\nexport interface SankeyDomain {\n row: number;\n column: number;\n x: number[];\n y: number[];\n}\n\nexport interface SankeyNode {\n color: SankeyColor[];\n customdata: Datum[];\n groups: SankeyNode[];\n hoverinfo: 'all' | 'none' | 'skip';\n hoverlabel: Partial<SankeyHoverLabel>;\n hovertemplate: string | string[];\n label: Datum[];\n line: Partial<{\n color: SankeyColor;\n width: number;\n }>;\n pad: number;\n thickness: number;\n x: number[];\n y: number[];\n}\n\nexport interface SankeyColorscale {\n cmax: number;\n cmin: number;\n colorscale: Array<[number, string]>;\n label: string;\n name: string;\n templateitemname: string;\n}\n\nexport interface SankeyLink {\n arrowlen: number;\n color: SankeyColor | SankeyColor[];\n colorscale: Partial<SankeyColorscale>;\n customdata: Datum[];\n hoverinfo: 'all' | 'none' | 'skip';\n hoverlabel: Partial<SankeyHoverLabel>;\n hovertemplate: string | string[];\n hovercolor: SankeyColor | SankeyColor[];\n label: Datum[];\n line: Partial<{\n color: SankeyColor;\n width: number;\n }>;\n source: number[];\n target: number[];\n value: number[];\n}\n\nexport interface SankeyData {\n type: 'sankey';\n name: string;\n orientation: SankeyOrientation;\n visible: boolean | 'legendonly';\n legend: string;\n legendrank: number;\n legendgrouptitle: Partial<SankeyDataTitle>;\n legendwidth: number;\n ids: string[];\n hoverinfo: string;\n meta: number | string;\n customdata: Datum[];\n domain: Partial<SankeyDomain>;\n node: Partial<SankeyNode>;\n link: Partial<SankeyLink>;\n textfont: Partial<SankeyFont>;\n selectpoints: string | number;\n arrangement: 'snap' | 'perpendicular' | 'freeform' | 'fixed';\n hoverlabel: Partial<SankeyHoverLabel>;\n valueformat: string;\n valuesuffix: string;\n uirevision: string | number;\n}\n\nexport interface Point {\n x: number;\n y: number;\n z: number;\n}\n\nexport interface PlotScatterDataPoint {\n curveNumber: number;\n data: PlotData;\n pointIndex: number;\n pointNumber: number;\n x: number;\n xaxis: LayoutAxis;\n y: number;\n yaxis: LayoutAxis;\n}\n\nexport interface PlotDatum {\n curveNumber: number;\n data: PlotData;\n customdata: Datum;\n pointIndex: number;\n pointNumber: number;\n x: Datum;\n xaxis: LayoutAxis;\n y: Datum;\n yaxis: LayoutAxis;\n text: string;\n}\n\nexport interface PlotCoordinate {\n x: number;\n y: number;\n pointNumber: number;\n}\n\nexport interface SelectionRange {\n x: number[];\n y: number[];\n}\n\nexport type PlotSelectedData = Partial<PlotDatum>;\n\nexport interface PlotScene {\n center: Point;\n eye: Point;\n up: Point;\n}\n\nexport interface PolarLayout {\n domain: Partial<Domain>;\n sector: number[];\n hole: number;\n bgcolor: Color;\n radialaxis: Partial<LayoutAxis>;\n angularaxis: Partial<LayoutAxis>;\n gridshape: 'circular' | 'linear';\n uirevision: string | number;\n uid: string;\n}\n\nexport interface PlotlySchema {\n data: Data[];\n layout?: Partial<Layout>;\n config?: Partial<Config>;\n}\n\n// Layout\nexport interface Layout {\n colorway: string[];\n title:\n | string\n | Partial<{\n text: string;\n font: Partial<Font>;\n xref: 'container' | 'paper';\n yref: 'container' | 'paper';\n x: number;\n y: number;\n xanchor: 'auto' | 'left' | 'center' | 'right';\n yanchor: 'auto' | 'top' | 'middle' | 'bottom';\n pad: Partial<Padding>;\n }>;\n titlefont: Partial<Font>;\n autosize: boolean;\n showlegend: boolean;\n paper_bgcolor: Color;\n plot_bgcolor: Color;\n separators: string;\n hidesources: boolean;\n xaxis: Partial<LayoutAxis>;\n xaxis2: Partial<LayoutAxis>;\n xaxis3: Partial<LayoutAxis>;\n xaxis4: Partial<LayoutAxis>;\n xaxis5: Partial<LayoutAxis>;\n xaxis6: Partial<LayoutAxis>;\n xaxis7: Partial<LayoutAxis>;\n xaxis8: Partial<LayoutAxis>;\n xaxis9: Partial<LayoutAxis>;\n yaxis: Partial<LayoutAxis>;\n yaxis2: Partial<LayoutAxis>;\n yaxis3: Partial<LayoutAxis>;\n yaxis4: Partial<LayoutAxis>;\n yaxis5: Partial<LayoutAxis>;\n yaxis6: Partial<LayoutAxis>;\n yaxis7: Partial<LayoutAxis>;\n yaxis8: Partial<LayoutAxis>;\n yaxis9: Partial<LayoutAxis>;\n margin: Partial<Margin>;\n height: number;\n width: number;\n hovermode: 'closest' | 'x' | 'y' | 'x unified' | 'y unified' | false;\n hoverdistance: number;\n hoverlabel: Partial<HoverLabel>;\n calendar: Calendar;\n 'xaxis.range': [Datum, Datum];\n 'xaxis.range[0]': Datum;\n 'xaxis.range[1]': Datum;\n 'yaxis.range': [Datum, Datum];\n 'yaxis.range[0]': Datum;\n 'yaxis.range[1]': Datum;\n 'yaxis.type': AxisType;\n 'xaxis.type': AxisType;\n 'xaxis.autorange': boolean;\n 'yaxis.autorange': boolean;\n 'xaxis.title': string;\n 'yaxis.title': string;\n ternary: any;\n geo: any;\n mapbox: any;\n subplot: string;\n radialaxis: Partial<Axis>;\n angularaxis: {};\n dragmode:\n | 'zoom'\n | 'pan'\n | 'select'\n | 'lasso'\n | 'drawclosedpath'\n | 'drawopenpath'\n | 'drawline'\n | 'drawrect'\n | 'drawcircle'\n | 'orbit'\n | 'turntable'\n | false;\n orientation: number;\n annotations: Array<Partial<Annotations>>;\n shapes: Array<Partial<Shape>>;\n legend: Partial<Legend>;\n font: Partial<Font>;\n barmode: 'stack' | 'group' | 'overlay' | 'relative';\n barnorm: '' | 'fraction' | 'percent';\n bargap: number;\n bargroupgap: number;\n boxmode: 'group' | 'overlay';\n selectdirection: 'h' | 'v' | 'd' | 'any';\n hiddenlabels: string[];\n grid: Partial<{\n rows: number;\n roworder: 'top to bottom' | 'bottom to top';\n columns: number;\n subplots: string[];\n xaxes: string[];\n yaxes: string[];\n pattern: 'independent' | 'coupled';\n xgap: number;\n ygap: number;\n domain: Partial<{\n x: number[];\n y: number[];\n }>;\n xside: 'bottom' | 'bottom plot' | 'top plot' | 'top';\n yside: 'left' | 'left plot' | 'right plot' | 'right';\n }>;\n polar: Partial<PolarLayout>;\n polar2: Partial<PolarLayout>;\n polar3: Partial<PolarLayout>;\n polar4: Partial<PolarLayout>;\n polar5: Partial<PolarLayout>;\n polar6: Partial<PolarLayout>;\n polar7: Partial<PolarLayout>;\n polar8: Partial<PolarLayout>;\n polar9: Partial<PolarLayout>;\n template: Template;\n clickmode: 'event' | 'select' | 'event+select' | 'none';\n uirevision: number | string;\n uid: string;\n datarevision: number | string;\n editrevision: number | string;\n selectionrevision: number | string;\n}\n\nexport interface Legend extends Label {\n borderwidth: number;\n groupclick: 'toggleitem' | 'togglegroup';\n grouptitlefont: Partial<Font>;\n itemclick: 'toggle' | 'toggleothers' | false;\n itemdoubleclick: 'toggle' | 'toggleothers' | false;\n itemsizing: 'trace' | 'constant';\n itemwidth: number;\n orientation: 'v' | 'h';\n title: Partial<LegendTitle>;\n tracegroupgap: number;\n traceorder: 'grouped' | 'normal' | 'reversed' | 'reversed+grouped';\n uirevision: number | string;\n uid: string;\n valign: 'top' | 'middle' | 'bottom';\n x: number;\n xanchor: 'auto' | 'left' | 'center' | 'right';\n xref: 'container' | 'paper';\n y: number;\n yanchor: 'auto' | 'top' | 'middle' | 'bottom';\n yref: 'container' | 'paper';\n}\n\nexport type AxisType = '-' | 'linear' | 'log' | 'date' | 'category' | 'multicategory';\n\nexport type DTickValue = number | string;\n\nexport interface TickFormatStop {\n /**\n * Determines whether or not this stop is used. If `false`,\n * this stop is ignored even within its `dtickrange`.\n */\n enabled: boolean;\n /**\n * Range [`min`, `max`], where `min`, `max` - dtick values\n * which describe some zoom level, it is possible to omit `min` or `max`\n * value by passing `null`\n */\n dtickrange: [DTickValue | null, DTickValue | null];\n /**\n * dtickformat for described zoom level, the same as `tickformat`\n */\n value: string;\n /**\n * When used in a template, named items are created in the output figure\n * in addition to any items the figure already has in this array.\n * You can modify these items in the output figure by making\n * your own item with `templateitemname` matching this `name`\n * alongside your modifications (including `visible: false` or `enabled: false` to hide it).\n * Has no effect outside of a template.\n */\n name: string;\n /**\n * Used to refer to a named item in this array in the template.\n * Named items from the template will be created even without\n * a matching item in the input figure, but you can modify one by\n * making an item with `templateitemname` matching its `name`,\n * alongside your modifications (including `visible: false` or `enabled: false` to hide it).\n * If there is no template or no matching item, this item will be hidden\n * unless you explicitly show it with `visible: true`.\n */\n templateitemname: string;\n}\n\nexport interface AutoRangeOptions {\n clipmax: DTickValue;\n clipmin: DTickValue;\n include: DTickValue;\n maxallowed: DTickValue;\n minallowed: DTickValue;\n}\n\nexport interface MinorAxisLayout {\n dtick: DTickValue;\n gridcolor: Color;\n griddash: Dash;\n gridwidth: number;\n nticks: number;\n showgrid: boolean;\n tick0: DTickValue;\n tickcolor: Color;\n ticklen: number;\n tickmode: 'auto' | 'linear' | 'array';\n ticks: 'outside' | 'inside' | '';\n tickvals: any[];\n tickwidth: number;\n}\n\nexport interface RangeBreak {\n bounds: any[];\n dvalue: number;\n enabled: boolean;\n name: string;\n pattern: 'day of week' | 'hour' | '';\n templateitemname: string;\n values: any[];\n}\n\nexport interface Axis {\n /**\n * A single toggle to hide the axis while preserving interaction like dragging.\n * Default is true when a cheater plot is present on the axis, otherwise\n * false\n */\n visible: boolean;\n /**\n * Sets default for all colors associated with this axis\n * all at once: line, font, tick, and grid colors.\n * Grid color is lightened by blending this with the plot background\n * Individual pieces can override this.\n */\n color: Color;\n title: string | Partial<DataTitle>;\n /**\n * Former `titlefont` is now the sub-attribute `font` of `title`.\n * To customize title font properties, please use `title.font` now.\n */\n titlefont: Partial<Font>;\n type: AxisType;\n autorange: true | false | 'reversed' | 'min reversed' | 'max reversed' | 'min' | 'max';\n autorangeoptions: Partial<AutoRangeOptions>;\n /**\n * 'If *normal*, the range is computed in relation to the extrema\n * of the input data.\n * If *tozero*`, the range extends to 0,\n * regardless of the input data\n * If *nonnegative*, the range is non-negative,\n * regardless of the input data.\n * Applies only to linear axes.\n */\n rangemode: 'normal' | 'tozero' | 'nonnegative';\n range: any[];\n /**\n * Determines whether or not this axis is zoom-able.\n * If true, then zoom is disabled.\n */\n fixedrange: boolean;\n\n /**\n * Ticks\n */\n tickmode: 'auto' | 'linear' | 'array';\n nticks: number;\n tick0: number | string;\n dtick: DTickValue;\n tickvals: any[];\n ticktext: string[];\n ticks: 'outside' | 'inside' | '';\n mirror: true | 'ticks' | false | 'all' | 'allticks';\n ticklen: number;\n tickwidth: number;\n tickcolor: Color;\n showticklabels: boolean;\n showspikes: boolean;\n spikecolor: Color;\n spikethickness: number;\n /**\n * Specifies the ordering logic for the case of categorical variables.\n * By default, plotly uses *trace*, which specifies the order that is present in the data supplied.\n * Set `categoryorder` to *category ascending* or *category descending* if order should be determined by\n * the alphanumerical order of the category names.\n * Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category\n * is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to\n * the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.\n * Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the\n * numerical order of the values.\n * Similarly, the order can be determined by the min, max, sum, mean or median of all the values.\n */\n categoryorder:\n | 'trace'\n | 'category ascending'\n | 'category descending'\n | 'array'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n categoryarray: any[];\n tickfont: Partial<Font>;\n tickangle: 'auto' | number;\n tickprefix: string;\n /**\n * If `all`, all tick labels are displayed with a prefix.\n * If `first`, only the first tick is displayed with a prefix.\n * If `last`, only the last tick is displayed with a suffix.\n * If `none`, tick prefixes are hidden.\n */\n showtickprefix: 'all' | 'first' | 'last' | 'none';\n /**\n * Sets a tick label suffix.\n */\n ticksuffix: string;\n /**\n * Same as `showtickprefix` but for tick suffixes.\n */\n showticksuffix: 'all' | 'first' | 'last' | 'none';\n /**\n * If `all`, all exponents are shown besides their significands.\n * If `first`, only the exponent of the first tick is shown.\n * If `last`, only the exponent of the last tick is shown.\n * If `none`, no exponents appear.\n */\n showexponent: 'all' | 'first' | 'last' | 'none';\n /**\n * Determines a formatting rule for the tick exponents.\n * For example, consider the number 1,000,000,000.\n * If `none`, it appears as *1,000,000,000*.\n * If `e`, *1e+9*.\n * If `E`, *1E+9*.\n * If `power`, *1x10^9* (with 9 in a super script).\n * If `SI`, *1G*.\n * If `B`, *1B*.\n */\n exponentformat: 'none' | 'e' | 'E' | 'power' | 'SI' | 'B';\n /**\n * Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is \"SI\" or \"B\".\n */\n minexponent: number;\n /**\n * 'If `true`, even 4-digit integers are separated\n */\n separatethousands: boolean;\n /**\n * Sets the tick label formatting rule using d3 formatting mini-languages\n * which are very similar to those in Python.\n * For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format\n * And for dates see: https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format\n * We add one item to d3's date formatter: `%{n}f` for fractional seconds with n digits.\n * For example, `\"2016-10-13 09:15:23.456\"` with tickformat `\"%H~%M~%S.%2f\"` would display `\"09~15~23.46\"`\n */\n tickformat: string;\n /**\n * Sets the hover text formatting rule using d3 formatting mini-languages\n * which are very similar to those in Python.\n * For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format\n * And for dates see: https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format\n * We add one item to d3's date formatter: `%{n}f` for fractional seconds with n digits.\n * For example, `\"2016-10-13 09:15:23.456\"` with tickformat `\"%H~%M~%S.%2f\"` would display \"09~15~23.46\"\n */\n hoverformat: string;\n calendar: Calendar;\n /**\n * Array of `Partial<TickFormatStop>` objects.\n */\n tickformatstops: Array<Partial<TickFormatStop>>;\n spikedash: string;\n /**\n * Determines the drawing mode for the spike line.\n * If `toaxis`, the line is drawn from the data point to the axis the\n * series is plotted on.\n * If `across`, the line is drawn across the entire plot area, and\n * supercedes *toaxis*.\n * If `marker`, then a marker dot is drawn on the axis the series is\n * plotted on\n */\n spikemode:\n | 'toaxis'\n | 'across'\n | 'marker'\n | 'toaxis+across'\n | 'toaxis+across+marker'\n | 'across+marker'\n | 'toaxis+marker';\n /**\n * Determines whether spikelines are stuck to the cursor or to the closest datapoints.\n */\n spikesnap: 'data' | 'cursor' | 'hovered data';\n\n /**\n * Lines and Grids\n */\n\n /**\n * Determines whether or not a line bounding this axis is drawn.\n */\n showline: boolean;\n /**\n * Sets the axis line color\n */\n linecolor: Color;\n /**\n * Sets the width (in px) of the axis line.\n */\n linewidth: number;\n /**\n * Determines whether or not grid lines are drawn.\n * If `true`, the grid lines are drawn at every tick mark.\n */\n showgrid: boolean;\n /**\n * Sets the color of the grid lines.\n */\n gridcolor: Color;\n /**\n * Sets the width (in px) of the grid lines.\n */\n gridwidth: number;\n /**\n * Determines whether or not a line is drawn at along the 0 value\n * of this axis.\n * If `true`, the zero line is drawn on top of the grid lines.\n */\n zeroline: boolean;\n /**\n * Sets the line color of the zero line.\n */\n zerolinecolor: Color;\n /**\n * Sets the width (in px) of the zero line.\n */\n zerolinewidth: number;\n /**\n * Determines whether or not a dividers are drawn\n * between the category levels of this axis.\n * Only has an effect on *multicategory* axes.\n */\n showdividers: boolean;\n /**\n * Sets the color of the dividers\n * Only has an effect on *multicategory* axes.\n */\n dividercolor: Color;\n /**\n * Sets the width (in px) of the dividers\n * Only has an effect on *multicategory* axes.\n */\n dividerwidth: number;\n\n autotypenumbers: 'convert types' | 'strict';\n labelalias: DTickValue;\n maxallowed: DTickValue;\n minallowed: DTickValue;\n}\n\nexport type Calendar =\n | 'gregorian'\n | 'chinese'\n | 'coptic'\n | 'discworld'\n | 'ethiopian'\n | 'hebrew'\n | 'islamic'\n | 'julian'\n | 'mayan'\n | 'nanakshahi'\n | 'nepali'\n | 'persian'\n | 'jalali'\n | 'taiwan'\n | 'thai'\n | 'ummalqura';\n\n// regex from documentation: \"/^x([2-9]|[1-9][0-9]+)?( domain)?$/\" | \"/^y([2-9]|[1-9][0-9]+)?( domain)?$/\"\n// regex allows for an unlimited amount of digits for the 'axis number',\n// but the following typescript definition is limited to two digits\ntype xYAxisNames = `${\n | ''\n | `${2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`}${'' | ' domain'}`;\n\nexport type XAxisName = `x${xYAxisNames}`;\nexport type YAxisName = `y${xYAxisNames}`;\n\nexport type AxisName = XAxisName | YAxisName;\n\nexport interface LayoutAxis extends Axis {\n fixedrange: boolean;\n scaleanchor: AxisName;\n scaleratio: number;\n constrain: 'range' | 'domain';\n constraintoward: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';\n anchor: 'free' | AxisName;\n side: 'top' | 'bottom' | 'left' | 'right' | 'clockwise' | 'counterclockwise';\n overlaying: 'free' | AxisName;\n layer: 'above traces' | 'below traces';\n domain: number[];\n position: number;\n rotation: number;\n direction: 'counterclockwise' | 'clockwise';\n rangeslider: Partial<RangeSlider>;\n rangeselector: Partial<RangeSelector>;\n automargin: boolean;\n autotick: boolean;\n angle: any;\n griddash: Dash;\n l2p: (v: Datum) => number;\n\n autotickangles: number[];\n insiderange: any[];\n matches: AxisName;\n minor: Partial<MinorAxisLayout>;\n rangebreaks: Array<Partial<RangeBreak>>;\n ticklabelmode: 'instant' | 'period';\n ticklabeloverflow: 'allow' | 'hide past div' | 'hide past domain';\n ticklabelposition:\n | 'outside'\n | 'inside'\n | 'outside top'\n | 'inside top'\n | 'outside left'\n | 'inside left'\n | 'outside right'\n | 'inside right'\n | 'outside bottom'\n | 'inside bottom';\n ticklabelstep: number;\n tickson: 'labels' | 'boundaries';\n uirevision: DTickValue;\n}\n\nexport interface SceneAxis extends Axis {\n spikesides: boolean;\n showbackground: boolean;\n backgroundcolor: Color;\n showaxeslabels: boolean;\n}\n\nexport interface ShapeLine {\n color: string;\n width: number;\n dash: Dash;\n}\n\nexport interface ShapeLabel {\n font: Partial<Font>;\n padding: number;\n text: string;\n textangle: 'auto' | number;\n textposition:\n | 'top left'\n | 'top center'\n | 'top right'\n | 'middle left'\n | 'middle center'\n | 'middle right'\n | 'bottom left'\n | 'bottom center'\n | 'bottom right'\n | 'start'\n | 'middle'\n | 'end';\n texttemplate: string;\n xanchor: 'auto' | 'left' | 'center' | 'right';\n yanchor: 'top' | 'middle' | 'bottom';\n}\n\nexport interface Shape {\n visible: boolean | 'legendonly';\n layer: 'below' | 'above';\n type: 'rect' | 'circle' | 'line' | 'path';\n path: string;\n xref: 'paper' | XAxisName;\n xsizemode: 'scaled' | 'pixel';\n xanchor: number | string;\n yref: 'paper' | YAxisName;\n ysizemode: 'scaled' | 'pixel';\n yanchor: number | string;\n x0: Datum;\n y0: Datum;\n x1: Datum;\n y1: Datum;\n fillcolor: string;\n name: string;\n templateitemname: string;\n opacity: number;\n line: Partial<ShapeLine>;\n label: Partial<ShapeLabel>;\n showlegend: boolean;\n legendgroup: string;\n legendgrouptitle: {\n text: string;\n font?: Partial<Font>;\n };\n legendrank: number;\n}\n\nexport interface Margin {\n t: number;\n b: number;\n l: number;\n r: number;\n pad: number;\n}\n\nexport interface Icon {\n height?: number | undefined;\n width?: number | undefined;\n ascent?: number | undefined;\n descent?: number | undefined;\n name?: string | undefined;\n path?: string | undefined;\n svg?: string | undefined;\n transform?: string | undefined;\n}\n\nexport interface GaugeLine {\n color: Color;\n width: number;\n}\nexport interface Threshold {\n line: Partial<GaugeLine>;\n value: number;\n thickness: number;\n}\n\nexport interface GaugeBar {\n color: Color;\n line: Partial<GaugeLine>;\n thickness: number;\n}\nexport interface Gauge {\n shape: 'angular' | 'bullet';\n bar: Partial<GaugeBar>;\n bgcolor: Color;\n bordercolor: Color;\n borderwidth: number;\n axis: Partial<Axis>;\n steps: Array<{ range: number[]; color: Color }>;\n threshold: Partial<Threshold>;\n}\n\nexport interface Delta {\n reference: number;\n position: 'top' | 'bottom' | 'left' | 'right';\n relative: boolean;\n valueformat: string;\n increasing: {\n symbol: string;\n color: Color;\n };\n decreasing: {\n symbol: string;\n color: Color;\n };\n}\n\nexport interface DataTitle {\n text: string;\n font: Partial<Font>;\n standoff: number;\n position:\n | 'top left'\n | 'top center'\n | 'top right'\n | 'middle center'\n | 'bottom left'\n | 'bottom center'\n | 'bottom right';\n}\n\nexport interface PlotNumber {\n valueformat: string;\n font: Partial<Font>;\n prefix: string;\n suffix: string;\n}\n\nexport interface Template {\n data?: { [type in PlotType]?: Array<Partial<PlotData>> } | undefined;\n layout?: Partial<Layout> | undefined;\n}\n\n// Data\n\nexport type Datum = string | number | Date | null;\nexport type TypedArray =\n | Int8Array\n | Uint8Array\n | Int16Array\n | Uint16Array\n | Int32Array\n | Uint32Array\n | Uint8ClampedArray\n | Float32Array\n | Float64Array;\n\nexport interface ErrorOptions {\n visible: boolean;\n symmetric: boolean;\n color: Color;\n thickness: number;\n width: number;\n opacity: number;\n}\n\nexport type ErrorBar = Partial<ErrorOptions> &\n (\n | {\n type: 'constant' | 'percent';\n value: number;\n valueminus?: number | undefined;\n }\n | {\n type: 'data';\n array: Datum[];\n arrayminus?: Datum[] | undefined;\n }\n );\n\nexport type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot';\nexport type PlotType =\n | 'bar'\n | 'barpolar'\n | 'box'\n | 'candlestick'\n | 'carpet'\n | 'choropleth'\n | 'choroplethmapbox'\n | 'cone'\n | 'contour'\n | 'contourcarpet'\n | 'densitymapbox'\n | 'funnel'\n | 'funnelarea'\n | 'heatmap'\n | 'heatmapgl'\n | 'histogram'\n | 'histogram2d'\n | 'histogram2dcontour'\n | 'image'\n | 'indicator'\n | 'isosurface'\n | 'mesh3d'\n | 'ohlc'\n | 'parcats'\n | 'parcoords'\n | 'pie'\n | 'pointcloud'\n | 'sankey'\n | 'scatter'\n | 'scatter3d'\n | 'scattercarpet'\n | 'scattergeo'\n | 'scattergl'\n | 'scattermapbox'\n | 'scatterpolar'\n | 'scatterpolargl'\n | 'scatterternary'\n | 'splom'\n | 'streamtube'\n | 'sunburst'\n | 'surface'\n | 'table'\n | 'treemap'\n | 'violin'\n | 'volume'\n | 'waterfall'\n // adding custom plot types as seen in AI generated plotly schema\n | 'gauge';\n\nexport type Data = Partial<PlotData> | Partial<PieData> | Partial<SankeyData>;\n\nexport type Color =\n | string\n | number\n | Array<string | number | undefined | null>\n | Array<Array<string | number | undefined | null>>;\nexport type ColorScale = string | string[] | Array<[number, string]>;\nexport type DataTransform = Partial<Transform>;\nexport type ScatterData = PlotData;\n\n// Bar Scatter\nexport interface PlotData {\n type: PlotType;\n x: Datum[] | Datum[][] | TypedArray;\n y: Datum[] | Datum[][] | TypedArray;\n z: Datum[] | Datum[][] | Datum[][][] | TypedArray;\n i: TypedArray;\n j: TypedArray;\n k: TypedArray;\n xy: Float32Array;\n error_x: ErrorBar;\n error_y: ErrorBar;\n xaxis: string;\n yaxis: string;\n text: string | string[];\n lat: Datum[];\n lon: Datum[];\n line: Partial<ScatterLine>;\n 'line.color': Color;\n 'line.width': number;\n 'line.dash': Dash;\n 'line.shape': 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv';\n 'line.smoothing': number;\n 'line.simplify': boolean;\n marker: Partial<PlotMarker>;\n 'marker.symbol': MarkerSymbol | MarkerSymbol[];\n 'marker.color': Color;\n 'marker.colorscale': ColorScale | ColorScale[];\n 'marker.opacity': number | number[];\n 'marker.size': number | number[] | number[][];\n 'marker.maxdisplayed': number;\n 'marker.sizeref': number;\n 'marker.sizemax': number;\n 'marker.sizemin': number;\n 'marker.sizemode': 'diameter' | 'area';\n 'marker.showscale': boolean;\n 'marker.line': Partial<ScatterMarkerLine>;\n 'marker.line.color': Color;\n 'marker.line.colorscale': ColorScale | ColorScale[];\n 'marker.colorbar': {}; // TODO\n 'marker.pad.t': number;\n 'marker.pad.b': number;\n 'marker.pad.l': number;\n 'marker.pad.r': number;\n mode:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta';\n histfunc: 'count' | 'sum' | 'avg' | 'min' | 'max';\n histnorm: '' | 'percent' | 'probability' | 'density' | 'probability density';\n hoveron: 'points' | 'fills';\n hoverinfo:\n | 'all'\n | 'name'\n | 'none'\n | 'skip'\n | 'text'\n | 'x'\n | 'x+text'\n | 'x+name'\n | 'x+y'\n | 'x+y+text'\n | 'x+y+name'\n | 'x+y+z'\n | 'x+y+z+text'\n | 'x+y+z+name'\n | 'y'\n | 'y+name'\n | 'y+x'\n | 'y+text'\n | 'y+x+text'\n | 'y+x+name'\n | 'y+z'\n | 'y+z+text'\n | 'y+z+name'\n | 'y+x+z'\n | 'y+x+z+text'\n | 'y+x+z+name'\n | 'z'\n | 'z+x'\n | 'z+x+text'\n | 'z+x+name'\n | 'z+y+x'\n | 'z+y+x+text'\n | 'z+y+x+name'\n | 'z+x+y'\n | 'z+x+y+text'\n | 'z+x+y+name';\n hoverlabel: Partial<HoverLabel>;\n hovertemplate: string | string[];\n hovertext: string | string[];\n hoverongaps: boolean;\n xhoverformat: string;\n yhoverformat: string;\n zhoverformat: string;\n texttemplate: string | string[];\n textinfo:\n | 'label'\n | 'label+text'\n | 'label+value'\n | 'label+percent'\n | 'label+text+value'\n | 'label+text+percent'\n | 'label+value+percent'\n | 'text'\n | 'text+value'\n | 'text+percent'\n | 'text+value+percent'\n | 'value'\n | 'value+percent'\n | 'percent'\n | 'none';\n textposition:\n | 'top left'\n | 'top center'\n | 'top right'\n | 'middle left'\n | 'middle center'\n | 'middle right'\n | 'bottom left'\n | 'bottom center'\n | 'bottom right'\n | 'inside'\n | 'outside'\n | 'auto'\n | 'none';\n textfont: Partial<Font>;\n textangle: 'auto' | number;\n insidetextanchor: 'end' | 'middle' | 'start';\n constraintext: 'inside' | 'outside' | 'both' | 'none';\n fill: 'none' | 'tozeroy' | 'tozerox' | 'tonexty' | 'tonextx' | 'toself' | 'tonext';\n fillcolor: string;\n fillpattern: Partial<Pattern>;\n showlegend: boolean;\n legendgroup: string;\n legendgrouptitle: {\n text: string;\n font?: Partial<Font>;\n };\n legendrank: number;\n parents: string[];\n name: string;\n stackgroup: string;\n groupnorm: '' | 'fraction' | 'percent';\n stackgaps: 'infer zero' | 'interpolate';\n connectgaps: boolean;\n visible: boolean | 'legendonly';\n delta: Partial<Delta>;\n gauge: Partial<Gauge>;\n number: Partial<PlotNumber>;\n transforms: DataTransform[];\n orientation: 'v' | 'h';\n width: number | number[];\n boxmean: boolean | 'sd';\n boxpoints: 'all' | 'outliers' | 'suspectedoutliers' | false;\n jitter: number;\n pointpos: number;\n opacity: number;\n showscale: boolean;\n colorscale: ColorScale;\n zsmooth: 'fast' | 'best' | false;\n zmin: number;\n zmax: number;\n ygap: number;\n xgap: number;\n transpose: boolean;\n autobinx: boolean;\n xbins: {\n start: number | string;\n end: number | string;\n size: number | string;\n };\n value: number;\n values: Datum[];\n labels: Datum[];\n direction: 'clockwise' | 'counterclockwise';\n hole: number;\n rotation: number;\n theta: Datum[];\n r: Datum[];\n customdata: Datum[] | Datum[][];\n selectedpoints: Datum[];\n domain: Partial<{\n row: number;\n column: number;\n x: number[];\n y: number[];\n }>;\n title: Partial<DataTitle>;\n branchvalues: 'total' | 'remainder';\n ids: string[];\n level: string;\n cliponaxis: boolean;\n automargin: boolean;\n locationmode: 'ISO-3' | 'USA-states' | 'country names' | 'geojson-id';\n locations: Datum[];\n reversescale: boolean;\n colorbar: Partial<ColorBar>;\n offset: number | number[];\n contours: Partial<{\n coloring: 'fill' | 'heatmap' | 'lines' | 'none';\n end: number;\n labelfont: Partial<Font>;\n labelformat: string;\n operation: '=' | '<' | '>=' | '>' | '<=' | '[]' | '()' | '[)' | '(]' | '][' | ')(' | '](' | ')[';\n showlabels: boolean;\n showlines: boolean;\n size: number;\n start: number;\n type: 'levels' | 'constraint';\n value: number | [lowerBound: number, upperBound: number];\n }>;\n autocontour: boolean;\n ncontours: number;\n uirevision: string | number;\n uid: string;\n}\n\n/**\n * These interfaces are based on attribute descriptions in\n * https://github.com/plotly/plotly.js/tree/9d6144304308fc3007f0facf2535d38ea3e9b26c/src/transforms\n */\nexport interface TransformStyle {\n target: number | string | number[] | string[];\n value: Partial<PlotData>;\n}\n\nexport interface TransformAggregation {\n target: string;\n func?: 'count' | 'sum' | 'avg' | 'median' | 'mode' | 'rms' | 'stddev' | 'min' | 'max' | 'first' | 'last' | undefined;\n funcmode?: 'sample' | 'population' | undefined;\n enabled?: boolean | undefined;\n}\n\nexport interface Transform {\n type: 'aggregate' | 'filter' | 'groupby' | 'sort';\n enabled: boolean;\n target: number | string | number[] | string[];\n operation: string;\n aggregations: TransformAggregation[];\n preservegaps: boolean;\n groups: string | number[] | string[];\n nameformat: string;\n styles: TransformStyle[];\n value: any;\n order: 'ascending' | 'descending';\n}\n\nexport interface ColorBar {\n thicknessmode: 'fraction' | 'pixels';\n thickness: number;\n lenmode: 'fraction' | 'pixels';\n len: number;\n x: number;\n xanchor: 'left' | 'center' | 'right';\n xpad: number;\n y: number;\n yanchor: 'top' | 'middle' | 'bottom';\n ypad: number;\n outlinecolor: Color;\n outlinewidth: number;\n bordercolor: Color;\n borderwidth: Color;\n bgcolor: Color;\n tickmode: 'auto' | 'linear' | 'array';\n nticks: number;\n tick0: number | string;\n dtick: DTickValue;\n tickvals: Datum[] | Datum[][] | Datum[][][] | TypedArray;\n ticktext: Datum[] | Datum[][] | Datum[][][] | TypedArray;\n ticks: 'outside' | 'inside' | '';\n ticklen: number;\n tickwidth: number;\n tickcolor: Color;\n showticklabels: boolean;\n tickfont: Font;\n tickangle: 'auto' | number;\n tickformat: string;\n tickformatstops: Array<Partial<TickFormatStop>>;\n tickprefix: string;\n showtickprefix: 'all' | 'first' | 'last' | 'none';\n ticksuffix: string;\n showticksuffix: 'all' | 'first' | 'last' | 'none';\n separatethousands: boolean;\n exponentformat: 'none' | 'e' | 'E' | 'power' | 'SI' | 'B';\n showexponent: 'all' | 'first' | 'last' | 'none';\n minexponent: number;\n title: string;\n titlefont: Font;\n titleside: 'right' | 'top' | 'bottom';\n tickvalssrc: any;\n ticktextsrc: any;\n}\n\nexport type MarkerSymbol = string | number | Array<string | number>;\n\n/**\n * Any combination of \"x\", \"y\", \"z\", \"text\", \"name\" joined with a \"+\" OR \"all\" or \"none\" or \"skip\".\n * examples: \"x\", \"y\", \"x+y\", \"x+y+z\", \"all\"\n * default: \"all\"\n */\nexport interface PlotMarker {\n symbol: MarkerSymbol;\n color?: Color | Color[] | undefined;\n colors?: Color[] | undefined;\n colorscale?: ColorScale | undefined;\n cauto?: boolean | undefined;\n cmax?: number | undefined;\n cmin?: number | undefined;\n autocolorscale?: boolean | undefined;\n reversescale?: boolean | undefined;\n opacity: number | number[];\n size: number | number[];\n maxdisplayed?: number | undefined;\n sizeref?: number | undefined;\n sizemax?: number | undefined;\n sizemin?: number | undefined;\n sizemode?: 'diameter' | 'area' | undefined;\n showscale?: boolean | undefined;\n line: Partial<ScatterMarkerLine>;\n pad?: Partial<Padding> | undefined;\n width?: number | undefined;\n colorbar?: Partial<ColorBar> | undefined;\n gradient?:\n | {\n type: 'radial' | 'horizontal' | 'vertical' | 'none';\n color: Color;\n typesrc: any;\n colorsrc: any;\n }\n | undefined;\n pattern?: Partial<Pattern>;\n}\n\nexport type ScatterMarker = PlotMarker;\n\nexport interface ScatterMarkerLine {\n width: number | number[];\n color: Color;\n cauto?: boolean | undefined;\n cmax?: number | undefined;\n cmin?: number | undefined;\n cmid?: number | undefined;\n colorscale?: ColorScale | undefined;\n autocolorscale?: boolean | undefined;\n reversescale?: boolean | undefined;\n coloraxis?: string | undefined;\n}\n\nexport interface ScatterLine {\n color: Color;\n width: number;\n dash: Dash;\n shape: 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv';\n smoothing: number;\n simplify: boolean;\n}\n\nexport interface Font {\n color: Color;\n /**\n * HTML font family - the typeface that will be applied by the web browser.\n * The web browser will only be able to apply a font if it is available on the system\n * which it operates. Provide multiple font families, separated by commas, to indicate\n * the preference in which to apply fonts if they aren't available on the system.\n * The plotly service (at https://plot.ly or on-premise) generates images on a server,\n * where only a select number of fonts are installed and supported.\n * These include *Arial*, *Balto*, *Courier New*, *Droid Sans*, *Droid Serif*,\n * *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,\n * *PT Sans Narrow*, *Raleway*, *Times New Roman*.\n * @default \"Arial, sans-serif\"\n */\n family: string;\n /**\n * Sets the shape and color of the shadow behind text. \"auto\" places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.\n * @default \"none\"\n */\n shadow: string;\n /**\n * number greater than or equal to 1\n * @default 13\n */\n size: number;\n /**\n * Sets the weight (or boldness) of the font.\n * number between or equal to 1 and 1000\n * @default normal\n */\n weight: number;\n}\n\nexport interface Config {\n /**\n * Determines whether math should be typeset or not,\n * when MathJax (either v2 or v3) is present on the page.\n */\n typesetMath: boolean;\n\n /** DO autosize once regardless of layout.autosize (use default width or height values otherwise) */\n autosizable: boolean;\n\n /** set the length of the undo/redo queue */\n queueLength: number;\n\n /** if we DO autosize, do we fill the container or the screen? */\n fillFrame: boolean;\n\n /** if we DO autosize, set the frame margins in percents of plot size */\n frameMargins: number;\n\n /** Set global transform to be applied to all traces with no specification needed */\n globalTransforms: any[];\n\n /** Which localization should we use? Should be a string like 'en' or 'en-US' */\n locale: string;\n\n /**\n * Localization definitions\n * Locales can be provided either here (specific to one chart) or globally\n * by registering them as modules.\n * Should be an object of objects {locale: {dictionary: {...}, format: {...}}}\n * {\n * da: {\n * dictionary: {'Reset axes': 'Nulstil aksler', ...},\n * format: {months: [...], shortMonths: [...]}\n * },\n * ...\n * }\n * All parts are optional. When looking for translation or format fields, we\n * look first for an exact match in a config locale, then in a registered\n * module. If those fail, we strip off any regionalization ('en-US' -> 'en')\n * and try each (config, registry) again. The final fallback for translation\n * is untranslated (which is US English) and for formats is the base English\n * (the only consequence being the last fallback date format %x is DD/MM/YYYY\n * instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored\n * for our automatic number formatting, but can be used in custom formats.\n */\n locales: {};\n\n /** Make the chart responsive to window size */\n responsive: boolean;\n}\n\n// Components\n\nexport interface RangeSlider {\n visible: boolean;\n thickness: number;\n range: [Datum, Datum];\n borderwidth: number;\n bordercolor: string;\n bgcolor: string;\n}\n\nexport interface RangeSelectorButton {\n step: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'all';\n stepmode: 'backward' | 'todate';\n count: number;\n label: string;\n}\n\nexport interface RangeSelector extends Label {\n buttons: Array<Partial<RangeSelectorButton>>;\n visible: boolean;\n x: number;\n xanchor: 'auto' | 'left' | 'center' | 'right';\n y: number;\n yanchor: 'auto' | 'top' | 'middle' | 'bottom';\n activecolor: string;\n borderwidth: number;\n}\n\nexport interface Label {\n /** Sets the background color of all hover labels on graph. */\n bgcolor: string;\n\n /** Sets the border color of all hover labels on graph. */\n bordercolor: string;\n\n /** Sets the default hover label font used by all traces on the graph. */\n font: Partial<Font>;\n}\n\nexport interface LegendTitle {\n font: Partial<Font>;\n side: 'top' | 'left' | 'top left' | 'top center' | 'top right';\n text: string;\n}\n\nexport interface HoverLabel extends Label {\n /**\n * Sets the horizontal alignment of the text content within hover label box.\n * @default \"auto\"\n */\n align: 'left' | 'right' | 'auto';\n\n /**\n * Sets the default length (in number of characters) of the trace name\n * in the hover labels for all traces.\n * -1 shows the whole name regardless of length.\n * @default 15\n */\n namelength: number;\n}\n\nexport interface Annotations extends Label {\n /** Determines whether or not this annotation is visible. */\n visible: boolean;\n\n /**\n * Sets the text associated with this annotation.\n * Plotly uses a subset of HTML tags to do things like\n * newline (<br>), bold (<b></b>), italics (<i></i>),\n * hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub>\n * <span> are also supported.\n */\n text: string;\n\n /** Sets the angle at which the `text` is drawn with respect to the horizontal. */\n textangle: string;\n\n /**\n * Sets an explicit width for the text box. null (default) lets the\n * text set the box width. Wider text will be clipped.\n * There is no automatic wrapping; use <br> to start a new line.\n */\n width: number;\n\n /**\n * Sets an explicit height for the text box. null (default) lets the\n * text set the box height. Taller text will be clipped.\n */\n height: number;\n\n /** Sets the opacity of the annotation (text + arrow). */\n opacity: number;\n\n /**\n * Sets the horizontal alignment of the `text` within the box.\n * Has an effect only if `text` spans more two or more lines\n * (i.e. `text` contains one or more <br> HTML tags) or if an\n * explicit width is set to override the text width.\n */\n align: 'left' | 'center' | 'right';\n\n /**\n * Sets the vertical alignment of the `text` within the box.\n * Has an effect only if an explicit height is set to override the text height.\n */\n valign: 'top' | 'middle' | 'bottom';\n\n /** Sets the padding (in px) between the `text` and the enclosing border. */\n borderpad: number;\n\n /** Sets the width (in px) of the border enclosing the annotation `text`. */\n borderwidth: number;\n\n /**\n * Determines whether or not the annotation is drawn with an arrow.\n * If *true*, `text` is placed near the arrow's tail.\n * If *false*, `text` lines up with the `x` and `y` provided.\n */\n showarrow: boolean;\n\n /** Sets the color of the annotation arrow. */\n arrowcolor: string;\n\n /** Sets the end annotation arrow head style. */\n arrowhead: number;\n\n /** Sets the start annotation arrow head style. */\n startarrowhead: number;\n\n /** Sets the annotation arrow head position. */\n arrowside: 'end' | 'start';\n\n /**\n * Sets the size of the end annotation arrow head, relative to `arrowwidth`.\n * A value of 1 (default) gives a head about 3x as wide as the line.\n */\n arrowsize: number;\n\n /**\n * Sets the size of the start annotation arrow head, relative to `arrowwidth`.\n * A value of 1 (default) gives a head about 3x as wide as the line.\n */\n startarrowsize: number;\n\n /** Sets the width (in px) of annotation arrow line. */\n arrowwidth: number;\n\n /**\n * Sets a distance, in pixels, to move the end arrowhead away from the\n * position it is pointing at, for example to point at the edge of\n * a marker independent of zoom. Note that this shortens the arrow\n * from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`\n * which moves everything by this amount.\n */\n standoff: number;\n\n /**\n * Sets a distance, in pixels, to move the start arrowhead away from the\n * position it is pointing at, for example to point at the edge of\n * a marker independent of zoom. Note that this shortens the arrow\n * from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`\n * which moves everything by this amount.\n */\n startstandoff: number;\n\n /**\n * Sets the x component of the arrow tail about the arrow head.\n * If `axref` is `pixel`, a positive (negative)\n * component corresponds to an arrow pointing\n * from right to left (left to right).\n * If `axref` is an axis, this is an absolute value on that axis,\n * like `x`, NOT a relative value.\n */\n ax: number;\n\n /**\n * Sets the y component of the arrow tail about the arrow head.\n * If `ayref` is `pixel`, a positive (negative)\n * component corresponds to an arrow pointing\n * from bottom to top (top to bottom).\n * If `ayref` is an axis, this is an absolute value on that axis,\n * like `y`, NOT a relative value.\n */\n ay: number;\n\n /**\n * Indicates in what terms the tail of the annotation (ax,ay)\n * is specified. If `pixel`, `ax` is a relative offset in pixels\n * from `x`. If set to an x axis id (e.g. *x* or *x2*), `ax` is\n * specified in the same terms as that axis. This is useful\n * for trendline annotations which should continue to indicate\n * the correct trend when zoomed.\n */\n axref: 'pixel' | XAxisName;\n\n /**\n * Indicates in what terms the tail of the annotation (ax,ay)\n * is specified. If `pixel`, `ay` is a relative offset in pixels\n * from `y`. If set to a y axis id (e.g. *y* or *y2*), `ay` is\n * specified in the same terms as that axis. This is useful\n * for trendline annotations which should continue to indicate\n * the correct trend when zoomed.\n */\n ayref: 'pixel' | YAxisName;\n\n /**\n * Sets the annotation's x coordinate axis.\n * If set to an x axis id (e.g. *x* or *x2*), the `x` position refers to an x coordinate\n * If set to *paper*, the `x` position refers to the distance from\n * the left side of the plotting area in normalized coordinates\n * where 0 (1) corresponds to the left (right) side.\n */\n xref: 'paper' | XAxisName;\n\n /**\n * Sets the annotation's x position.\n * If the axis `type` is *log*, then you must take the log of your desired range.\n * If the axis `type` is *date*, it should be date strings, like date data,\n * though Date objects and unix milliseconds will be accepted and converted to strings.\n * If the axis `type` is *category*, it should be numbers, using the scale where each\n * category is assigned a serial number from zero in the order it appears.\n */\n x: number | string;\n\n /**\n * Sets the text box's horizontal position anchor\n * This anchor binds the `x` position to the *left*, *center* or *right* of the annotation.\n * For example, if `x` is set to 1, `xref` to *paper* and `xanchor` to *right* then the\n * right-most portion of the annotation lines up with the right-most edge of the plotting area.\n * If *auto*, the anchor is equivalent to *center* for data-referenced annotations or if there\n * is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.\n */\n xanchor: 'auto' | 'left' | 'center' | 'right';\n\n /**\n * Shifts the position of the whole annotation and arrow to the\n * right (positive) or left (negative) by this many pixels.\n */\n xshift: number;\n\n /**\n * Sets the annotation's y coordinate axis.\n * If set to an y axis id (e.g. *y* or *y2*), the `y` position refers to an y coordinate\n * If set to *paper*, the `y` position refers to the distance from\n * the bottom of the plotting area in normalized coordinates\n * where 0 (1) corresponds to the bottom (top).\n */\n yref: 'paper' | YAxisName;\n\n /**\n * Sets the annotation's y position.\n * If the axis `type` is *log*, then you must take the log of your desired range.\n * If the axis `type` is *date*, it should be date strings, like date data,\n * though Date objects and unix milliseconds will be accepted and converted to strings.\n * If the axis `type` is *category*, it should be numbers, using the scale where each\n * category is assigned a serial number from zero in the order it appears.\n */\n y: number | string;\n\n /**\n * Sets the text box's vertical position anchor\n * This anchor binds the `y` position to the *top*, *middle* or *bottom* of the annotation.\n * For example, if `y` is set to 1, `yref` to *paper* and `yanchor` to *top* then the\n * top-most portion of the annotation lines up with the top-most edge of the plotting area.\n * If *auto*, the anchor is equivalent to *middle* for data-referenced annotations or if\n * there is an arrow, whereas for paper-referenced with no arrow, the anchor picked\n * corresponds to the closest side.\n */\n yanchor: 'auto' | 'top' | 'middle' | 'bottom';\n\n /**\n * Shifts the position of the whole annotation and arrow up\n * (positive) or down (negative) by this many pixels.\n */\n yshift: number;\n\n /**\n * Makes this annotation respond to clicks on the plot.\n * If you click a data point that exactly matches the `x` and `y` values of this annotation,\n * and it is hidden (visible: false), it will appear. In *onoff* mode, you must click the same\n * point again to make it disappear, so if you click multiple points, you can show multiple\n * annotations. In *onout* mode, a click anywhere else in the plot (on another data point or not)\n * will hide this annotation. If you need to show/hide this annotation in response to different\n * `x` or `y` values, you can set `xclick` and/or `yclick`. This is useful for example to label\n * the side of a bar. To label markers though, `standoff` is preferred over `xclick` and `yclick`.\n */\n clicktoshow: false | 'onoff' | 'onout';\n\n /**\n * Toggle this annotation when clicking a data point whose `x` value\n * is `xclick` rather than the annotation's `x` value.\n */\n xclick: any;\n\n /**\n * Toggle this annotation when clicking a data point whose `y` value\n * is `yclick` rather than the annotation's `y` value.\n */\n yclick: any;\n\n /**\n * Sets text to appear when hovering over this annotation.\n * If omitted or blank, no hover label will appear.\n */\n hovertext: string;\n\n hoverlabel: Partial<HoverLabel>;\n\n /**\n * Determines whether the annotation text box captures mouse move and click events,\n * or allows those events to pass through to data points in the plot that may be\n * behind the annotation. By default `captureevents` is *false* unless `hovertext`\n * is provided. If you use the event `plotly_clickannotation` without `hovertext`\n * you must explicitly enable `captureevents`.\n */\n captureevents: boolean;\n}\n\nexport interface Domain {\n x: number[];\n y: number[];\n row: number;\n column: number;\n}\n\nexport interface Padding {\n /**\n * The amount of padding (in px) along the top of the component.\n */\n t: number;\n /**\n * The amount of padding (in px) on the right side of the component.\n */\n r: number;\n /**\n * The amount of padding (in px) along the bottom of the component.\n */\n b: number;\n /**\n * The amount of padding (in px) on the left side of the component.\n */\n l: number;\n editType: 'arraydraw';\n}\n\n/**\n * 'Sets the pattern within the marker.\n */\nexport interface Pattern {\n /**\n * Sets the shape of the pattern fill.\n * By default, no pattern is used for filling the area.\n */\n shape?: '' | '/' | '\\\\' | 'x' | '-' | '|' | '+' | '.';\n /**\n * Determines whether `marker.color` should be used\n * as a default to `bgcolor` or a `fgcolor`.\n */\n fillmode?: 'replace' | 'overlay';\n /**\n * When there is no colorscale sets the color of background pattern fill.\n * Defaults to a `marker.color` background when `fillmode` is *overlay*.\n * Otherwise, defaults to a transparent background.\n */\n bgcolor?: string;\n /**\n * When there is no colorscale sets the color of foreground pattern fill.\n * Defaults to a `marker.color` background when `fillmode` is *replace*.\n * Otherwise, defaults to dark grey or white\n * to increase contrast with the `bgcolor`.\n */\n fgcolor?: string;\n /**\n * Sets the opacity of the foreground pattern fill.\n * Defaults to a 0.5 when `fillmode` is *overlay*.\n * Otherwise, defaults to 1.\n */\n fgopacity?: string;\n /**\n * Sets the size of unit squares of the pattern fill in pixels,\n * which corresponds to the interval of repetition of the pattern.\n */\n size?: number;\n /**\n * Sets the solidity of the pattern fill.\n * Solidity is roughly the fraction of the area filled by the pattern.\n * Solidity of 0 shows only the background color without pattern\n * and solidty of 1 shows only the foreground color without pattern.\n */\n solidity?: number;\n}\n"],"names":[],"rangeMappings":";;;;;;","mappings":"AAAA,uDAAuD,GACvD,qDAAqD,GAErD;;;;CAIC,GA81DD;;CAEC"}
|
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/* eslint-disable one-var */ /* eslint-disable vars-on-top */ /* eslint-disable no-var */ /* eslint-disable @typescript-eslint/no-explicit-any */ "use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
findArrayAttributes: function() {
|
|
13
|
+
return findArrayAttributes;
|
|
14
|
+
},
|
|
15
|
+
getColor: function() {
|
|
16
|
+
return getColor;
|
|
17
|
+
},
|
|
18
|
+
isArrayOrTypedArray: function() {
|
|
19
|
+
return isArrayOrTypedArray;
|
|
20
|
+
},
|
|
21
|
+
isDateArray: function() {
|
|
22
|
+
return isDateArray;
|
|
23
|
+
},
|
|
24
|
+
isLineData: function() {
|
|
25
|
+
return isLineData;
|
|
26
|
+
},
|
|
27
|
+
isMonthArray: function() {
|
|
28
|
+
return isMonthArray;
|
|
29
|
+
},
|
|
30
|
+
isNumberArray: function() {
|
|
31
|
+
return isNumberArray;
|
|
32
|
+
},
|
|
33
|
+
sanitizeJson: function() {
|
|
34
|
+
return sanitizeJson;
|
|
35
|
+
},
|
|
36
|
+
transformPlotlyJsonToDonutProps: function() {
|
|
37
|
+
return transformPlotlyJsonToDonutProps;
|
|
38
|
+
},
|
|
39
|
+
transformPlotlyJsonToScatterChartProps: function() {
|
|
40
|
+
return transformPlotlyJsonToScatterChartProps;
|
|
41
|
+
},
|
|
42
|
+
transformPlotlyJsonToVBCProps: function() {
|
|
43
|
+
return transformPlotlyJsonToVBCProps;
|
|
44
|
+
},
|
|
45
|
+
updateXValues: function() {
|
|
46
|
+
return updateXValues;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
50
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
51
|
+
const _d3array = require("d3-array");
|
|
52
|
+
const _d3scale = require("d3-scale");
|
|
53
|
+
const _d3format = require("d3-format");
|
|
54
|
+
const _colors = require("../../utilities/colors");
|
|
55
|
+
const _utilities = require("../../utilities/utilities");
|
|
56
|
+
const _d3timeformat = require("d3-time-format");
|
|
57
|
+
const SUPPORTED_PLOT_TYPES = [
|
|
58
|
+
'pie',
|
|
59
|
+
'bar',
|
|
60
|
+
'scatter',
|
|
61
|
+
'heatmap',
|
|
62
|
+
'sankey',
|
|
63
|
+
'indicator',
|
|
64
|
+
'histogram'
|
|
65
|
+
];
|
|
66
|
+
const dashOptions = {
|
|
67
|
+
dot: {
|
|
68
|
+
strokeDasharray: '1, 5',
|
|
69
|
+
strokeLinecap: 'round',
|
|
70
|
+
strokeWidth: '2',
|
|
71
|
+
lineBorderWidth: '4'
|
|
72
|
+
},
|
|
73
|
+
dash: {
|
|
74
|
+
strokeDasharray: '5, 5',
|
|
75
|
+
strokeLinecap: 'butt',
|
|
76
|
+
strokeWidth: '2',
|
|
77
|
+
lineBorderWidth: '4'
|
|
78
|
+
},
|
|
79
|
+
longdash: {
|
|
80
|
+
strokeDasharray: '10, 5',
|
|
81
|
+
strokeLinecap: 'butt',
|
|
82
|
+
strokeWidth: '2',
|
|
83
|
+
lineBorderWidth: '4'
|
|
84
|
+
},
|
|
85
|
+
dashdot: {
|
|
86
|
+
strokeDasharray: '5, 5, 1, 5',
|
|
87
|
+
strokeLinecap: 'butt',
|
|
88
|
+
strokeWidth: '2',
|
|
89
|
+
lineBorderWidth: '4'
|
|
90
|
+
},
|
|
91
|
+
longdashdot: {
|
|
92
|
+
strokeDasharray: '10, 5, 1, 5',
|
|
93
|
+
strokeLinecap: 'butt',
|
|
94
|
+
strokeWidth: '2',
|
|
95
|
+
lineBorderWidth: '4'
|
|
96
|
+
},
|
|
97
|
+
solid: {
|
|
98
|
+
strokeDasharray: '0',
|
|
99
|
+
strokeLinecap: 'butt',
|
|
100
|
+
strokeWidth: '2',
|
|
101
|
+
lineBorderWidth: '4'
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const isDate = (value)=>{
|
|
105
|
+
const parsedDate = new Date(Date.parse(value));
|
|
106
|
+
if (isNaN(parsedDate.getTime())) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const parsedYear = parsedDate.getFullYear();
|
|
110
|
+
const yearInString = /\b\d{4}\b/.test(value);
|
|
111
|
+
if (!yearInString && (parsedYear === 2000 || parsedYear === 2001)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
};
|
|
116
|
+
const isNumber = (value)=>!isNaN(parseFloat(value)) && isFinite(value);
|
|
117
|
+
const isMonth = (possiblyMonthValue)=>{
|
|
118
|
+
const parseFullMonth = (0, _d3timeformat.timeParse)('%B');
|
|
119
|
+
const parseShortMonth = (0, _d3timeformat.timeParse)('%b');
|
|
120
|
+
return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;
|
|
121
|
+
};
|
|
122
|
+
const isArrayOfType = (plotCoordinates, typeCheck, ...args)=>{
|
|
123
|
+
if (!isArrayOrTypedArray(plotCoordinates)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
if (plotCoordinates.length === 0) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
if (Array.isArray(plotCoordinates[0])) {
|
|
130
|
+
// Handle 2D array
|
|
131
|
+
return plotCoordinates.every((innerArray)=>innerArray.every((datum)=>typeCheck(datum, ...args)));
|
|
132
|
+
} else {
|
|
133
|
+
// Handle 1D array
|
|
134
|
+
return plotCoordinates.every((datum)=>typeCheck(datum, ...args));
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const isDateArray = (data)=>{
|
|
138
|
+
return isArrayOfType(data, isDate);
|
|
139
|
+
};
|
|
140
|
+
const isNumberArray = (data)=>{
|
|
141
|
+
return isArrayOfType(data, isNumber);
|
|
142
|
+
};
|
|
143
|
+
const isMonthArray = (data)=>{
|
|
144
|
+
return isArrayOfType(data, isMonth);
|
|
145
|
+
};
|
|
146
|
+
const isLineData = (data)=>{
|
|
147
|
+
return !SUPPORTED_PLOT_TYPES.includes(`${data.type}`) && Array.isArray(data.x) && isArrayOfType(data.y, (value)=>typeof value === 'number') && data.x.length > 0 && data.x.length === data.y.length;
|
|
148
|
+
};
|
|
149
|
+
const invalidate2Dseries = (series, chartType)=>{
|
|
150
|
+
var _series_x, _series_y;
|
|
151
|
+
if (((_series_x = series.x) === null || _series_x === void 0 ? void 0 : _series_x.length) > 0 && Array.isArray(series.x[0])) {
|
|
152
|
+
throw new Error(`transform to ${chartType}:: 2D x array not supported`);
|
|
153
|
+
}
|
|
154
|
+
if (((_series_y = series.y) === null || _series_y === void 0 ? void 0 : _series_y.length) > 0 && Array.isArray(series.y[0])) {
|
|
155
|
+
throw new Error(`transform to ${chartType}:: 2D y array not supported`);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const getLegend = (series, index)=>{
|
|
159
|
+
return series.name || `Series ${index + 1}`;
|
|
160
|
+
};
|
|
161
|
+
function getTitles(layout) {
|
|
162
|
+
var _layout_title, _layout_xaxis, _layout_xaxis1, _layout_xaxis_title, _layout_xaxis2, _layout_yaxis, _layout_yaxis1, _layout_yaxis_title, _layout_yaxis2;
|
|
163
|
+
var _layout_title_text, _layout_xaxis_title_text, _layout_yaxis_title_text;
|
|
164
|
+
const titles = {
|
|
165
|
+
chartTitle: typeof (layout === null || layout === void 0 ? void 0 : layout.title) === 'string' ? layout.title : (_layout_title_text = layout === null || layout === void 0 ? void 0 : (_layout_title = layout.title) === null || _layout_title === void 0 ? void 0 : _layout_title.text) !== null && _layout_title_text !== void 0 ? _layout_title_text : '',
|
|
166
|
+
xAxisTitle: typeof (layout === null || layout === void 0 ? void 0 : (_layout_xaxis = layout.xaxis) === null || _layout_xaxis === void 0 ? void 0 : _layout_xaxis.title) === 'string' ? layout === null || layout === void 0 ? void 0 : (_layout_xaxis1 = layout.xaxis) === null || _layout_xaxis1 === void 0 ? void 0 : _layout_xaxis1.title : (_layout_xaxis_title_text = layout === null || layout === void 0 ? void 0 : (_layout_xaxis2 = layout.xaxis) === null || _layout_xaxis2 === void 0 ? void 0 : (_layout_xaxis_title = _layout_xaxis2.title) === null || _layout_xaxis_title === void 0 ? void 0 : _layout_xaxis_title.text) !== null && _layout_xaxis_title_text !== void 0 ? _layout_xaxis_title_text : '',
|
|
167
|
+
yAxisTitle: typeof (layout === null || layout === void 0 ? void 0 : (_layout_yaxis = layout.yaxis) === null || _layout_yaxis === void 0 ? void 0 : _layout_yaxis.title) === 'string' ? layout === null || layout === void 0 ? void 0 : (_layout_yaxis1 = layout.yaxis) === null || _layout_yaxis1 === void 0 ? void 0 : _layout_yaxis1.title : (_layout_yaxis_title_text = layout === null || layout === void 0 ? void 0 : (_layout_yaxis2 = layout.yaxis) === null || _layout_yaxis2 === void 0 ? void 0 : (_layout_yaxis_title = _layout_yaxis2.title) === null || _layout_yaxis_title === void 0 ? void 0 : _layout_yaxis_title.text) !== null && _layout_yaxis_title_text !== void 0 ? _layout_yaxis_title_text : ''
|
|
168
|
+
};
|
|
169
|
+
return titles;
|
|
170
|
+
}
|
|
171
|
+
const updateXValues = (xValues)=>{
|
|
172
|
+
const presentYear = new Date().getFullYear();
|
|
173
|
+
if (xValues.length > 0 && Array.isArray(xValues[0])) {
|
|
174
|
+
throw new Error('updateXValues:: 2D array not supported');
|
|
175
|
+
}
|
|
176
|
+
const dates = xValues.map((possiblyMonthValue)=>{
|
|
177
|
+
const parsedDate = `${possiblyMonthValue} 01, ${presentYear}`;
|
|
178
|
+
return isDate(parsedDate) ? new Date(parsedDate) : null;
|
|
179
|
+
});
|
|
180
|
+
for(let i = dates.length - 1; i > 0; i--){
|
|
181
|
+
const currentMonth = dates[i].getMonth();
|
|
182
|
+
const previousMonth = dates[i - 1].getMonth();
|
|
183
|
+
const currentYear = dates[i].getFullYear();
|
|
184
|
+
const previousYear = dates[i - 1].getFullYear();
|
|
185
|
+
if (previousMonth >= currentMonth) {
|
|
186
|
+
dates[i - 1].setFullYear(dates[i].getFullYear() - 1);
|
|
187
|
+
} else if (previousYear > currentYear) {
|
|
188
|
+
dates[i - 1].setFullYear(currentYear);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
xValues = xValues.map((month, index)=>{
|
|
192
|
+
return `${month} 01, ${dates[index].getFullYear()}`;
|
|
193
|
+
});
|
|
194
|
+
return xValues;
|
|
195
|
+
};
|
|
196
|
+
const getColor = (legendLabel, colorMap, isDarkTheme)=>{
|
|
197
|
+
if (!colorMap.current.has(legendLabel)) {
|
|
198
|
+
const nextColor = (0, _colors.getNextColor)(colorMap.current.size + 1, 0, isDarkTheme);
|
|
199
|
+
colorMap.current.set(legendLabel, nextColor);
|
|
200
|
+
return nextColor;
|
|
201
|
+
}
|
|
202
|
+
return colorMap.current.get(legendLabel);
|
|
203
|
+
};
|
|
204
|
+
const getSecondaryYAxisValues = (series, layout)=>{
|
|
205
|
+
const secondaryYAxisValues = {};
|
|
206
|
+
if (layout && layout.yaxis2 && series.yaxis === 'y2') {
|
|
207
|
+
var _layout_yaxis2_title;
|
|
208
|
+
secondaryYAxisValues.secondaryYAxistitle = typeof layout.yaxis2.title === 'string' ? layout.yaxis2.title : typeof ((_layout_yaxis2_title = layout.yaxis2.title) === null || _layout_yaxis2_title === void 0 ? void 0 : _layout_yaxis2_title.text) === 'string' ? layout.yaxis2.title.text : '';
|
|
209
|
+
if (layout.yaxis2.range) {
|
|
210
|
+
secondaryYAxisValues.secondaryYScaleOptions = {
|
|
211
|
+
yMinValue: layout.yaxis2.range[0],
|
|
212
|
+
yMaxValue: layout.yaxis2.range[1]
|
|
213
|
+
};
|
|
214
|
+
} else {
|
|
215
|
+
const yValues = series.y;
|
|
216
|
+
if (yValues) {
|
|
217
|
+
secondaryYAxisValues.secondaryYScaleOptions = {
|
|
218
|
+
yMinValue: Math.min(...yValues),
|
|
219
|
+
yMaxValue: Math.max(...yValues)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
secondaryYAxisValues.secondaryYAxistitle = secondaryYAxisValues.secondaryYAxistitle !== '' ? secondaryYAxisValues.secondaryYAxistitle : undefined;
|
|
225
|
+
secondaryYAxisValues.secondaryYScaleOptions = secondaryYAxisValues.secondaryYScaleOptions && Object.keys(secondaryYAxisValues.secondaryYScaleOptions).length !== 0 ? secondaryYAxisValues.secondaryYScaleOptions : undefined;
|
|
226
|
+
return secondaryYAxisValues;
|
|
227
|
+
};
|
|
228
|
+
const transformPlotlyJsonToDonutProps = (input, colorMap, isDarkTheme)=>{
|
|
229
|
+
var _firstData_labels, _input_layout, _input_layout1, _input_layout2;
|
|
230
|
+
const firstData = input.data[0];
|
|
231
|
+
const donutData = (_firstData_labels = firstData.labels) === null || _firstData_labels === void 0 ? void 0 : _firstData_labels.map((label, index)=>{
|
|
232
|
+
var _firstData_values;
|
|
233
|
+
const color = getColor(label, colorMap, isDarkTheme);
|
|
234
|
+
return {
|
|
235
|
+
legend: label,
|
|
236
|
+
data: (_firstData_values = firstData.values) === null || _firstData_values === void 0 ? void 0 : _firstData_values[index],
|
|
237
|
+
color
|
|
238
|
+
};
|
|
239
|
+
});
|
|
240
|
+
var _input_layout_width;
|
|
241
|
+
const width = (_input_layout_width = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width) !== null && _input_layout_width !== void 0 ? _input_layout_width : 440;
|
|
242
|
+
var _input_layout_height;
|
|
243
|
+
const height = (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 220;
|
|
244
|
+
const hideLabels = firstData.textinfo ? ![
|
|
245
|
+
'value',
|
|
246
|
+
'percent',
|
|
247
|
+
'label+percent'
|
|
248
|
+
].includes(firstData.textinfo) : false;
|
|
249
|
+
const donutMarginHorizontal = hideLabels ? 0 : 80;
|
|
250
|
+
const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
|
|
251
|
+
const innerRadius = firstData.hole ? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2) : 0;
|
|
252
|
+
const { chartTitle } = getTitles(input.layout);
|
|
253
|
+
return {
|
|
254
|
+
data: {
|
|
255
|
+
chartTitle,
|
|
256
|
+
chartData: donutData
|
|
257
|
+
},
|
|
258
|
+
hideLegend: ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.showlegend) === false ? true : false,
|
|
259
|
+
width,
|
|
260
|
+
height,
|
|
261
|
+
innerRadius,
|
|
262
|
+
hideLabels,
|
|
263
|
+
showLabelsInPercent: firstData.textinfo ? [
|
|
264
|
+
'percent',
|
|
265
|
+
'label+percent'
|
|
266
|
+
].includes(firstData.textinfo) : true
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
const transformPlotlyJsonToVBCProps = (input, colorMap, isDarkTheme)=>{
|
|
270
|
+
const vbcData = [];
|
|
271
|
+
input.data.forEach((series, index)=>{
|
|
272
|
+
var _series_xbins, _series_xbins1, _series_xbins2;
|
|
273
|
+
invalidate2Dseries(series, 'VBC');
|
|
274
|
+
if (!series.x) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const scale = (0, _d3scale.scaleLinear)().domain((0, _d3array.extent)(series.x)).nice();
|
|
278
|
+
let [xMin, xMax] = scale.domain();
|
|
279
|
+
xMin = typeof ((_series_xbins = series.xbins) === null || _series_xbins === void 0 ? void 0 : _series_xbins.start) === 'number' ? series.xbins.start : xMin;
|
|
280
|
+
xMax = typeof ((_series_xbins1 = series.xbins) === null || _series_xbins1 === void 0 ? void 0 : _series_xbins1.end) === 'number' ? series.xbins.end : xMax;
|
|
281
|
+
const bin = (0, _d3array.bin)().domain([
|
|
282
|
+
xMin,
|
|
283
|
+
xMax
|
|
284
|
+
]);
|
|
285
|
+
if (typeof ((_series_xbins2 = series.xbins) === null || _series_xbins2 === void 0 ? void 0 : _series_xbins2.size) === 'number') {
|
|
286
|
+
const thresholds = [];
|
|
287
|
+
let th = xMin;
|
|
288
|
+
const precision = (0, _d3format.precisionFixed)(series.xbins.size);
|
|
289
|
+
const format = (0, _d3format.format)(`.${precision}f`);
|
|
290
|
+
while(th < xMax + series.xbins.size){
|
|
291
|
+
thresholds.push(parseFloat(format(th)));
|
|
292
|
+
th += series.xbins.size;
|
|
293
|
+
}
|
|
294
|
+
xMin = thresholds[0];
|
|
295
|
+
xMax = thresholds[thresholds.length - 1];
|
|
296
|
+
bin.domain([
|
|
297
|
+
xMin,
|
|
298
|
+
xMax
|
|
299
|
+
]).thresholds(thresholds);
|
|
300
|
+
}
|
|
301
|
+
const buckets = bin(series.x);
|
|
302
|
+
// If the start or end of xbins is specified, then the number of datapoints may become less than x.length
|
|
303
|
+
const totalDataPoints = (0, _d3array.merge)(buckets).length;
|
|
304
|
+
buckets.forEach((bucket)=>{
|
|
305
|
+
const legend = getLegend(series, index);
|
|
306
|
+
const color = getColor(legend, colorMap, isDarkTheme);
|
|
307
|
+
let y = bucket.length;
|
|
308
|
+
if (series.histnorm === 'percent') {
|
|
309
|
+
y = bucket.length / totalDataPoints * 100;
|
|
310
|
+
} else if (series.histnorm === 'probability') {
|
|
311
|
+
y = bucket.length / totalDataPoints;
|
|
312
|
+
} else if (series.histnorm === 'density') {
|
|
313
|
+
y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (bucket.x1 - bucket.x0);
|
|
314
|
+
} else if (series.histnorm === 'probability density') {
|
|
315
|
+
y = bucket.x0 === bucket.x1 ? 0 : bucket.length / (totalDataPoints * (bucket.x1 - bucket.x0));
|
|
316
|
+
} else if (series.histfunc === 'sum') {
|
|
317
|
+
y = (0, _d3array.sum)(bucket);
|
|
318
|
+
} else if (series.histfunc === 'avg') {
|
|
319
|
+
y = bucket.length === 0 ? 0 : (0, _d3array.sum)(bucket) / bucket.length;
|
|
320
|
+
} else if (series.histfunc === 'min') {
|
|
321
|
+
y = (0, _d3array.min)(bucket);
|
|
322
|
+
} else if (series.histfunc === 'max') {
|
|
323
|
+
y = (0, _d3array.max)(bucket);
|
|
324
|
+
}
|
|
325
|
+
vbcData.push({
|
|
326
|
+
x: (bucket.x1 + bucket.x0) / 2,
|
|
327
|
+
y,
|
|
328
|
+
legend,
|
|
329
|
+
color,
|
|
330
|
+
xAxisCalloutData: `[${bucket.x0} - ${bucket.x1})`
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
335
|
+
return {
|
|
336
|
+
data: vbcData,
|
|
337
|
+
// width: layout?.width,
|
|
338
|
+
// height: layout?.height,
|
|
339
|
+
chartTitle,
|
|
340
|
+
xAxisTitle,
|
|
341
|
+
yAxisTitle,
|
|
342
|
+
hideTickOverlap: true
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
const transformPlotlyJsonToScatterChartProps = (input, isAreaChart, colorMap, isDarkTheme)=>{
|
|
346
|
+
let secondaryYAxisValues = {};
|
|
347
|
+
const chartData = input.data.map((series, index)=>{
|
|
348
|
+
var _series_line;
|
|
349
|
+
invalidate2Dseries(series, 'Scatter');
|
|
350
|
+
const xValues = series.x;
|
|
351
|
+
const isString = typeof xValues[0] === 'string';
|
|
352
|
+
const isXDate = isDateArray(xValues);
|
|
353
|
+
const isXNumber = isNumberArray(xValues);
|
|
354
|
+
const legend = getLegend(series, index);
|
|
355
|
+
const lineColor = getColor(legend, colorMap, isDarkTheme);
|
|
356
|
+
secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);
|
|
357
|
+
return {
|
|
358
|
+
legend,
|
|
359
|
+
...((_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.dash) && dashOptions[series.line.dash] ? {
|
|
360
|
+
lineOptions: {
|
|
361
|
+
...dashOptions[series.line.dash]
|
|
362
|
+
}
|
|
363
|
+
} : {},
|
|
364
|
+
data: xValues.map((x, i)=>({
|
|
365
|
+
x: isString ? isXDate ? new Date(x) : isXNumber ? parseFloat(x) : x : x,
|
|
366
|
+
y: series.y[i]
|
|
367
|
+
})),
|
|
368
|
+
color: lineColor
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
const yMinMaxValues = (0, _utilities.findNumericMinMaxOfY)(chartData);
|
|
372
|
+
const { chartTitle, xAxisTitle, yAxisTitle } = getTitles(input.layout);
|
|
373
|
+
const chartProps = {
|
|
374
|
+
chartTitle,
|
|
375
|
+
lineChartData: chartData
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
data: chartProps,
|
|
379
|
+
supportNegativeData: true,
|
|
380
|
+
xAxisTitle,
|
|
381
|
+
yAxisTitle,
|
|
382
|
+
secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,
|
|
383
|
+
secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,
|
|
384
|
+
roundedTicks: true,
|
|
385
|
+
yMinValue: yMinMaxValues.startValue,
|
|
386
|
+
yMaxValue: yMinMaxValues.endValue,
|
|
387
|
+
hideTickOverlap: true
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
const MAX_DEPTH = 15;
|
|
391
|
+
const sanitizeJson = (jsonObject, depth = 0)=>{
|
|
392
|
+
if (depth > MAX_DEPTH) {
|
|
393
|
+
throw new Error('Maximum json depth exceeded');
|
|
394
|
+
}
|
|
395
|
+
if (typeof jsonObject === 'object' && jsonObject !== null) {
|
|
396
|
+
for(const key in jsonObject){
|
|
397
|
+
if (jsonObject.hasOwnProperty(key)) {
|
|
398
|
+
if (typeof jsonObject[key] === 'string') {
|
|
399
|
+
jsonObject[key] = jsonObject[key].replace(/</g, '<').replace(/>/g, '>');
|
|
400
|
+
} else {
|
|
401
|
+
jsonObject[key] = sanitizeJson(jsonObject[key], depth + 1);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return jsonObject;
|
|
407
|
+
};
|
|
408
|
+
function isTypedArray(a) {
|
|
409
|
+
return ArrayBuffer.isView(a) && !(a instanceof DataView);
|
|
410
|
+
}
|
|
411
|
+
function isArrayOrTypedArray(a) {
|
|
412
|
+
return Array.isArray(a) || isTypedArray(a);
|
|
413
|
+
}
|
|
414
|
+
function isPlainObject(obj) {
|
|
415
|
+
return Object.prototype.toString.call(obj) === '[object Object]' && Object.getPrototypeOf(obj).hasOwnProperty('hasOwnProperty');
|
|
416
|
+
}
|
|
417
|
+
var arrayAttributes = [];
|
|
418
|
+
var stack = [];
|
|
419
|
+
var isArrayStack = [];
|
|
420
|
+
var baseContainer, baseAttrName;
|
|
421
|
+
function findArrayAttributes(trace) {
|
|
422
|
+
// Init basecontainer and baseAttrName
|
|
423
|
+
crawlIntoTrace(baseContainer, 0, '');
|
|
424
|
+
}
|
|
425
|
+
function crawlIntoTrace(container, i, astrPartial) {
|
|
426
|
+
var item = container[stack[i]];
|
|
427
|
+
var newAstrPartial = astrPartial + stack[i];
|
|
428
|
+
if (i === stack.length - 1) {
|
|
429
|
+
if (isArrayOrTypedArray(item)) {
|
|
430
|
+
arrayAttributes.push(baseAttrName + newAstrPartial);
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
if (isArrayStack[i]) {
|
|
434
|
+
if (Array.isArray(item)) {
|
|
435
|
+
for(var j = 0; j < item.length; j++){
|
|
436
|
+
if (isPlainObject(item[j])) {
|
|
437
|
+
crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
} else if (isPlainObject(item)) {
|
|
442
|
+
crawlIntoTrace(item, i + 1, newAstrPartial + '.');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|