@fluentui/react-charts 9.3.27 → 9.3.29
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 +32 -2
- package/dist/index.d.cts +51 -0
- package/dist/index.d.ts +51 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -4
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +35 -5
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/AreaChart/index.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/index.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +19 -29
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +17 -15
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +3 -2
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -9
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -4
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +92 -110
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/index.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/index.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +5 -5
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/FunnelChart/index.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +4 -3
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GanttChart/index.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +34 -13
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/index.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +45 -46
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/index.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +5 -6
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -4
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/Legends.js +16 -20
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js +13 -10
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +40 -36
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +3 -4
- package/lib/components/PolarChart/PolarChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.utils.js +3 -3
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -1
- package/lib/components/PolarChart/index.js.map +1 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/index.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/index.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +3 -3
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/index.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.js +1 -3
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib/components/Sparkline/index.js.map +1 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +2 -2
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +88 -88
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +6 -5
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/types/ChartAnnotation.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/EventAnnotation.js.map +1 -1
- package/lib/types/LegendDataItem.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/ChartTitle.js +3 -4
- package/lib/utilities/ChartTitle.js.map +1 -1
- package/lib/utilities/Common.styles.js +1 -4
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +1 -4
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/async-utils.js.map +1 -1
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js.map +1 -1
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +3 -4
- package/lib/utilities/scatterpolar-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data/specialChartNames.js +11 -0
- package/lib/utilities/test-data/specialChartNames.js.map +1 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +9 -9
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs +1 -4
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.cjs +35 -5
- package/lib-commonjs/components/AreaChart/AreaChart.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/index.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs +19 -29
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs +17 -15
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs +3 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs +9 -9
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs +13 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs +122 -140
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs +5 -5
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs +6 -6
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/index.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.cjs +4 -3
- package/lib-commonjs/components/GanttChart/GanttChart.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs +41 -20
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs +44 -44
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs +5 -6
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs +4 -4
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.cjs +16 -19
- package/lib-commonjs/components/Legends/Legends.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.cjs.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.cjs +12 -9
- package/lib-commonjs/components/Legends/OverflowMenu.cjs.map +1 -1
- package/lib-commonjs/components/Legends/index.cjs.map +1 -1
- package/lib-commonjs/components/Legends/shape.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.cjs +40 -36
- package/lib-commonjs/components/LineChart/LineChart.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/index.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.cjs +3 -4
- package/lib-commonjs/components/PolarChart/PolarChart.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs +10 -10
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs +5 -5
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.cjs +1 -3
- package/lib-commonjs/components/Sparkline/Sparkline.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/index.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs +3 -3
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs +7 -7
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs +105 -105
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs +2 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs +6 -5
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/DataPoint.cjs.map +1 -1
- package/lib-commonjs/types/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/LegendDataItem.cjs.map +1 -1
- package/lib-commonjs/types/index.cjs.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.cjs +3 -4
- package/lib-commonjs/utilities/ChartTitle.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.raw.cjs.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.cjs.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/async-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/colors.cjs +7 -7
- package/lib-commonjs/utilities/colors.cjs.map +1 -1
- package/lib-commonjs/utilities/getWindow.cjs.map +1 -1
- package/lib-commonjs/utilities/hooks.cjs.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.cjs +3 -3
- package/lib-commonjs/utilities/image-export-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/index.cjs.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.cjs +4 -4
- package/lib-commonjs/utilities/overflow-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.cjs +6 -7
- package/lib-commonjs/utilities/scatterpolar-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/string.cjs +1 -1
- package/lib-commonjs/utilities/string.cjs.map +1 -1
- package/lib-commonjs/utilities/test-data/specialChartNames.cjs +21 -0
- package/lib-commonjs/utilities/test-data/specialChartNames.cjs.map +1 -0
- package/lib-commonjs/utilities/test-data.cjs +18 -18
- package/lib-commonjs/utilities/test-data.cjs.map +1 -1
- package/lib-commonjs/utilities/utilities.cjs +92 -92
- package/lib-commonjs/utilities/utilities.cjs.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.cjs +7 -7
- package/lib-commonjs/utilities/vbc-utils.cjs.map +1 -1
- package/package.json +9 -9
|
@@ -89,6 +89,9 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
89
89
|
}
|
|
90
90
|
return [];
|
|
91
91
|
}
|
|
92
|
+
function getOwnDataValue(row, field) {
|
|
93
|
+
return Object.prototype.hasOwnProperty.call(row, field) ? row[field] : undefined;
|
|
94
|
+
}
|
|
92
95
|
/**
|
|
93
96
|
* Applies a fold transform to convert wide-format data to long-format
|
|
94
97
|
* The fold transform unpivots specified fields into key-value pairs
|
|
@@ -105,7 +108,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
105
108
|
const result = [];
|
|
106
109
|
for (const row of data){
|
|
107
110
|
// Create a base row without the fields being folded
|
|
108
|
-
const baseRow =
|
|
111
|
+
const baseRow = Object.create(null);
|
|
109
112
|
for (const [key, value] of Object.entries(row)){
|
|
110
113
|
if (!foldFields.includes(key)) {
|
|
111
114
|
baseRow[key] = value;
|
|
@@ -113,7 +116,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
113
116
|
}
|
|
114
117
|
// Create a new row for each folded field
|
|
115
118
|
for (const field of foldFields){
|
|
116
|
-
if (field
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(row, field)) {
|
|
117
120
|
result.push({
|
|
118
121
|
...baseRow,
|
|
119
122
|
[keyField]: field,
|
|
@@ -181,19 +184,20 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
181
184
|
const groupby = transform.groupby || [];
|
|
182
185
|
const groups = new Map();
|
|
183
186
|
result.forEach((row)=>{
|
|
184
|
-
const key = groupby.map((g)=>String(row
|
|
187
|
+
const key = groupby.map((g)=>String(getOwnDataValue(row, g))).join('|');
|
|
185
188
|
if (!groups.has(key)) {
|
|
186
189
|
groups.set(key, []);
|
|
187
190
|
}
|
|
188
191
|
groups.get(key).push(row);
|
|
189
192
|
});
|
|
190
193
|
result = Array.from(groups.entries()).map(([key, rows])=>{
|
|
194
|
+
// Grouping fields and aggregate aliases are data keys, including "__proto__".
|
|
191
195
|
const baseRow = Object.create(null);
|
|
192
196
|
groupby.forEach((g, i)=>{
|
|
193
|
-
baseRow[g] = rows[0]
|
|
197
|
+
baseRow[g] = getOwnDataValue(rows[0], g);
|
|
194
198
|
});
|
|
195
199
|
aggSpecs.forEach((spec)=>{
|
|
196
|
-
const values = spec.field ? rows.map((r)=>Number(r
|
|
200
|
+
const values = spec.field ? rows.map((r)=>Number(getOwnDataValue(r, spec.field))).filter((v)=>!isNaN(v)) : [];
|
|
197
201
|
switch(spec.op){
|
|
198
202
|
case 'count':
|
|
199
203
|
baseRow[spec.as] = rows.length;
|
|
@@ -218,7 +222,10 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
218
222
|
baseRow[spec.as] = rows.length;
|
|
219
223
|
}
|
|
220
224
|
});
|
|
221
|
-
|
|
225
|
+
// Preserve ordinary row coercion without invoking setters for data keys.
|
|
226
|
+
return {
|
|
227
|
+
...baseRow
|
|
228
|
+
};
|
|
222
229
|
});
|
|
223
230
|
}
|
|
224
231
|
// Handle window transform
|
|
@@ -229,7 +236,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
229
236
|
// Group data
|
|
230
237
|
const groups = new Map();
|
|
231
238
|
result.forEach((row)=>{
|
|
232
|
-
const key = groupby.length > 0 ? groupby.map((g)=>String(row
|
|
239
|
+
const key = groupby.length > 0 ? groupby.map((g)=>String(getOwnDataValue(row, g))).join('|') : '__all__';
|
|
233
240
|
if (!groups.has(key)) {
|
|
234
241
|
groups.set(key, []);
|
|
235
242
|
}
|
|
@@ -241,8 +248,8 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
241
248
|
if (sortFields.length > 0) {
|
|
242
249
|
rows.sort((a, b)=>{
|
|
243
250
|
for (const sf of sortFields){
|
|
244
|
-
const va = Number(a
|
|
245
|
-
const vb = Number(b
|
|
251
|
+
const va = Number(getOwnDataValue(a, sf.field)) || 0;
|
|
252
|
+
const vb = Number(getOwnDataValue(b, sf.field)) || 0;
|
|
246
253
|
const cmp = sf.order === 'descending' ? vb - va : va - vb;
|
|
247
254
|
if (cmp !== 0) {
|
|
248
255
|
return cmp;
|
|
@@ -253,13 +260,11 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
253
260
|
}
|
|
254
261
|
let runningSum = 0;
|
|
255
262
|
rows.forEach((row, idx)=>{
|
|
256
|
-
const newRow =
|
|
257
|
-
...row
|
|
258
|
-
};
|
|
263
|
+
const newRow = Object.assign(Object.create(null), row);
|
|
259
264
|
windowOps.forEach((op)=>{
|
|
260
265
|
switch(op.op){
|
|
261
266
|
case 'sum':
|
|
262
|
-
runningSum += Number(row
|
|
267
|
+
runningSum += Number(getOwnDataValue(row, op.field)) || 0;
|
|
263
268
|
newRow[op.as] = runningSum;
|
|
264
269
|
break;
|
|
265
270
|
case 'rank':
|
|
@@ -275,7 +280,9 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
275
280
|
newRow[op.as] = idx + 1;
|
|
276
281
|
}
|
|
277
282
|
});
|
|
278
|
-
newResult.push(
|
|
283
|
+
newResult.push({
|
|
284
|
+
...newRow
|
|
285
|
+
});
|
|
279
286
|
});
|
|
280
287
|
});
|
|
281
288
|
result = newResult;
|
|
@@ -287,7 +294,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
287
294
|
// Compute aggregates
|
|
288
295
|
const groups = new Map();
|
|
289
296
|
result.forEach((row)=>{
|
|
290
|
-
const key = groupby.length > 0 ? groupby.map((g)=>String(row
|
|
297
|
+
const key = groupby.length > 0 ? groupby.map((g)=>String(getOwnDataValue(row, g))).join('|') : '__all__';
|
|
291
298
|
if (!groups.has(key)) {
|
|
292
299
|
groups.set(key, []);
|
|
293
300
|
}
|
|
@@ -295,9 +302,9 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
295
302
|
});
|
|
296
303
|
const aggResults = new Map();
|
|
297
304
|
groups.forEach((rows, key)=>{
|
|
298
|
-
const aggs =
|
|
305
|
+
const aggs = Object.create(null);
|
|
299
306
|
aggSpecs.forEach((spec)=>{
|
|
300
|
-
const values = spec.field ? rows.map((r)=>Number(r
|
|
307
|
+
const values = spec.field ? rows.map((r)=>Number(getOwnDataValue(r, spec.field))).filter((v)=>!isNaN(v)) : [];
|
|
301
308
|
switch(spec.op){
|
|
302
309
|
case 'mean':
|
|
303
310
|
case 'average':
|
|
@@ -326,7 +333,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
326
333
|
});
|
|
327
334
|
// Join back: add aggregate values to each row
|
|
328
335
|
result = result.map((row)=>{
|
|
329
|
-
const key = groupby.length > 0 ? groupby.map((g)=>String(row
|
|
336
|
+
const key = groupby.length > 0 ? groupby.map((g)=>String(getOwnDataValue(row, g))).join('|') : '__all__';
|
|
330
337
|
return {
|
|
331
338
|
...row,
|
|
332
339
|
...aggResults.get(key) || {}
|
|
@@ -338,10 +345,11 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
338
345
|
const yField = transform.regression;
|
|
339
346
|
const xField = transform.on;
|
|
340
347
|
const points = result.map((r)=>({
|
|
341
|
-
x: Number(r
|
|
342
|
-
y: Number(r
|
|
348
|
+
x: Number(getOwnDataValue(r, xField)),
|
|
349
|
+
y: Number(getOwnDataValue(r, yField))
|
|
343
350
|
})).filter((p)=>!isNaN(p.x) && !isNaN(p.y));
|
|
344
351
|
if (points.length >= 2) {
|
|
352
|
+
var _d3Min, _d3Max;
|
|
345
353
|
const n = points.length;
|
|
346
354
|
const sumX = d3Sum(points.map((p)=>p.x));
|
|
347
355
|
const sumY = d3Sum(points.map((p)=>p.y));
|
|
@@ -349,9 +357,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
349
357
|
const sumX2 = d3Sum(points.map((p)=>p.x * p.x));
|
|
350
358
|
const slope = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX);
|
|
351
359
|
const intercept = (sumY - slope * sumX) / n;
|
|
352
|
-
var _d3Min;
|
|
353
360
|
const xMin = (_d3Min = d3Min(points.map((p)=>p.x))) !== null && _d3Min !== void 0 ? _d3Min : 0;
|
|
354
|
-
var _d3Max;
|
|
355
361
|
const xMax = (_d3Max = d3Max(points.map((p)=>p.x))) !== null && _d3Max !== void 0 ? _d3Max : 0;
|
|
356
362
|
result = [
|
|
357
363
|
{
|
|
@@ -371,16 +377,16 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
371
377
|
const xField = transform.on;
|
|
372
378
|
const sorted = [
|
|
373
379
|
...result
|
|
374
|
-
].filter((r)=>!isNaN(Number(r
|
|
380
|
+
].filter((r)=>!isNaN(Number(getOwnDataValue(r, xField))) && !isNaN(Number(getOwnDataValue(r, yField)))).sort((a, b)=>Number(getOwnDataValue(a, xField)) - Number(getOwnDataValue(b, xField)));
|
|
375
381
|
const windowSize = Math.max(3, Math.floor(sorted.length / 4));
|
|
376
382
|
result = sorted.map((row, i)=>{
|
|
383
|
+
var _d3Mean;
|
|
377
384
|
const start = Math.max(0, i - Math.floor(windowSize / 2));
|
|
378
385
|
const end = Math.min(sorted.length, start + windowSize);
|
|
379
386
|
const windowSlice = sorted.slice(start, end);
|
|
380
|
-
|
|
381
|
-
const avgY = (_d3Mean = d3Mean(windowSlice.map((r)=>Number(r[yField])))) !== null && _d3Mean !== void 0 ? _d3Mean : Number(row[yField]);
|
|
387
|
+
const avgY = (_d3Mean = d3Mean(windowSlice.map((r)=>Number(getOwnDataValue(r, yField))))) !== null && _d3Mean !== void 0 ? _d3Mean : Number(getOwnDataValue(row, yField));
|
|
382
388
|
return {
|
|
383
|
-
[xField]: row
|
|
389
|
+
[xField]: getOwnDataValue(row, xField),
|
|
384
390
|
[yField]: avgY
|
|
385
391
|
};
|
|
386
392
|
});
|
|
@@ -391,26 +397,25 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
391
397
|
const groupby = transform.groupby || [];
|
|
392
398
|
const groups = new Map();
|
|
393
399
|
result.forEach((row)=>{
|
|
394
|
-
const key = groupby.length > 0 ? groupby.map((g)=>String(row
|
|
400
|
+
const key = groupby.length > 0 ? groupby.map((g)=>String(getOwnDataValue(row, g))).join('|') : '__all__';
|
|
395
401
|
if (!groups.has(key)) {
|
|
396
402
|
groups.set(key, []);
|
|
397
403
|
}
|
|
398
|
-
groups.get(key).push(Number(row
|
|
404
|
+
groups.get(key).push(Number(getOwnDataValue(row, field)));
|
|
399
405
|
});
|
|
400
406
|
const densityResult = [];
|
|
401
407
|
groups.forEach((values, key)=>{
|
|
402
|
-
var _d3Min;
|
|
408
|
+
var _d3Min, _d3Max;
|
|
403
409
|
const min = (_d3Min = d3Min(values)) !== null && _d3Min !== void 0 ? _d3Min : 0;
|
|
404
|
-
var _d3Max;
|
|
405
410
|
const max = (_d3Max = d3Max(values)) !== null && _d3Max !== void 0 ? _d3Max : 0;
|
|
406
411
|
const range = max - min || 1;
|
|
407
412
|
const bins = 20;
|
|
408
413
|
const bandwidth = range / bins;
|
|
409
|
-
const groupFields =
|
|
414
|
+
const groupFields = Object.create(null);
|
|
410
415
|
if (groupby.length > 0) {
|
|
411
|
-
const sampleRow = result.find((r)=>groupby.map((g)=>String(r
|
|
416
|
+
const sampleRow = result.find((r)=>groupby.map((g)=>String(getOwnDataValue(r, g))).join('|') === key);
|
|
412
417
|
groupby.forEach((g)=>{
|
|
413
|
-
groupFields[g] = sampleRow
|
|
418
|
+
groupFields[g] = sampleRow ? getOwnDataValue(sampleRow, g) : undefined;
|
|
414
419
|
});
|
|
415
420
|
}
|
|
416
421
|
for(let i = 0; i <= bins; i++){
|
|
@@ -434,7 +439,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
434
439
|
0.5,
|
|
435
440
|
0.75
|
|
436
441
|
];
|
|
437
|
-
const values = result.map((r)=>Number(r
|
|
442
|
+
const values = result.map((r)=>Number(getOwnDataValue(r, field))).filter((v)=>!isNaN(v)).sort((a, b)=>a - b);
|
|
438
443
|
if (values.length > 0) {
|
|
439
444
|
result = probs.map((p)=>{
|
|
440
445
|
const idx = Math.min(Math.floor(p * values.length), values.length - 1);
|
|
@@ -447,28 +452,27 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
447
452
|
}
|
|
448
453
|
// Handle impute transform (fill missing values)
|
|
449
454
|
if ('impute' in transform && 'key' in transform) {
|
|
455
|
+
var _transform_value;
|
|
450
456
|
const field = transform.impute;
|
|
451
457
|
const keyField = transform.key;
|
|
452
458
|
const method = transform.method || 'value';
|
|
453
|
-
var _transform_value;
|
|
454
459
|
const fillValue = (_transform_value = transform.value) !== null && _transform_value !== void 0 ? _transform_value : 0;
|
|
455
|
-
const existingKeys = new Set(result.map((r)=>r
|
|
456
|
-
const allKeyValues = result.map((r)=>Number(r
|
|
460
|
+
const existingKeys = new Set(result.map((r)=>getOwnDataValue(r, keyField)));
|
|
461
|
+
const allKeyValues = result.map((r)=>Number(getOwnDataValue(r, keyField))).filter((v)=>!isNaN(v));
|
|
457
462
|
if (allKeyValues.length > 0) {
|
|
458
|
-
var _d3Min1;
|
|
463
|
+
var _d3Min1, _d3Max1;
|
|
459
464
|
const minKey = (_d3Min1 = d3Min(allKeyValues)) !== null && _d3Min1 !== void 0 ? _d3Min1 : 0;
|
|
460
|
-
var _d3Max1;
|
|
461
465
|
const maxKey = (_d3Max1 = d3Max(allKeyValues)) !== null && _d3Max1 !== void 0 ? _d3Max1 : 0;
|
|
462
466
|
for(let k = minKey; k <= maxKey; k++){
|
|
463
467
|
if (!existingKeys.has(k)) {
|
|
464
468
|
const imputed = {
|
|
465
|
-
[keyField]: k
|
|
469
|
+
[keyField]: k,
|
|
470
|
+
[field]: method === 'value' ? fillValue : 0
|
|
466
471
|
};
|
|
467
|
-
imputed[field] = method === 'value' ? fillValue : 0;
|
|
468
472
|
result.push(imputed);
|
|
469
473
|
}
|
|
470
474
|
}
|
|
471
|
-
result.sort((a, b)=>Number(a
|
|
475
|
+
result.sort((a, b)=>Number(getOwnDataValue(a, keyField)) - Number(getOwnDataValue(b, keyField)));
|
|
472
476
|
}
|
|
473
477
|
}
|
|
474
478
|
// Handle lookup transform (join with secondary dataset)
|
|
@@ -479,14 +483,14 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
479
483
|
if (((_fromSpec_data = fromSpec.data) === null || _fromSpec_data === void 0 ? void 0 : _fromSpec_data.values) && fromSpec.key && fromSpec.fields) {
|
|
480
484
|
const lookupMap = new Map();
|
|
481
485
|
fromSpec.data.values.forEach((row)=>{
|
|
482
|
-
lookupMap.set(String(row
|
|
486
|
+
lookupMap.set(String(getOwnDataValue(row, fromSpec.key)), row);
|
|
483
487
|
});
|
|
484
488
|
result = result.map((row)=>{
|
|
485
|
-
const lookupRow = lookupMap.get(String(row
|
|
489
|
+
const lookupRow = lookupMap.get(String(getOwnDataValue(row, lookupField)));
|
|
486
490
|
if (lookupRow) {
|
|
487
|
-
const extra =
|
|
491
|
+
const extra = Object.create(null);
|
|
488
492
|
fromSpec.fields.forEach((f)=>{
|
|
489
|
-
extra[f] = lookupRow
|
|
493
|
+
extra[f] = getOwnDataValue(lookupRow, f);
|
|
490
494
|
});
|
|
491
495
|
return {
|
|
492
496
|
...row,
|
|
@@ -627,17 +631,17 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
627
631
|
const markStrokeDash = typeof layer.mark === 'object' ? layer.mark.strokeDash : undefined;
|
|
628
632
|
// Horizontal rule (y value constant)
|
|
629
633
|
if (encoding.y && (encoding.y.value !== undefined || encoding.y.datum !== undefined)) {
|
|
630
|
-
var _spec_layer, _companionText_encoding_text, _companionText_encoding, _companionText_encoding_text1, _companionText_encoding1;
|
|
631
634
|
var _encoding_y_value;
|
|
635
|
+
var _spec_layer, _companionText_encoding_text, _companionText_encoding, _companionText_encoding_text1, _companionText_encoding1;
|
|
632
636
|
const yValue = (_encoding_y_value = encoding.y.value) !== null && _encoding_y_value !== void 0 ? _encoding_y_value : encoding.y.datum;
|
|
633
637
|
// Look for a companion text annotation at the same y-value
|
|
634
638
|
const companionText = (_spec_layer = spec.layer) === null || _spec_layer === void 0 ? void 0 : _spec_layer.find((l, i)=>{
|
|
639
|
+
var _l_encoding_y_datum;
|
|
635
640
|
var _l_encoding;
|
|
636
641
|
if (i === index) {
|
|
637
642
|
return false;
|
|
638
643
|
}
|
|
639
644
|
const m = getMarkType(l.mark);
|
|
640
|
-
var _l_encoding_y_datum;
|
|
641
645
|
return m === 'text' && ((_l_encoding = l.encoding) === null || _l_encoding === void 0 ? void 0 : _l_encoding.y) && ((_l_encoding_y_datum = l.encoding.y.datum) !== null && _l_encoding_y_datum !== void 0 ? _l_encoding_y_datum : l.encoding.y.value) === yValue;
|
|
642
646
|
});
|
|
643
647
|
const ruleText = companionText ? String(((_companionText_encoding = companionText.encoding) === null || _companionText_encoding === void 0 ? void 0 : (_companionText_encoding_text = _companionText_encoding.text) === null || _companionText_encoding_text === void 0 ? void 0 : _companionText_encoding_text.datum) || ((_companionText_encoding1 = companionText.encoding) === null || _companionText_encoding1 === void 0 ? void 0 : (_companionText_encoding_text1 = _companionText_encoding1.text) === null || _companionText_encoding_text1 === void 0 ? void 0 : _companionText_encoding_text1.value) || yValue) : String(yValue);
|
|
@@ -891,9 +895,8 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
891
895
|
if (yField) {
|
|
892
896
|
const yValues = dataValues.map((row)=>Number(row[yField])).filter((v)=>!isNaN(v));
|
|
893
897
|
if (yValues.length > 0) {
|
|
894
|
-
var _d3Min;
|
|
898
|
+
var _d3Min, _d3Max;
|
|
895
899
|
const dataMin = (_d3Min = d3Min(yValues)) !== null && _d3Min !== void 0 ? _d3Min : 0;
|
|
896
|
-
var _d3Max;
|
|
897
900
|
const dataMax = (_d3Max = d3Max(yValues)) !== null && _d3Max !== void 0 ? _d3Max : 0;
|
|
898
901
|
const padding = (dataMax - dataMin) * 0.05;
|
|
899
902
|
return {
|
|
@@ -1027,7 +1030,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
1027
1030
|
const yAgg = ((_encoding_y1 = encoding.y) === null || _encoding_y1 === void 0 ? void 0 : _encoding_y1.aggregate) || (yField ? 'mean' : 'count');
|
|
1028
1031
|
const groups = new Map();
|
|
1029
1032
|
dataValues.forEach((row)=>{
|
|
1030
|
-
const dateVal = new Date(row
|
|
1033
|
+
const dateVal = new Date(getOwnDataValue(row, field));
|
|
1031
1034
|
if (isNaN(dateVal.getTime())) {
|
|
1032
1035
|
return;
|
|
1033
1036
|
}
|
|
@@ -1059,17 +1062,18 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
1059
1062
|
groups.get(key).push(row);
|
|
1060
1063
|
});
|
|
1061
1064
|
dataValues = Array.from(groups.entries()).map(([key, rows])=>{
|
|
1062
|
-
const result =
|
|
1063
|
-
|
|
1064
|
-
};
|
|
1065
|
+
const result = Object.create(null);
|
|
1066
|
+
result[field] = key;
|
|
1065
1067
|
if (yField && yAgg !== 'count') {
|
|
1066
|
-
const vals = rows.map((r)=>Number(r[yField])).filter((v)=>!isNaN(v));
|
|
1067
1068
|
var _d3Mean;
|
|
1069
|
+
const vals = rows.map((r)=>Number(getOwnDataValue(r, yField))).filter((v)=>!isNaN(v));
|
|
1068
1070
|
result[yField] = yAgg === 'sum' ? d3Sum(vals) : (_d3Mean = d3Mean(vals)) !== null && _d3Mean !== void 0 ? _d3Mean : 0;
|
|
1069
1071
|
} else {
|
|
1070
1072
|
result[yField || '__count'] = rows.length;
|
|
1071
1073
|
}
|
|
1072
|
-
return
|
|
1074
|
+
return {
|
|
1075
|
+
...result
|
|
1076
|
+
};
|
|
1073
1077
|
});
|
|
1074
1078
|
// Switch x from temporal to ordinal since we've aggregated
|
|
1075
1079
|
encoding.x.type = 'ordinal';
|
|
@@ -1320,13 +1324,13 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
1320
1324
|
*
|
|
1321
1325
|
* This mutates the spec encoding in place.
|
|
1322
1326
|
*/ export function autoCorrectEncodingTypes(spec) {
|
|
1327
|
+
var _unitSpec_data;
|
|
1323
1328
|
var _encoding_x, _encoding_y;
|
|
1324
1329
|
const unitSpec = spec.layer ? spec.layer[0] : spec;
|
|
1325
1330
|
if (!unitSpec) {
|
|
1326
1331
|
return;
|
|
1327
1332
|
}
|
|
1328
1333
|
const encoding = unitSpec.encoding;
|
|
1329
|
-
var _unitSpec_data;
|
|
1330
1334
|
const data = extractDataValues((_unitSpec_data = unitSpec.data) !== null && _unitSpec_data !== void 0 ? _unitSpec_data : spec.data);
|
|
1331
1335
|
if (!encoding || data.length === 0) {
|
|
1332
1336
|
return;
|
|
@@ -1524,6 +1528,7 @@ const DEFAULT_TRUNCATE_CHARS = 20;
|
|
|
1524
1528
|
};
|
|
1525
1529
|
}
|
|
1526
1530
|
export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
1531
|
+
var _ref, _ref1, _ref2;
|
|
1527
1532
|
var _encoding_x, _encoding_y, _encoding_x1, _encoding_y1, _encoding_x2, _encoding_y2, _spec_title, _encoding_x_axis, _encoding_x3, _encoding_y_axis, _encoding_y3, _encoding_x_axis1, _encoding_x4, _encoding_y_axis1, _encoding_y4, _encoding_x_axis2, _encoding_x5, _encoding_y_axis2, _encoding_y5, _encoding_color_legend, _encoding_color;
|
|
1528
1533
|
// Initialize transformation context, but find the primary line/point layer for layered specs
|
|
1529
1534
|
const unitSpecs = normalizeSpec(spec);
|
|
@@ -1605,11 +1610,9 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1605
1610
|
});
|
|
1606
1611
|
// Extract chart title
|
|
1607
1612
|
const chartTitle = typeof spec.title === 'string' ? spec.title : (_spec_title = spec.title) === null || _spec_title === void 0 ? void 0 : _spec_title.text;
|
|
1608
|
-
var _encoding_x_axis_title;
|
|
1609
1613
|
// Extract axis titles and formats
|
|
1610
|
-
const xAxisTitle = (
|
|
1611
|
-
|
|
1612
|
-
const yAxisTitle = (_encoding_y_axis_title = (_encoding_y3 = encoding.y) === null || _encoding_y3 === void 0 ? void 0 : (_encoding_y_axis = _encoding_y3.axis) === null || _encoding_y_axis === void 0 ? void 0 : _encoding_y_axis.title) !== null && _encoding_y_axis_title !== void 0 ? _encoding_y_axis_title : undefined;
|
|
1614
|
+
const xAxisTitle = (_ref = (_encoding_x3 = encoding.x) === null || _encoding_x3 === void 0 ? void 0 : (_encoding_x_axis = _encoding_x3.axis) === null || _encoding_x_axis === void 0 ? void 0 : _encoding_x_axis.title) !== null && _ref !== void 0 ? _ref : undefined;
|
|
1615
|
+
const yAxisTitle = (_ref1 = (_encoding_y3 = encoding.y) === null || _encoding_y3 === void 0 ? void 0 : (_encoding_y_axis = _encoding_y3.axis) === null || _encoding_y_axis === void 0 ? void 0 : _encoding_y_axis.title) !== null && _ref1 !== void 0 ? _ref1 : undefined;
|
|
1613
1616
|
const tickFormat = (_encoding_x4 = encoding.x) === null || _encoding_x4 === void 0 ? void 0 : (_encoding_x_axis1 = _encoding_x4.axis) === null || _encoding_x_axis1 === void 0 ? void 0 : _encoding_x_axis1.format;
|
|
1614
1617
|
const yAxisTickFormat = (_encoding_y4 = encoding.y) === null || _encoding_y4 === void 0 ? void 0 : (_encoding_y_axis1 = _encoding_y4.axis) === null || _encoding_y_axis1 === void 0 ? void 0 : _encoding_y_axis1.format;
|
|
1615
1618
|
// Extract tick values and counts
|
|
@@ -1628,14 +1631,14 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1628
1631
|
const xMin = allXValues.length > 0 ? allXValues.reduce((a, b)=>a < b ? a : b) : 0;
|
|
1629
1632
|
const xMax = allXValues.length > 0 ? allXValues.reduce((a, b)=>a > b ? a : b) : 0;
|
|
1630
1633
|
spec.layer.forEach((layer, layerIndex)=>{
|
|
1634
|
+
var _ref;
|
|
1631
1635
|
var _ruleEncoding_y, _ruleEncoding_y1, _textLayer_encoding_text, _textLayer_encoding, _textLayer_encoding_text1, _textLayer_encoding1;
|
|
1632
1636
|
const layerMark = getMarkType(layer.mark);
|
|
1633
1637
|
if (layerMark !== 'rule') {
|
|
1634
1638
|
return;
|
|
1635
1639
|
}
|
|
1636
1640
|
const ruleEncoding = layer.encoding || {};
|
|
1637
|
-
|
|
1638
|
-
const yDatum = (_ruleEncoding_y_datum = (_ruleEncoding_y = ruleEncoding.y) === null || _ruleEncoding_y === void 0 ? void 0 : _ruleEncoding_y.datum) !== null && _ruleEncoding_y_datum !== void 0 ? _ruleEncoding_y_datum : (_ruleEncoding_y1 = ruleEncoding.y) === null || _ruleEncoding_y1 === void 0 ? void 0 : _ruleEncoding_y1.value;
|
|
1641
|
+
const yDatum = (_ref = (_ruleEncoding_y = ruleEncoding.y) === null || _ruleEncoding_y === void 0 ? void 0 : _ruleEncoding_y.datum) !== null && _ref !== void 0 ? _ref : (_ruleEncoding_y1 = ruleEncoding.y) === null || _ruleEncoding_y1 === void 0 ? void 0 : _ruleEncoding_y1.value;
|
|
1639
1642
|
if (yDatum === undefined) {
|
|
1640
1643
|
return;
|
|
1641
1644
|
}
|
|
@@ -1643,9 +1646,9 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1643
1646
|
const ruleColor = ruleMarkProps.color || '#d62728';
|
|
1644
1647
|
// Find companion text annotation for legend name
|
|
1645
1648
|
const textLayer = spec.layer.find((l)=>{
|
|
1649
|
+
var _l_encoding_y_datum;
|
|
1646
1650
|
var _l_encoding;
|
|
1647
1651
|
const m = getMarkType(l.mark);
|
|
1648
|
-
var _l_encoding_y_datum;
|
|
1649
1652
|
return m === 'text' && ((_l_encoding = l.encoding) === null || _l_encoding === void 0 ? void 0 : _l_encoding.y) && ((_l_encoding_y_datum = l.encoding.y.datum) !== null && _l_encoding_y_datum !== void 0 ? _l_encoding_y_datum : l.encoding.y.value) === yDatum;
|
|
1650
1653
|
});
|
|
1651
1654
|
const ruleLegend = textLayer ? String(((_textLayer_encoding = textLayer.encoding) === null || _textLayer_encoding === void 0 ? void 0 : (_textLayer_encoding_text = _textLayer_encoding.text) === null || _textLayer_encoding_text === void 0 ? void 0 : _textLayer_encoding_text.datum) || ((_textLayer_encoding1 = textLayer.encoding) === null || _textLayer_encoding1 === void 0 ? void 0 : (_textLayer_encoding_text1 = _textLayer_encoding1.text) === null || _textLayer_encoding_text1 === void 0 ? void 0 : _textLayer_encoding_text1.value) || `y=${yDatum}`) : `y=${yDatum}`;
|
|
@@ -1687,7 +1690,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1687
1690
|
chartTitle
|
|
1688
1691
|
}
|
|
1689
1692
|
};
|
|
1690
|
-
var _encoding_color_legend_disable;
|
|
1691
1693
|
return {
|
|
1692
1694
|
data: chartProps,
|
|
1693
1695
|
width: typeof spec.width === 'number' ? spec.width : undefined,
|
|
@@ -1738,7 +1740,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1738
1740
|
yMaxValue: yOrdinalLabels.length - 0.5
|
|
1739
1741
|
},
|
|
1740
1742
|
...categoryOrderProps,
|
|
1741
|
-
hideLegend: (
|
|
1743
|
+
hideLegend: (_ref2 = (_encoding_color = encoding.color) === null || _encoding_color === void 0 ? void 0 : (_encoding_color_legend = _encoding_color.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref2 !== void 0 ? _ref2 : false
|
|
1742
1744
|
};
|
|
1743
1745
|
}
|
|
1744
1746
|
/**
|
|
@@ -1798,6 +1800,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1798
1800
|
/**
|
|
1799
1801
|
* Extracts chart titles and title styles from Vega-Lite specification
|
|
1800
1802
|
*/ export function getVegaLiteTitles(spec) {
|
|
1803
|
+
var _ref, _ref1, _ref2, _ref3;
|
|
1801
1804
|
var _spec_title, _encoding_x, _encoding_x_axis, _encoding_x1, _encoding_y, _encoding_y_axis, _encoding_y1;
|
|
1802
1805
|
const unitSpecs = normalizeSpec(spec);
|
|
1803
1806
|
if (unitSpecs.length === 0) {
|
|
@@ -1862,11 +1865,10 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1862
1865
|
titleStyles = undefined;
|
|
1863
1866
|
}
|
|
1864
1867
|
}
|
|
1865
|
-
var _encoding_x_title, _ref, _encoding_y_title, _ref1;
|
|
1866
1868
|
return {
|
|
1867
1869
|
chartTitle,
|
|
1868
|
-
xAxisTitle: (_ref = (
|
|
1869
|
-
yAxisTitle: (
|
|
1870
|
+
xAxisTitle: (_ref = (_ref1 = (_encoding_x = encoding.x) === null || _encoding_x === void 0 ? void 0 : _encoding_x.title) !== null && _ref1 !== void 0 ? _ref1 : (_encoding_x1 = encoding.x) === null || _encoding_x1 === void 0 ? void 0 : (_encoding_x_axis = _encoding_x1.axis) === null || _encoding_x_axis === void 0 ? void 0 : _encoding_x_axis.title) !== null && _ref !== void 0 ? _ref : undefined,
|
|
1871
|
+
yAxisTitle: (_ref2 = (_ref3 = (_encoding_y = encoding.y) === null || _encoding_y === void 0 ? void 0 : _encoding_y.title) !== null && _ref3 !== void 0 ? _ref3 : (_encoding_y1 = encoding.y) === null || _encoding_y1 === void 0 ? void 0 : (_encoding_y_axis = _encoding_y1.axis) === null || _encoding_y_axis === void 0 ? void 0 : _encoding_y_axis.title) !== null && _ref2 !== void 0 ? _ref2 : undefined,
|
|
1870
1872
|
...titleStyles ? {
|
|
1871
1873
|
titleStyles
|
|
1872
1874
|
} : {}
|
|
@@ -1882,6 +1884,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1882
1884
|
* @param isDarkTheme - Whether dark theme is active
|
|
1883
1885
|
* @returns VerticalBarChartProps for rendering
|
|
1884
1886
|
*/ export function transformVegaLiteToVerticalBarChartProps(spec, colorMap, isDarkTheme) {
|
|
1887
|
+
var _ref;
|
|
1885
1888
|
var _encoding_color, _encoding_y_axis, _encoding_y, _barData_, _encoding_color_legend, _encoding_color1;
|
|
1886
1889
|
// Initialize transformation context
|
|
1887
1890
|
const { dataValues, encoding, markProps } = initializeTransformContext(spec);
|
|
@@ -1997,7 +2000,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
1997
2000
|
// Compute truncation based on number of unique x-axis categories
|
|
1998
2001
|
const uniqueXCount = new Set(barData.map((d)=>String(d.x))).size;
|
|
1999
2002
|
const barTruncateChars = uniqueXCount > 20 ? 6 : uniqueXCount > 10 ? 10 : DEFAULT_TRUNCATE_CHARS;
|
|
2000
|
-
var _encoding_color_legend_disable;
|
|
2001
2003
|
const result = {
|
|
2002
2004
|
data: barData,
|
|
2003
2005
|
chartTitle: titles.chartTitle,
|
|
@@ -2025,7 +2027,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2025
2027
|
},
|
|
2026
2028
|
...categoryOrderProps,
|
|
2027
2029
|
// Hide legend for single-series bar charts (no color encoding) to avoid showing "Bar" legend
|
|
2028
|
-
hideLegend: !colorField ? true : (
|
|
2030
|
+
hideLegend: !colorField ? true : (_ref = (_encoding_color1 = encoding.color) === null || _encoding_color1 === void 0 ? void 0 : (_encoding_color_legend = _encoding_color1.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref !== void 0 ? _ref : false
|
|
2029
2031
|
};
|
|
2030
2032
|
if (tickConfig.tickValues) {
|
|
2031
2033
|
result.tickValues = tickConfig.tickValues;
|
|
@@ -2045,6 +2047,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2045
2047
|
* @param isDarkTheme - Whether dark theme is active
|
|
2046
2048
|
* @returns VerticalStackedBarChartProps for rendering
|
|
2047
2049
|
*/ export function transformVegaLiteToVerticalStackedBarChartProps(spec, colorMap, isDarkTheme) {
|
|
2050
|
+
var _spec_height, _ref;
|
|
2048
2051
|
var _encoding_color, _encoding_y_axis, _encoding_y, _encoding_color_legend, _encoding_color1, _chartData_;
|
|
2049
2052
|
// Initialize transformation context (skip warnings as we handle layered spec differently)
|
|
2050
2053
|
const { unitSpecs } = initializeTransformContext(spec);
|
|
@@ -2246,11 +2249,11 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2246
2249
|
// Process rule specs as horizontal reference lines
|
|
2247
2250
|
// Each rule with a constant y-value becomes a flat line across all x-axis points
|
|
2248
2251
|
ruleSpecs.forEach((ruleSpec, ruleIndex)=>{
|
|
2252
|
+
var _ref;
|
|
2249
2253
|
var _ruleEncoding_y, _ruleEncoding_y1;
|
|
2250
2254
|
const ruleEncoding = ruleSpec.encoding || {};
|
|
2251
2255
|
const ruleMarkProps = getMarkProperties(ruleSpec.mark);
|
|
2252
|
-
|
|
2253
|
-
const yDatum = (_ruleEncoding_y_datum = (_ruleEncoding_y = ruleEncoding.y) === null || _ruleEncoding_y === void 0 ? void 0 : _ruleEncoding_y.datum) !== null && _ruleEncoding_y_datum !== void 0 ? _ruleEncoding_y_datum : (_ruleEncoding_y1 = ruleEncoding.y) === null || _ruleEncoding_y1 === void 0 ? void 0 : _ruleEncoding_y1.value;
|
|
2256
|
+
const yDatum = (_ref = (_ruleEncoding_y = ruleEncoding.y) === null || _ruleEncoding_y === void 0 ? void 0 : _ruleEncoding_y.datum) !== null && _ref !== void 0 ? _ref : (_ruleEncoding_y1 = ruleEncoding.y) === null || _ruleEncoding_y1 === void 0 ? void 0 : _ruleEncoding_y1.value;
|
|
2254
2257
|
if (yDatum !== undefined) {
|
|
2255
2258
|
var _textSpec_encoding_text, _textSpec_encoding, _textSpec_encoding_text1, _textSpec_encoding1;
|
|
2256
2259
|
const ruleLegend = `Reference_${ruleIndex}`;
|
|
@@ -2267,8 +2270,8 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2267
2270
|
}
|
|
2268
2271
|
// Look for companion text annotation at the same y-value
|
|
2269
2272
|
const textSpec = unitSpecs.find((s, i)=>{
|
|
2270
|
-
var _s_encoding;
|
|
2271
2273
|
var _s_encoding_y_datum;
|
|
2274
|
+
var _s_encoding;
|
|
2272
2275
|
return getMarkType(s.mark) === 'text' && ((_s_encoding = s.encoding) === null || _s_encoding === void 0 ? void 0 : _s_encoding.y) && ((_s_encoding_y_datum = s.encoding.y.datum) !== null && _s_encoding_y_datum !== void 0 ? _s_encoding_y_datum : s.encoding.y.value) === yDatum;
|
|
2273
2276
|
});
|
|
2274
2277
|
const ruleText = textSpec ? String(((_textSpec_encoding = textSpec.encoding) === null || _textSpec_encoding === void 0 ? void 0 : (_textSpec_encoding_text = _textSpec_encoding.text) === null || _textSpec_encoding_text === void 0 ? void 0 : _textSpec_encoding_text.datum) || ((_textSpec_encoding1 = textSpec.encoding) === null || _textSpec_encoding1 === void 0 ? void 0 : (_textSpec_encoding_text1 = _textSpec_encoding1.text) === null || _textSpec_encoding_text1 === void 0 ? void 0 : _textSpec_encoding_text1.value) || yDatum) : String(yDatum);
|
|
@@ -2314,12 +2317,11 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2314
2317
|
});
|
|
2315
2318
|
});
|
|
2316
2319
|
if (allLineYValues.length > 0) {
|
|
2320
|
+
var _d3Min, _d3Max;
|
|
2317
2321
|
var _lineEncoding_y_scale, _lineEncoding_y1;
|
|
2318
2322
|
// Use explicit domain from line encoding if available, otherwise compute from data
|
|
2319
2323
|
const lineDomain = (_lineEncoding_y1 = lineEncoding.y) === null || _lineEncoding_y1 === void 0 ? void 0 : (_lineEncoding_y_scale = _lineEncoding_y1.scale) === null || _lineEncoding_y_scale === void 0 ? void 0 : _lineEncoding_y_scale.domain;
|
|
2320
|
-
var _d3Min;
|
|
2321
2324
|
const secYMin = Array.isArray(lineDomain) ? lineDomain[0] : (_d3Min = d3Min(allLineYValues)) !== null && _d3Min !== void 0 ? _d3Min : 0;
|
|
2322
|
-
var _d3Max;
|
|
2323
2325
|
const secYMax = Array.isArray(lineDomain) ? lineDomain[1] : (_d3Max = d3Max(allLineYValues)) !== null && _d3Max !== void 0 ? _d3Max : 0;
|
|
2324
2326
|
secondaryYAxisProps.secondaryYScaleOptions = {
|
|
2325
2327
|
yMinValue: secYMin,
|
|
@@ -2334,7 +2336,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2334
2336
|
const { yMinValue, yMaxValue } = extractYMinMax(encoding, dataValues);
|
|
2335
2337
|
// Extract axis category ordering
|
|
2336
2338
|
const categoryOrderProps = extractAxisCategoryOrderProps(encoding);
|
|
2337
|
-
var _spec_height, _encoding_color_legend_disable;
|
|
2338
2339
|
return {
|
|
2339
2340
|
data: chartData,
|
|
2340
2341
|
chartTitle: titles.chartTitle,
|
|
@@ -2343,7 +2344,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2343
2344
|
...titles.titleStyles ? titles.titleStyles : {},
|
|
2344
2345
|
width: spec.width,
|
|
2345
2346
|
height: (_spec_height = spec.height) !== null && _spec_height !== void 0 ? _spec_height : DEFAULT_CHART_HEIGHT,
|
|
2346
|
-
hideLegend: (
|
|
2347
|
+
hideLegend: (_ref = (_encoding_color1 = encoding.color) === null || _encoding_color1 === void 0 ? void 0 : (_encoding_color_legend = _encoding_color1.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref !== void 0 ? _ref : false,
|
|
2347
2348
|
showYAxisLables: true,
|
|
2348
2349
|
roundCorners: true,
|
|
2349
2350
|
hideTickOverlap: true,
|
|
@@ -2460,6 +2461,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2460
2461
|
* @param isDarkTheme - Whether dark theme is active
|
|
2461
2462
|
* @returns HorizontalBarChartWithAxisProps for rendering
|
|
2462
2463
|
*/ export function transformVegaLiteToHorizontalBarChartProps(spec, colorMap, isDarkTheme) {
|
|
2464
|
+
var _ref;
|
|
2463
2465
|
var _encoding_color, _encoding_color_legend, _encoding_color1;
|
|
2464
2466
|
// Initialize transformation context
|
|
2465
2467
|
const { dataValues, encoding, markProps } = initializeTransformContext(spec);
|
|
@@ -2557,7 +2559,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2557
2559
|
const titles = getVegaLiteTitles(spec);
|
|
2558
2560
|
const annotations = extractAnnotations(spec);
|
|
2559
2561
|
const tickConfig = extractTickConfig(spec);
|
|
2560
|
-
var _encoding_color_legend_disable;
|
|
2561
2562
|
const result = {
|
|
2562
2563
|
data: barData,
|
|
2563
2564
|
chartTitle: titles.chartTitle,
|
|
@@ -2565,7 +2566,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2565
2566
|
yAxisTitle: titles.yAxisTitle,
|
|
2566
2567
|
...titles.titleStyles ? titles.titleStyles : {},
|
|
2567
2568
|
// Hide legend for single-series horizontal bars (no color encoding)
|
|
2568
|
-
hideLegend: !colorField ? true : (
|
|
2569
|
+
hideLegend: !colorField ? true : (_ref = (_encoding_color1 = encoding.color) === null || _encoding_color1 === void 0 ? void 0 : (_encoding_color_legend = _encoding_color1.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref !== void 0 ? _ref : false
|
|
2569
2570
|
};
|
|
2570
2571
|
if (annotations.length > 0) {
|
|
2571
2572
|
result.annotations = annotations;
|
|
@@ -2629,6 +2630,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2629
2630
|
* @param isDarkTheme - Whether dark theme is active
|
|
2630
2631
|
* @returns ScatterChartProps for rendering
|
|
2631
2632
|
*/ export function transformVegaLiteToScatterChartProps(spec, colorMap, isDarkTheme) {
|
|
2633
|
+
var _ref;
|
|
2632
2634
|
var _encoding_x, _encoding_y, _encoding_y1, _encoding_y2, _encoding_y_axis, _encoding_y3, _encoding_color_legend, _encoding_color;
|
|
2633
2635
|
// Initialize transformation context
|
|
2634
2636
|
const { dataValues, encoding, markProps } = initializeTransformContext(spec);
|
|
@@ -2715,7 +2717,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2715
2717
|
const { yMinValue, yMaxValue } = extractYMinMax(encoding, dataValues);
|
|
2716
2718
|
// Extract axis category ordering
|
|
2717
2719
|
const categoryOrderProps = extractAxisCategoryOrderProps(encoding);
|
|
2718
|
-
var _encoding_color_legend_disable;
|
|
2719
2720
|
const result = {
|
|
2720
2721
|
data: {
|
|
2721
2722
|
chartTitle: titles.chartTitle,
|
|
@@ -2749,7 +2750,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2749
2750
|
yMaxValue: yOrdinalLabels.length - 0.5
|
|
2750
2751
|
},
|
|
2751
2752
|
...categoryOrderProps,
|
|
2752
|
-
hideLegend: (
|
|
2753
|
+
hideLegend: (_ref = (_encoding_color = encoding.color) === null || _encoding_color === void 0 ? void 0 : (_encoding_color_legend = _encoding_color.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref !== void 0 ? _ref : false
|
|
2753
2754
|
};
|
|
2754
2755
|
if (annotations.length > 0) {
|
|
2755
2756
|
result.annotations = annotations;
|
|
@@ -2827,6 +2828,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2827
2828
|
* @param isDarkTheme - Whether dark theme is active
|
|
2828
2829
|
* @returns HeatMapChartProps for rendering
|
|
2829
2830
|
*/ export function transformVegaLiteToHeatMapChartProps(spec, colorMap, isDarkTheme) {
|
|
2831
|
+
var _spec_height;
|
|
2830
2832
|
var _encoding_color, _encoding_color1, _encoding_x, _encoding_x1, _encoding_color_scale, _encoding_color2, _encoding_color_scale1, _encoding_color3;
|
|
2831
2833
|
// Initialize transformation context
|
|
2832
2834
|
const { dataValues, encoding } = initializeTransformContext(spec);
|
|
@@ -2879,9 +2881,9 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2879
2881
|
const dataPointMap = new Map();
|
|
2880
2882
|
const rectTextMap = new Map();
|
|
2881
2883
|
heatmapDataPoints.forEach((point)=>{
|
|
2884
|
+
var _point_rectText;
|
|
2882
2885
|
const key = `${String(point.x)}|${String(point.y)}`;
|
|
2883
2886
|
dataPointMap.set(key, point.value);
|
|
2884
|
-
var _point_rectText;
|
|
2885
2887
|
rectTextMap.set(key, (_point_rectText = point.rectText) !== null && _point_rectText !== void 0 ? _point_rectText : point.value);
|
|
2886
2888
|
});
|
|
2887
2889
|
// Generate complete grid - fill missing cells with 0
|
|
@@ -2900,15 +2902,14 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2900
2902
|
}
|
|
2901
2903
|
yValuesArray.forEach((yVal)=>{
|
|
2902
2904
|
xValuesArray.forEach((xVal)=>{
|
|
2905
|
+
var _dataPointMap_get, _rectTextMap_get;
|
|
2903
2906
|
const key = `${xVal}|${yVal}`;
|
|
2904
|
-
var _dataPointMap_get;
|
|
2905
2907
|
const value = (_dataPointMap_get = dataPointMap.get(key)) !== null && _dataPointMap_get !== void 0 ? _dataPointMap_get : 0; // Use 0 for missing cells
|
|
2906
2908
|
// Update min/max to include filled values
|
|
2907
2909
|
if (value !== 0 || dataPointMap.has(key)) {
|
|
2908
2910
|
minValue = Math.min(minValue, value);
|
|
2909
2911
|
maxValue = Math.max(maxValue, value);
|
|
2910
2912
|
}
|
|
2911
|
-
var _rectTextMap_get;
|
|
2912
2913
|
completeGridDataPoints.push({
|
|
2913
2914
|
x: xVal,
|
|
2914
2915
|
y: yVal,
|
|
@@ -2978,7 +2979,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
2978
2979
|
}
|
|
2979
2980
|
}
|
|
2980
2981
|
}
|
|
2981
|
-
var _spec_height;
|
|
2982
2982
|
return {
|
|
2983
2983
|
chartTitle: titles.chartTitle,
|
|
2984
2984
|
data: [
|
|
@@ -3152,6 +3152,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
3152
3152
|
* @param isDarkTheme - Whether dark theme is active
|
|
3153
3153
|
* @returns PolarChartProps for rendering with Fluent PolarChart component
|
|
3154
3154
|
*/ export function transformVegaLiteToPolarChartProps(spec, colorMap, isDarkTheme) {
|
|
3155
|
+
var _ref;
|
|
3155
3156
|
var _encoding_theta, _encoding_color_legend, _encoding_color;
|
|
3156
3157
|
// Initialize transformation context
|
|
3157
3158
|
const { dataValues, encoding, markProps, primarySpec } = initializeTransformContext(spec);
|
|
@@ -3266,7 +3267,6 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
3266
3267
|
const thetaValues = Array.from(new Set(dataValues.map((row)=>String(row[thetaField]))));
|
|
3267
3268
|
angularAxis.categoryOrder = thetaValues;
|
|
3268
3269
|
}
|
|
3269
|
-
var _encoding_color_legend_disable;
|
|
3270
3270
|
return {
|
|
3271
3271
|
data: polarData,
|
|
3272
3272
|
...titles.chartTitle && {
|
|
@@ -3275,7 +3275,7 @@ export function transformVegaLiteToLineChartProps(spec, colorMap, isDarkTheme) {
|
|
|
3275
3275
|
...titles.titleStyles ? titles.titleStyles : {},
|
|
3276
3276
|
width: typeof spec.width === 'number' ? spec.width : undefined,
|
|
3277
3277
|
height: typeof spec.height === 'number' ? spec.height : 400,
|
|
3278
|
-
hideLegend: (
|
|
3278
|
+
hideLegend: (_ref = (_encoding_color = encoding.color) === null || _encoding_color === void 0 ? void 0 : (_encoding_color_legend = _encoding_color.legend) === null || _encoding_color_legend === void 0 ? void 0 : _encoding_color_legend.disable) !== null && _ref !== void 0 ? _ref : false,
|
|
3279
3279
|
radialAxis,
|
|
3280
3280
|
angularAxis
|
|
3281
3281
|
};
|