@fluentui/react-charts 9.3.11 → 9.3.13

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/index.d.ts +852 -0
  3. package/lib/VegaDeclarativeChart.js +1 -0
  4. package/lib/VegaDeclarativeChart.js.map +1 -0
  5. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +2 -0
  6. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -1
  7. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +1 -0
  8. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +386 -0
  10. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
  11. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +20 -0
  12. package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
  13. package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +415 -0
  14. package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
  15. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3284 -0
  16. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
  17. package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +28 -0
  18. package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
  19. package/lib/components/VegaDeclarativeChart/index.js +1 -0
  20. package/lib/components/VegaDeclarativeChart/index.js.map +1 -0
  21. package/lib/index.js +1 -0
  22. package/lib/index.js.map +1 -1
  23. package/lib/utilities/getWindow.js +1 -0
  24. package/lib/utilities/getWindow.js.map +1 -1
  25. package/lib-commonjs/VegaDeclarativeChart.js +6 -0
  26. package/lib-commonjs/VegaDeclarativeChart.js.map +1 -0
  27. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +1 -0
  28. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -1
  29. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +1 -0
  30. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -1
  31. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +255 -0
  32. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -0
  33. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +35 -0
  34. package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -0
  35. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +412 -0
  36. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -0
  37. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +3219 -0
  38. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -0
  39. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +31 -0
  40. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -0
  41. package/lib-commonjs/components/VegaDeclarativeChart/index.js +6 -0
  42. package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +1 -0
  43. package/lib-commonjs/index.js +1 -0
  44. package/lib-commonjs/index.js.map +1 -1
  45. package/lib-commonjs/utilities/getWindow.js +1 -0
  46. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  47. package/package.json +9 -9
package/dist/index.d.ts CHANGED
@@ -4421,6 +4421,858 @@ declare interface TitleStyles {
4421
4421
  };
4422
4422
  }
4423
4423
 
4424
+ /**
4425
+ * VegaDeclarativeChart - Render Vega-Lite specifications with Fluent UI styling
4426
+ *
4427
+ * Supported chart types:
4428
+ * - Line charts: mark: 'line' or 'point'
4429
+ * - Area charts: mark: 'area'
4430
+ * - Scatter charts: mark: 'point', 'circle', or 'square'
4431
+ * - Vertical bar charts: mark: 'bar' with nominal/ordinal x-axis
4432
+ * - Stacked bar charts: mark: 'bar' with color encoding
4433
+ * - Grouped bar charts: mark: 'bar' with color encoding (via configuration)
4434
+ * - Horizontal bar charts: mark: 'bar' with nominal/ordinal y-axis
4435
+ * - Donut/Pie charts: mark: 'arc' with theta encoding
4436
+ * - Heatmaps: mark: 'rect' with x, y, and color (quantitative) encodings
4437
+ * - Combo charts: Layered specs with bar + line marks render as VerticalStackedBarChart with line overlays
4438
+ *
4439
+ * Multi-plot Support:
4440
+ * - Horizontal concatenation (hconcat): Multiple charts side-by-side
4441
+ * - Vertical concatenation (vconcat): Multiple charts stacked vertically
4442
+ * - Shared data and encoding are merged from parent spec to each subplot
4443
+ *
4444
+ * Limitations:
4445
+ * - Most layered specifications (multiple chart types) are not fully supported
4446
+ * - Bar + Line combinations ARE supported and will render properly
4447
+ * - For other composite charts, only the first layer will be rendered
4448
+ * - Faceting and repeat operators are not yet supported
4449
+ * - Funnel charts are not a native Vega-Lite mark type. The conversion_funnel.json example
4450
+ * uses a horizontal bar chart (y: nominal, x: quantitative) which is the standard way to
4451
+ * represent funnel data in Vega-Lite. For specialized funnel visualizations with tapering
4452
+ * shapes, consider using Plotly's native funnel chart type instead.
4453
+ *
4454
+ * Note: Sankey, Gantt, and Gauge charts are not standard Vega-Lite marks.
4455
+ * These specialized visualizations would require custom extensions or alternative approaches.
4456
+ *
4457
+ * @example Line Chart
4458
+ * ```tsx
4459
+ * import { VegaDeclarativeChart } from '@fluentui/react-charts';
4460
+ *
4461
+ * const spec = {
4462
+ * mark: 'line',
4463
+ * data: { values: [{ x: 1, y: 10 }, { x: 2, y: 20 }] },
4464
+ * encoding: {
4465
+ * x: { field: 'x', type: 'quantitative' },
4466
+ * y: { field: 'y', type: 'quantitative' }
4467
+ * }
4468
+ * };
4469
+ *
4470
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: spec }} />
4471
+ * ```
4472
+ *
4473
+ * @example Area Chart
4474
+ * ```tsx
4475
+ * const areaSpec = {
4476
+ * mark: 'area',
4477
+ * data: { values: [{ date: '2023-01', value: 100 }, { date: '2023-02', value: 150 }] },
4478
+ * encoding: {
4479
+ * x: { field: 'date', type: 'temporal' },
4480
+ * y: { field: 'value', type: 'quantitative' }
4481
+ * }
4482
+ * };
4483
+ *
4484
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: areaSpec }} />
4485
+ * ```
4486
+ *
4487
+ * @example Scatter Chart
4488
+ * ```tsx
4489
+ * const scatterSpec = {
4490
+ * mark: 'point',
4491
+ * data: { values: [{ x: 10, y: 20, size: 100 }, { x: 15, y: 30, size: 200 }] },
4492
+ * encoding: {
4493
+ * x: { field: 'x', type: 'quantitative' },
4494
+ * y: { field: 'y', type: 'quantitative' },
4495
+ * size: { field: 'size', type: 'quantitative' }
4496
+ * }
4497
+ * };
4498
+ *
4499
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: scatterSpec }} />
4500
+ * ```
4501
+ *
4502
+ * @example Vertical Bar Chart
4503
+ * ```tsx
4504
+ * const barSpec = {
4505
+ * mark: 'bar',
4506
+ * data: { values: [{ cat: 'A', val: 28 }, { cat: 'B', val: 55 }] },
4507
+ * encoding: {
4508
+ * x: { field: 'cat', type: 'nominal' },
4509
+ * y: { field: 'val', type: 'quantitative' }
4510
+ * }
4511
+ * };
4512
+ *
4513
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: barSpec }} />
4514
+ * ```
4515
+ *
4516
+ * @example Stacked Bar Chart
4517
+ * ```tsx
4518
+ * const stackedSpec = {
4519
+ * mark: 'bar',
4520
+ * data: { values: [
4521
+ * { cat: 'A', group: 'G1', val: 28 },
4522
+ * { cat: 'A', group: 'G2', val: 15 }
4523
+ * ]},
4524
+ * encoding: {
4525
+ * x: { field: 'cat', type: 'nominal' },
4526
+ * y: { field: 'val', type: 'quantitative' },
4527
+ * color: { field: 'group', type: 'nominal' }
4528
+ * }
4529
+ * };
4530
+ *
4531
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: stackedSpec }} />
4532
+ * ```
4533
+ *
4534
+ * @example Donut Chart
4535
+ * ```tsx
4536
+ * const donutSpec = {
4537
+ * mark: 'arc',
4538
+ * data: { values: [{ category: 'A', value: 30 }, { category: 'B', value: 70 }] },
4539
+ * encoding: {
4540
+ * theta: { field: 'value', type: 'quantitative' },
4541
+ * color: { field: 'category', type: 'nominal' }
4542
+ * }
4543
+ * };
4544
+ *
4545
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: donutSpec }} />
4546
+ * ```
4547
+ *
4548
+ * @example Heatmap
4549
+ * ```tsx
4550
+ * const heatmapSpec = {
4551
+ * mark: 'rect',
4552
+ * data: { values: [
4553
+ * { x: 'A', y: 'Mon', value: 28 },
4554
+ * { x: 'B', y: 'Mon', value: 55 },
4555
+ * { x: 'A', y: 'Tue', value: 43 }
4556
+ * ]},
4557
+ * encoding: {
4558
+ * x: { field: 'x', type: 'nominal' },
4559
+ * y: { field: 'y', type: 'nominal' },
4560
+ * color: { field: 'value', type: 'quantitative' }
4561
+ * }
4562
+ * };
4563
+ *
4564
+ * <VegaDeclarativeChart chartSchema={{ vegaLiteSpec: heatmapSpec }} />
4565
+ * ```
4566
+ */
4567
+ export declare const VegaDeclarativeChart: React_2.ForwardRefExoticComponent<VegaDeclarativeChartProps & React_2.RefAttributes<HTMLDivElement>>;
4568
+
4569
+ /**
4570
+ * Props for VegaDeclarativeChart component
4571
+ */
4572
+ export declare interface VegaDeclarativeChartProps {
4573
+ /**
4574
+ * Vega-Lite chart schema
4575
+ */
4576
+ chartSchema: VegaSchema;
4577
+ /**
4578
+ * Callback when schema changes (e.g., legend selection)
4579
+ */
4580
+ onSchemaChange?: (newSchema: VegaSchema) => void;
4581
+ /**
4582
+ * Additional CSS class name
4583
+ */
4584
+ className?: string;
4585
+ /**
4586
+ * Additional inline styles
4587
+ */
4588
+ style?: React_2.CSSProperties;
4589
+ }
4590
+
4591
+ /**
4592
+ * Vega-Lite axis configuration
4593
+ */
4594
+ declare interface VegaLiteAxis {
4595
+ /**
4596
+ * Axis title
4597
+ */
4598
+ title?: string | null;
4599
+ /**
4600
+ * Format string for axis tick labels
4601
+ * Uses d3-format for quantitative and d3-time-format for temporal
4602
+ */
4603
+ format?: string;
4604
+ /**
4605
+ * Tick values to display
4606
+ */
4607
+ values?: number[] | string[];
4608
+ /**
4609
+ * Number of ticks
4610
+ */
4611
+ tickCount?: number;
4612
+ /**
4613
+ * Grid visibility
4614
+ */
4615
+ grid?: boolean;
4616
+ }
4617
+
4618
+ /**
4619
+ * Vega-Lite binning configuration
4620
+ */
4621
+ declare interface VegaLiteBin {
4622
+ /**
4623
+ * Maximum number of bins
4624
+ */
4625
+ maxbins?: number;
4626
+ /**
4627
+ * Exact step size between bins
4628
+ */
4629
+ step?: number;
4630
+ /**
4631
+ * Extent [min, max] for binning
4632
+ */
4633
+ extent?: [number, number];
4634
+ /**
4635
+ * Base for nice bin values (e.g., 10 for powers of 10)
4636
+ */
4637
+ base?: number;
4638
+ /**
4639
+ * Whether to include the boundary in bins
4640
+ */
4641
+ anchor?: number;
4642
+ }
4643
+
4644
+ /**
4645
+ * Vega-Lite color encoding channel
4646
+ */
4647
+ declare interface VegaLiteColorEncoding {
4648
+ /**
4649
+ * Field name for color differentiation
4650
+ */
4651
+ field?: string;
4652
+ /**
4653
+ * Data type
4654
+ */
4655
+ type?: VegaLiteType;
4656
+ /**
4657
+ * Legend configuration
4658
+ */
4659
+ legend?: VegaLiteLegend | null;
4660
+ /**
4661
+ * Scale configuration
4662
+ */
4663
+ scale?: VegaLiteScale | null;
4664
+ /**
4665
+ * Fixed color value
4666
+ */
4667
+ value?: string;
4668
+ }
4669
+
4670
+ /**
4671
+ * Vega-Lite inline data
4672
+ */
4673
+ declare interface VegaLiteData {
4674
+ /**
4675
+ * Inline data values (array of objects)
4676
+ */
4677
+ values?: Array<Record<string, unknown>>;
4678
+ /**
4679
+ * URL to load data from
4680
+ * TODO: Implement remote data loading
4681
+ */
4682
+ url?: string;
4683
+ /**
4684
+ * Named dataset reference
4685
+ * TODO: Implement named dataset resolution
4686
+ */
4687
+ name?: string;
4688
+ /**
4689
+ * Data format specification
4690
+ * TODO: Implement format parsing (csv, json, etc.)
4691
+ */
4692
+ format?: {
4693
+ type?: 'json' | 'csv' | 'tsv';
4694
+ parse?: Record<string, string>;
4695
+ };
4696
+ }
4697
+
4698
+ /**
4699
+ * Vega-Lite encoding channels
4700
+ */
4701
+ declare interface VegaLiteEncoding {
4702
+ /**
4703
+ * X-axis encoding
4704
+ */
4705
+ x?: VegaLitePositionEncoding;
4706
+ /**
4707
+ * Y-axis encoding
4708
+ */
4709
+ y?: VegaLitePositionEncoding;
4710
+ /**
4711
+ * Color encoding for series differentiation
4712
+ */
4713
+ color?: VegaLiteColorEncoding;
4714
+ /**
4715
+ * Size encoding for point marks
4716
+ */
4717
+ size?: VegaLiteSizeEncoding;
4718
+ /**
4719
+ * Shape encoding for point marks
4720
+ */
4721
+ shape?: VegaLiteShapeEncoding;
4722
+ /**
4723
+ * Theta encoding for pie/donut charts and polar coordinates
4724
+ */
4725
+ theta?: VegaLiteThetaEncoding;
4726
+ /**
4727
+ * Radius encoding for polar charts
4728
+ */
4729
+ radius?: VegaLiteRadiusEncoding;
4730
+ /**
4731
+ * X2 encoding for interval marks (rect, rule, bar with ranges)
4732
+ */
4733
+ x2?: VegaLitePositionEncoding;
4734
+ /**
4735
+ * Y2 encoding for interval marks (rect, rule, bar with ranges)
4736
+ */
4737
+ y2?: VegaLitePositionEncoding;
4738
+ /**
4739
+ * Text encoding for text marks
4740
+ */
4741
+ text?: VegaLiteTextEncoding;
4742
+ /**
4743
+ * xOffset encoding for grouped bar charts
4744
+ */
4745
+ xOffset?: VegaLitePositionEncoding;
4746
+ /**
4747
+ * Tooltip encoding (single field or array of fields)
4748
+ */
4749
+ tooltip?: any;
4750
+ }
4751
+
4752
+ /**
4753
+ * Vega-Lite interpolation method
4754
+ */
4755
+ declare type VegaLiteInterpolate = 'linear' | 'linear-closed' | 'step' | 'step-before' | 'step-after' | 'basis' | 'cardinal' | 'monotone' | 'natural';
4756
+
4757
+ /**
4758
+ * Vega-Lite legend configuration
4759
+ */
4760
+ declare interface VegaLiteLegend {
4761
+ /**
4762
+ * Legend title
4763
+ */
4764
+ title?: string | null;
4765
+ /**
4766
+ * Hide the legend
4767
+ */
4768
+ disable?: boolean;
4769
+ }
4770
+
4771
+ /**
4772
+ * Vega-Lite mark types
4773
+ */
4774
+ declare type VegaLiteMark = 'line' | 'point' | 'circle' | 'square' | 'bar' | 'area' | 'rect' | 'rule' | 'text' | 'arc';
4775
+
4776
+ /**
4777
+ * Vega-Lite mark definition (can be string or object)
4778
+ */
4779
+ declare type VegaLiteMarkDef = VegaLiteMark | {
4780
+ type: VegaLiteMark;
4781
+ /**
4782
+ * Mark color
4783
+ */
4784
+ color?: string;
4785
+ /**
4786
+ * Line interpolation method
4787
+ */
4788
+ interpolate?: VegaLiteInterpolate;
4789
+ /**
4790
+ * Point marker visibility
4791
+ */
4792
+ point?: boolean | {
4793
+ filled?: boolean;
4794
+ size?: number;
4795
+ };
4796
+ /**
4797
+ * Stroke width
4798
+ */
4799
+ strokeWidth?: number;
4800
+ /**
4801
+ * Stroke dash pattern (e.g., [5, 5] for dashed, [2, 2] for dotted)
4802
+ */
4803
+ strokeDash?: number[];
4804
+ /**
4805
+ * Fill opacity
4806
+ */
4807
+ fillOpacity?: number;
4808
+ /**
4809
+ * Stroke opacity
4810
+ */
4811
+ strokeOpacity?: number;
4812
+ /**
4813
+ * Overall opacity
4814
+ */
4815
+ opacity?: number;
4816
+ /**
4817
+ * Inner radius for arc/pie/donut marks (0-1 or pixel value)
4818
+ */
4819
+ innerRadius?: number;
4820
+ /**
4821
+ * Outer radius for arc/pie marks (pixel value)
4822
+ */
4823
+ outerRadius?: number;
4824
+ };
4825
+
4826
+ /**
4827
+ * Vega-Lite position encoding channel (x or y)
4828
+ */
4829
+ declare interface VegaLitePositionEncoding {
4830
+ /**
4831
+ * Field name in data
4832
+ */
4833
+ field?: string;
4834
+ /**
4835
+ * Data type
4836
+ */
4837
+ type?: VegaLiteType;
4838
+ /**
4839
+ * Axis configuration
4840
+ */
4841
+ axis?: VegaLiteAxis | null;
4842
+ /**
4843
+ * Constant value for encoding (for reference lines and annotations)
4844
+ */
4845
+ value?: number | string | Date;
4846
+ /**
4847
+ * Datum value for encoding (alternative to value)
4848
+ */
4849
+ datum?: number | string | Date;
4850
+ /**
4851
+ * Scale configuration
4852
+ */
4853
+ scale?: VegaLiteScale | null;
4854
+ /**
4855
+ * Sort order for categorical axes
4856
+ * Supports: 'ascending', 'descending', null, array of values, or object with field/op/order
4857
+ */
4858
+ sort?: VegaLiteSort;
4859
+ /**
4860
+ * Binning configuration for histograms
4861
+ * Set to true for default binning or provide custom bin parameters
4862
+ */
4863
+ bin?: boolean | VegaLiteBin;
4864
+ /**
4865
+ * Stack configuration for area/bar charts
4866
+ * - null: disable stacking
4867
+ * - 'zero': stack from zero baseline (default for area charts)
4868
+ * - 'center': center stack
4869
+ * - 'normalize': normalize to 100%
4870
+ */
4871
+ stack?: null | 'zero' | 'center' | 'normalize';
4872
+ /**
4873
+ * Aggregate function
4874
+ */
4875
+ aggregate?: 'count' | 'sum' | 'mean' | 'average' | 'median' | 'min' | 'max';
4876
+ /**
4877
+ * Axis title (shorthand alternative to axis.title)
4878
+ */
4879
+ title?: string;
4880
+ /**
4881
+ * Time unit for temporal fields (e.g., 'yearmonth', 'month', 'day')
4882
+ */
4883
+ timeUnit?: string;
4884
+ }
4885
+
4886
+ /**
4887
+ * Vega-Lite radius encoding channel for polar charts
4888
+ */
4889
+ declare interface VegaLiteRadiusEncoding {
4890
+ /**
4891
+ * Field name
4892
+ */
4893
+ field?: string;
4894
+ /**
4895
+ * Data type
4896
+ */
4897
+ type?: VegaLiteType;
4898
+ /**
4899
+ * Aggregate function
4900
+ */
4901
+ aggregate?: 'count' | 'sum' | 'mean' | 'average' | 'median' | 'min' | 'max';
4902
+ /**
4903
+ * Axis configuration
4904
+ */
4905
+ axis?: VegaLiteAxis | null;
4906
+ /**
4907
+ * Scale configuration
4908
+ */
4909
+ scale?: VegaLiteScale | null;
4910
+ }
4911
+
4912
+ /**
4913
+ * Vega-Lite scale configuration
4914
+ */
4915
+ declare interface VegaLiteScale {
4916
+ /**
4917
+ * Scale type
4918
+ */
4919
+ type?: VegaLiteScaleType;
4920
+ /**
4921
+ * Domain values [min, max]
4922
+ */
4923
+ domain?: (number | string)[];
4924
+ /**
4925
+ * Range values [min, max]
4926
+ */
4927
+ range?: [number | string, number | string] | string[];
4928
+ /**
4929
+ * Color scheme name (e.g., 'category10', 'tableau10')
4930
+ */
4931
+ scheme?: string;
4932
+ /**
4933
+ * Whether scale domain should include zero
4934
+ */
4935
+ zero?: boolean;
4936
+ /**
4937
+ * Whether to reverse the scale
4938
+ */
4939
+ reverse?: boolean;
4940
+ }
4941
+
4942
+ /**
4943
+ * Vega-Lite scale type
4944
+ */
4945
+ declare type VegaLiteScaleType = 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | 'time' | 'utc' | 'ordinal' | 'band' | 'point';
4946
+
4947
+ /**
4948
+ * Vega-Lite shape encoding channel
4949
+ */
4950
+ declare interface VegaLiteShapeEncoding {
4951
+ /**
4952
+ * Field name for shape encoding
4953
+ */
4954
+ field?: string;
4955
+ /**
4956
+ * Data type
4957
+ */
4958
+ type?: VegaLiteType;
4959
+ /**
4960
+ * Fixed shape value
4961
+ */
4962
+ value?: string;
4963
+ }
4964
+
4965
+ /**
4966
+ * Vega-Lite size encoding channel
4967
+ */
4968
+ declare interface VegaLiteSizeEncoding {
4969
+ /**
4970
+ * Field name for size encoding
4971
+ */
4972
+ field?: string;
4973
+ /**
4974
+ * Data type
4975
+ */
4976
+ type?: VegaLiteType;
4977
+ /**
4978
+ * Fixed size value
4979
+ */
4980
+ value?: number;
4981
+ }
4982
+
4983
+ /**
4984
+ * Vega-Lite sort specification
4985
+ */
4986
+ declare type VegaLiteSort = 'ascending' | 'descending' | null | {
4987
+ field?: string;
4988
+ op?: 'count' | 'sum' | 'mean' | 'average' | 'median' | 'min' | 'max';
4989
+ order?: 'ascending' | 'descending';
4990
+ } | string[];
4991
+
4992
+ /**
4993
+ * Top-level Vega-Lite specification
4994
+ */
4995
+ export declare interface VegaLiteSpec {
4996
+ /**
4997
+ * Schema version
4998
+ */
4999
+ $schema?: string;
5000
+ /**
5001
+ * Chart title - can be a string or a detailed title configuration
5002
+ */
5003
+ title?: string | VegaLiteTitleParams;
5004
+ /**
5005
+ * Chart description
5006
+ */
5007
+ description?: string;
5008
+ /**
5009
+ * Chart width
5010
+ */
5011
+ width?: number | 'container';
5012
+ /**
5013
+ * Chart height
5014
+ */
5015
+ height?: number | 'container';
5016
+ /**
5017
+ * Data specification (for single/layer specs)
5018
+ */
5019
+ data?: VegaLiteData;
5020
+ /**
5021
+ * Mark type (for single view)
5022
+ */
5023
+ mark?: VegaLiteMarkDef;
5024
+ /**
5025
+ * Encoding channels (for single view)
5026
+ */
5027
+ encoding?: VegaLiteEncoding;
5028
+ /**
5029
+ * Horizontal concatenation for multi-plot layouts
5030
+ */
5031
+ hconcat?: VegaLiteSpec[];
5032
+ /**
5033
+ * Vertical concatenation for multi-plot layouts
5034
+ */
5035
+ vconcat?: VegaLiteSpec[];
5036
+ /**
5037
+ * Layer specification
5038
+ */
5039
+ layer?: VegaLiteUnitSpec[];
5040
+ /**
5041
+ * Data transformations
5042
+ * TODO: Implement transform pipeline
5043
+ */
5044
+ transform?: Array<Record<string, unknown>>;
5045
+ /**
5046
+ * Background color
5047
+ */
5048
+ background?: string;
5049
+ /**
5050
+ * Padding configuration
5051
+ */
5052
+ padding?: number | {
5053
+ top?: number;
5054
+ bottom?: number;
5055
+ left?: number;
5056
+ right?: number;
5057
+ };
5058
+ /**
5059
+ * Auto-size configuration
5060
+ */
5061
+ autosize?: string | {
5062
+ type?: string;
5063
+ contains?: string;
5064
+ };
5065
+ /**
5066
+ * Configuration overrides
5067
+ * TODO: Implement config resolution
5068
+ */
5069
+ config?: Record<string, unknown>;
5070
+ /**
5071
+ * Interactive selection definitions
5072
+ * TODO: Implement selection support
5073
+ */
5074
+ selection?: Record<string, unknown>;
5075
+ /**
5076
+ * Facet specification for small multiples
5077
+ * TODO: Implement facet support
5078
+ */
5079
+ facet?: Record<string, unknown>;
5080
+ /**
5081
+ * Repeat specification for small multiples
5082
+ * TODO: Implement repeat support
5083
+ */
5084
+ repeat?: Record<string, unknown>;
5085
+ /**
5086
+ * Scale resolution configuration
5087
+ * Controls whether scales are shared or independent across views
5088
+ */
5089
+ resolve?: {
5090
+ scale?: {
5091
+ x?: 'shared' | 'independent';
5092
+ y?: 'shared' | 'independent';
5093
+ color?: 'shared' | 'independent';
5094
+ opacity?: 'shared' | 'independent';
5095
+ size?: 'shared' | 'independent';
5096
+ shape?: 'shared' | 'independent';
5097
+ };
5098
+ axis?: {
5099
+ x?: 'shared' | 'independent';
5100
+ y?: 'shared' | 'independent';
5101
+ };
5102
+ legend?: {
5103
+ color?: 'shared' | 'independent';
5104
+ opacity?: 'shared' | 'independent';
5105
+ size?: 'shared' | 'independent';
5106
+ shape?: 'shared' | 'independent';
5107
+ };
5108
+ };
5109
+ }
5110
+
5111
+ /**
5112
+ * Vega-Lite text encoding channel
5113
+ */
5114
+ declare interface VegaLiteTextEncoding {
5115
+ /**
5116
+ * Field name
5117
+ */
5118
+ field?: string;
5119
+ /**
5120
+ * Data type
5121
+ */
5122
+ type?: VegaLiteType;
5123
+ /**
5124
+ * Fixed text value
5125
+ */
5126
+ value?: string;
5127
+ /**
5128
+ * Datum value for text encoding
5129
+ */
5130
+ datum?: string | number;
5131
+ }
5132
+
5133
+ /**
5134
+ * Vega-Lite theta encoding channel for pie/donut charts and polar coordinates
5135
+ */
5136
+ declare interface VegaLiteThetaEncoding {
5137
+ /**
5138
+ * Field name
5139
+ */
5140
+ field?: string;
5141
+ /**
5142
+ * Data type
5143
+ */
5144
+ type?: VegaLiteType;
5145
+ /**
5146
+ * Aggregate function
5147
+ */
5148
+ aggregate?: 'count' | 'sum' | 'mean' | 'average' | 'median' | 'min' | 'max';
5149
+ /**
5150
+ * Axis configuration for polar charts
5151
+ */
5152
+ axis?: VegaLiteAxis | null;
5153
+ /**
5154
+ * Scale configuration for polar charts
5155
+ */
5156
+ scale?: VegaLiteScale | null;
5157
+ }
5158
+
5159
+ /**
5160
+ * Vega-Lite title configuration with styling options
5161
+ */
5162
+ declare interface VegaLiteTitleParams {
5163
+ /**
5164
+ * Title text
5165
+ */
5166
+ text: string;
5167
+ /**
5168
+ * Subtitle text
5169
+ */
5170
+ subtitle?: string;
5171
+ /**
5172
+ * Font for the title
5173
+ */
5174
+ font?: string;
5175
+ /**
5176
+ * Font size for the title
5177
+ */
5178
+ fontSize?: number;
5179
+ /**
5180
+ * Font style for the title (e.g., 'normal', 'italic')
5181
+ */
5182
+ fontStyle?: string;
5183
+ /**
5184
+ * Font weight for the title (e.g., 'normal', 'bold', 100-900)
5185
+ */
5186
+ fontWeight?: string | number;
5187
+ /**
5188
+ * Color of the title text
5189
+ */
5190
+ color?: string;
5191
+ /**
5192
+ * Horizontal anchor position for the title
5193
+ * - 'start': left-aligned
5194
+ * - 'middle': centered
5195
+ * - 'end': right-aligned
5196
+ */
5197
+ anchor?: 'start' | 'middle' | 'end';
5198
+ /**
5199
+ * Vertical offset from the top of the chart
5200
+ */
5201
+ offset?: number;
5202
+ /**
5203
+ * Additional padding around the subtitle
5204
+ */
5205
+ subtitlePadding?: number;
5206
+ }
5207
+
5208
+ /**
5209
+ * Vega-Lite TypeScript interfaces for declarative chart specifications.
5210
+ * This is a minimal subset focused on line/point charts with basic encodings.
5211
+ *
5212
+ * RECOMMENDED: For full type coverage, install the official vega-lite package:
5213
+ * ```
5214
+ * npm install vega-lite
5215
+ * ```
5216
+ * Then import `TopLevelSpec` from 'vega-lite' for complete schema support.
5217
+ *
5218
+ * The types provided here are a lightweight alternative that covers common use cases
5219
+ * without requiring the full vega-lite dependency (~5.8MB unpacked).
5220
+ *
5221
+ * Full Vega-Lite spec: https://vega.github.io/vega-lite/docs/
5222
+ *
5223
+ * TODO: Add support for:
5224
+ * - Transform operations (filter, aggregate, calculate, etc.)
5225
+ * - Remote data sources (url, named datasets)
5226
+ * - Facet and concatenation for multi-view layouts
5227
+ * - Selection interactions
5228
+ * - Additional mark types (bar, area, etc.)
5229
+ * - Conditional encodings
5230
+ * - Tooltip customization
5231
+ */
5232
+ /**
5233
+ * Vega-Lite data type for field encodings
5234
+ */
5235
+ declare type VegaLiteType = 'quantitative' | 'temporal' | 'ordinal' | 'nominal' | 'geojson';
5236
+
5237
+ /**
5238
+ * Base Vega-Lite spec unit (single view)
5239
+ */
5240
+ declare interface VegaLiteUnitSpec {
5241
+ /**
5242
+ * Mark type
5243
+ */
5244
+ mark: VegaLiteMarkDef;
5245
+ /**
5246
+ * Encoding channels
5247
+ */
5248
+ encoding?: VegaLiteEncoding;
5249
+ /**
5250
+ * Data specification
5251
+ */
5252
+ data?: VegaLiteData;
5253
+ /**
5254
+ * Data transformations
5255
+ * TODO: Implement transform pipeline
5256
+ */
5257
+ transform?: Array<Record<string, unknown>>;
5258
+ }
5259
+
5260
+ /**
5261
+ * Schema for VegaDeclarativeChart component
5262
+ */
5263
+ export declare interface VegaSchema {
5264
+ /**
5265
+ * Vega-Lite specification
5266
+ *
5267
+ * @see https://vega.github.io/vega-lite/docs/spec.html
5268
+ */
5269
+ vegaLiteSpec: VegaLiteSpec;
5270
+ /**
5271
+ * Selected legends for filtering
5272
+ */
5273
+ selectedLegends?: string[];
5274
+ }
5275
+
4424
5276
  /**
4425
5277
  * VerticalBarchart component
4426
5278
  * {@docCategory VerticalBarChart}