@opendata-ai/openchart-core 8.8.0 → 8.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendata-ai/openchart-core",
3
- "version": "8.8.0",
3
+ "version": "8.9.1",
4
4
  "description": "Types, theme, colors, accessibility, and utilities for openchart",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Riley Hilliard",
@@ -7386,6 +7386,67 @@
7386
7386
  "additionalProperties": false,
7387
7387
  "description": "Facet channel definition: partitions data into small-multiple panels.\n\nUnlike positional channels, facet only needs a field, a categorical type, and optional layout hints (columns, sort). It does not carry scale/axis config because it produces a grid, not a visual encoding."
7388
7388
  },
7389
+ "FieldMetadata": {
7390
+ "type": "object",
7391
+ "properties": {
7392
+ "type": {
7393
+ "type": "string",
7394
+ "enum": [
7395
+ "text",
7396
+ "number",
7397
+ "date"
7398
+ ],
7399
+ "description": "Explicit imported field type; preserved with the portable document."
7400
+ },
7401
+ "role": {
7402
+ "type": "string",
7403
+ "const": "identity",
7404
+ "description": "Identifies an internal, persistent row identity column."
7405
+ },
7406
+ "label": {
7407
+ "type": "string"
7408
+ },
7409
+ "unit": {
7410
+ "type": "string"
7411
+ },
7412
+ "measure": {
7413
+ "type": "string"
7414
+ },
7415
+ "provenance": {
7416
+ "type": "string"
7417
+ },
7418
+ "representation": {
7419
+ "type": "string",
7420
+ "enum": [
7421
+ "number",
7422
+ "percent",
7423
+ "proportion"
7424
+ ],
7425
+ "description": "Percent is encoded 0–100; proportion is encoded 0–1."
7426
+ },
7427
+ "interval": {
7428
+ "type": "object",
7429
+ "properties": {
7430
+ "lower": {
7431
+ "type": "string"
7432
+ },
7433
+ "upper": {
7434
+ "type": "string"
7435
+ }
7436
+ },
7437
+ "required": [
7438
+ "lower",
7439
+ "upper"
7440
+ ],
7441
+ "additionalProperties": false
7442
+ },
7443
+ "statusField": {
7444
+ "type": "string"
7445
+ }
7446
+ },
7447
+ "additionalProperties": false,
7448
+ "description": "Supplied semantics; the library never invents a measure or uncertainty."
7449
+ },
7389
7450
  "DataRow": {
7390
7451
  "type": "object",
7391
7452
  "additionalProperties": {},
@@ -8061,6 +8122,17 @@
8061
8122
  "type": "string",
8062
8123
  "description": "Optional muted second-tone text rendered below the primary `text`. Used for supporting context (e.g. methodology, source). Newlines in `text` still produce multi-line primary; subtitle is a separate block.\n\nSupports the same inline `**bold**` spans as `text`. When a subtitle is present and no `fontWeight` is set, the primary `text` resolves to weight 700 — the lede + context stack."
8063
8124
  },
8125
+ "subtitleFontSize": {
8126
+ "type": "number",
8127
+ "description": "Subtitle size in pixels. Default: round(fontSize * 0.85)."
8128
+ },
8129
+ "maxWidth": {
8130
+ "type": [
8131
+ "number",
8132
+ "null"
8133
+ ],
8134
+ "description": "Optional display wrap width in pixels. Omitted or null keeps unbounded lines."
8135
+ },
8064
8136
  "dot": {
8065
8137
  "anyOf": [
8066
8138
  {
@@ -8193,6 +8265,10 @@
8193
8265
  "$ref": "#/definitions/ConnectorType",
8194
8266
  "description": "Connector style."
8195
8267
  },
8268
+ "bend": {
8269
+ "type": "number",
8270
+ "description": "Curve displacement along the chord normal, from -1 to 1. Omitted or zero preserves the automatic curve. Ignored for other connector types."
8271
+ },
8196
8272
  "arrow": {
8197
8273
  "type": "boolean",
8198
8274
  "description": "Whether to draw an arrowhead at the data-point end. Default: true for curve, false for straight. Drop-line never takes a head."
@@ -8368,6 +8444,16 @@
8368
8444
  "$ref": "#/definitions/AnnotationOffset",
8369
8445
  "description": "Pixel offset for the reference line label."
8370
8446
  },
8447
+ "labelPlacement": {
8448
+ "type": "string",
8449
+ "enum": [
8450
+ "auto",
8451
+ "start",
8452
+ "end",
8453
+ "outside"
8454
+ ],
8455
+ "description": "Opt-in screen-space label placement. Outside reserves a right gutter or top lane; omission preserves legacy labelAnchor behavior."
8456
+ },
8371
8457
  "labelAnchor": {
8372
8458
  "$ref": "#/definitions/AnnotationAnchor",
8373
8459
  "description": "Anchor direction for the reference line label."
@@ -8541,6 +8627,21 @@
8541
8627
  "ResponsiveConfig": {
8542
8628
  "type": "object",
8543
8629
  "properties": {
8630
+ "compactAnnotationLimit": {
8631
+ "type": [
8632
+ "number",
8633
+ "null"
8634
+ ],
8635
+ "description": "Maximum eligible inline callouts below 400px container width; null or omitted is unlimited. Pinned annotations are exempt."
8636
+ },
8637
+ "preserveEnd": {
8638
+ "type": "boolean",
8639
+ "description": "Preserve the final temporal boundary before thinning interior ticks."
8640
+ },
8641
+ "labelSummary": {
8642
+ "type": "boolean",
8643
+ "description": "Move direct series labels into a keyed list when the inline column cannot fit."
8644
+ },
8544
8645
  "autoThin": {
8545
8646
  "type": "boolean",
8546
8647
  "description": "Automatic annotation thinning at narrow widths. When true (default), annotations that can't be placed without overlap are demoted to numbered dot markers with footnote text below the chart. Set false to restore the pre-auto-thinning behavior (annotations hidden at compact breakpoints)."
@@ -8625,6 +8726,34 @@
8625
8726
  "$ref": "#/definitions/TokenValue",
8626
8727
  "description": "Annotation text color. Accepts a TokenValue for light/dark pairs."
8627
8728
  },
8729
+ "annotationLabel": {
8730
+ "$ref": "#/definitions/TokenValue",
8731
+ "description": "Annotation label color. Accepts a TokenValue light/dark pair."
8732
+ },
8733
+ "annotationMuted": {
8734
+ "$ref": "#/definitions/TokenValue",
8735
+ "description": "Annotation muted color. Accepts a TokenValue light/dark pair."
8736
+ },
8737
+ "annotationLeader": {
8738
+ "$ref": "#/definitions/TokenValue",
8739
+ "description": "Annotation leader color. Accepts a TokenValue light/dark pair."
8740
+ },
8741
+ "annotationRule": {
8742
+ "$ref": "#/definitions/TokenValue",
8743
+ "description": "Annotation rule color. Accepts a TokenValue light/dark pair."
8744
+ },
8745
+ "annotationRangeFill": {
8746
+ "$ref": "#/definitions/TokenValue",
8747
+ "description": "Annotation rangefill color. Accepts a TokenValue light/dark pair."
8748
+ },
8749
+ "annotationMarkerFill": {
8750
+ "$ref": "#/definitions/TokenValue",
8751
+ "description": "Annotation markerfill color. Accepts a TokenValue light/dark pair."
8752
+ },
8753
+ "annotationPlate": {
8754
+ "$ref": "#/definitions/TokenValue",
8755
+ "description": "Annotation plate color. Accepts a TokenValue light/dark pair."
8756
+ },
8628
8757
  "positive": {
8629
8758
  "$ref": "#/definitions/TokenValue",
8630
8759
  "description": "Semantic color for positive/up-trend values. Accepts a TokenValue for light/dark pairs."
@@ -8757,10 +8886,10 @@
8757
8886
  "eyebrow": {
8758
8887
  "anyOf": [
8759
8888
  {
8760
- "type": "string"
8889
+ "$ref": "#/definitions/ChromeThemeOverride"
8761
8890
  },
8762
8891
  {
8763
- "$ref": "#/definitions/ChromeThemeOverride"
8892
+ "type": "string"
8764
8893
  }
8765
8894
  ],
8766
8895
  "description": "Eyebrow (kicker) style override."
@@ -8768,10 +8897,10 @@
8768
8897
  "title": {
8769
8898
  "anyOf": [
8770
8899
  {
8771
- "type": "string"
8900
+ "$ref": "#/definitions/ChromeThemeOverride"
8772
8901
  },
8773
8902
  {
8774
- "$ref": "#/definitions/ChromeThemeOverride"
8903
+ "type": "string"
8775
8904
  }
8776
8905
  ],
8777
8906
  "description": "Title style override."
@@ -8779,10 +8908,10 @@
8779
8908
  "subtitle": {
8780
8909
  "anyOf": [
8781
8910
  {
8782
- "type": "string"
8911
+ "$ref": "#/definitions/ChromeThemeOverride"
8783
8912
  },
8784
8913
  {
8785
- "$ref": "#/definitions/ChromeThemeOverride"
8914
+ "type": "string"
8786
8915
  }
8787
8916
  ],
8788
8917
  "description": "Subtitle style override."
@@ -8790,10 +8919,10 @@
8790
8919
  "source": {
8791
8920
  "anyOf": [
8792
8921
  {
8793
- "type": "string"
8922
+ "$ref": "#/definitions/ChromeThemeOverride"
8794
8923
  },
8795
8924
  {
8796
- "$ref": "#/definitions/ChromeThemeOverride"
8925
+ "type": "string"
8797
8926
  }
8798
8927
  ],
8799
8928
  "description": "Source/attribution style override."
@@ -8801,10 +8930,10 @@
8801
8930
  "byline": {
8802
8931
  "anyOf": [
8803
8932
  {
8804
- "type": "string"
8933
+ "$ref": "#/definitions/ChromeThemeOverride"
8805
8934
  },
8806
8935
  {
8807
- "$ref": "#/definitions/ChromeThemeOverride"
8936
+ "type": "string"
8808
8937
  }
8809
8938
  ],
8810
8939
  "description": "Byline style override."
@@ -8812,10 +8941,10 @@
8812
8941
  "footer": {
8813
8942
  "anyOf": [
8814
8943
  {
8815
- "type": "string"
8944
+ "$ref": "#/definitions/ChromeThemeOverride"
8816
8945
  },
8817
8946
  {
8818
- "$ref": "#/definitions/ChromeThemeOverride"
8947
+ "type": "string"
8819
8948
  }
8820
8949
  ],
8821
8950
  "description": "Footer style override."
@@ -8995,15 +9124,31 @@
8995
9124
  {
8996
9125
  "type": "boolean"
8997
9126
  },
9127
+ {
9128
+ "$ref": "#/definitions/AnimationPreset"
9129
+ },
8998
9130
  {
8999
9131
  "$ref": "#/definitions/AnimationConfig"
9000
9132
  }
9001
9133
  ],
9002
9134
  "description": "Animation spec property.\n- true: enable entrance animation with sensible defaults\n- false/omitted: no animation (current behavior)\n- AnimationConfig: full control via enter/update/exit phases"
9003
9135
  },
9136
+ "AnimationPreset": {
9137
+ "type": "string",
9138
+ "enum": [
9139
+ "fluid",
9140
+ "subtle",
9141
+ "legacy"
9142
+ ],
9143
+ "description": "Opt-in motion language."
9144
+ },
9004
9145
  "AnimationConfig": {
9005
9146
  "type": "object",
9006
9147
  "properties": {
9148
+ "preset": {
9149
+ "$ref": "#/definitions/AnimationPreset",
9150
+ "description": "Base preset; explicit phase settings take precedence."
9151
+ },
9007
9152
  "enter": {
9008
9153
  "anyOf": [
9009
9154
  {
@@ -9048,6 +9193,10 @@
9048
9193
  "AnimationPhaseConfig": {
9049
9194
  "type": "object",
9050
9195
  "properties": {
9196
+ "spring": {
9197
+ "$ref": "#/definitions/SpringConfig",
9198
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
9199
+ },
9051
9200
  "duration": {
9052
9201
  "type": "number",
9053
9202
  "description": "Duration in ms. Default: 500 for enter."
@@ -9071,6 +9220,22 @@
9071
9220
  "additionalProperties": false,
9072
9221
  "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
9073
9222
  },
9223
+ "SpringConfig": {
9224
+ "type": "object",
9225
+ "properties": {
9226
+ "stiffness": {
9227
+ "type": "number"
9228
+ },
9229
+ "damping": {
9230
+ "type": "number"
9231
+ },
9232
+ "mass": {
9233
+ "type": "number"
9234
+ }
9235
+ },
9236
+ "additionalProperties": false,
9237
+ "description": "Physical spring parameters. Quantitative motion is bounded at critical damping."
9238
+ },
9074
9239
  "AnimationEase": {
9075
9240
  "type": "string",
9076
9241
  "enum": [
@@ -9102,6 +9267,10 @@
9102
9267
  "UpdatePhaseConfig": {
9103
9268
  "type": "object",
9104
9269
  "properties": {
9270
+ "spring": {
9271
+ "$ref": "#/definitions/SpringConfig",
9272
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
9273
+ },
9105
9274
  "duration": {
9106
9275
  "type": "number",
9107
9276
  "description": "Duration in ms. Default: 500 for enter."
@@ -11261,6 +11430,13 @@
11261
11430
  "encoding": {
11262
11431
  "description": "Encoding channel map."
11263
11432
  },
11433
+ "fields": {
11434
+ "type": "object",
11435
+ "additionalProperties": {
11436
+ "$ref": "#/definitions/FieldMetadata"
11437
+ },
11438
+ "description": "Optional authored measure, unit, provenance, and supplied interval metadata."
11439
+ },
11264
11440
  "data": {
11265
11441
  "type": "array",
11266
11442
  "items": {
@@ -11384,7 +11560,7 @@
11384
11560
  },
11385
11561
  "darkMode": {
11386
11562
  "$ref": "#/definitions/DarkMode",
11387
- "description": "Dark mode behavior. Defaults to \"off\"."
11563
+ "deprecated": "Use the mount darkMode option; the spec field has no effect."
11388
11564
  },
11389
11565
  "watermark": {
11390
11566
  "type": "boolean",
@@ -9,6 +9,22 @@
9
9
  "TableSpec": {
10
10
  "type": "object",
11
11
  "properties": {
12
+ "mobileLayout": {
13
+ "type": "string",
14
+ "enum": [
15
+ "cards",
16
+ "priority",
17
+ "scroll"
18
+ ],
19
+ "description": "Compact layout. v8 defaults to cards; priority retains comparable columns with expandable details."
20
+ },
21
+ "fields": {
22
+ "type": "object",
23
+ "additionalProperties": {
24
+ "$ref": "#/definitions/FieldMetadata"
25
+ },
26
+ "description": "Optional authored measure, unit, provenance, and supplied interval metadata."
27
+ },
12
28
  "type": {
13
29
  "type": "string",
14
30
  "const": "table",
@@ -42,7 +58,7 @@
42
58
  },
43
59
  "darkMode": {
44
60
  "$ref": "#/definitions/DarkMode",
45
- "description": "Dark mode behavior."
61
+ "deprecated": "Use the mount darkMode option; the spec field has no effect."
46
62
  },
47
63
  "watermark": {
48
64
  "type": "boolean",
@@ -126,6 +142,67 @@
126
142
  "additionalProperties": false,
127
143
  "description": "Table specification: input for data table visualizations.\n\nTables are a visualization type, not just an HTML grid. They support heatmap coloring, inline sparklines, sorted columns, search, and pagination."
128
144
  },
145
+ "FieldMetadata": {
146
+ "type": "object",
147
+ "properties": {
148
+ "type": {
149
+ "type": "string",
150
+ "enum": [
151
+ "text",
152
+ "number",
153
+ "date"
154
+ ],
155
+ "description": "Explicit imported field type; preserved with the portable document."
156
+ },
157
+ "role": {
158
+ "type": "string",
159
+ "const": "identity",
160
+ "description": "Identifies an internal, persistent row identity column."
161
+ },
162
+ "label": {
163
+ "type": "string"
164
+ },
165
+ "unit": {
166
+ "type": "string"
167
+ },
168
+ "measure": {
169
+ "type": "string"
170
+ },
171
+ "provenance": {
172
+ "type": "string"
173
+ },
174
+ "representation": {
175
+ "type": "string",
176
+ "enum": [
177
+ "number",
178
+ "percent",
179
+ "proportion"
180
+ ],
181
+ "description": "Percent is encoded 0–100; proportion is encoded 0–1."
182
+ },
183
+ "interval": {
184
+ "type": "object",
185
+ "properties": {
186
+ "lower": {
187
+ "type": "string"
188
+ },
189
+ "upper": {
190
+ "type": "string"
191
+ }
192
+ },
193
+ "required": [
194
+ "lower",
195
+ "upper"
196
+ ],
197
+ "additionalProperties": false
198
+ },
199
+ "statusField": {
200
+ "type": "string"
201
+ }
202
+ },
203
+ "additionalProperties": false,
204
+ "description": "Supplied semantics; the library never invents a measure or uncertainty."
205
+ },
129
206
  "DataRow": {
130
207
  "type": "object",
131
208
  "additionalProperties": {},
@@ -587,6 +664,34 @@
587
664
  "$ref": "#/definitions/TokenValue",
588
665
  "description": "Annotation text color. Accepts a TokenValue for light/dark pairs."
589
666
  },
667
+ "annotationLabel": {
668
+ "$ref": "#/definitions/TokenValue",
669
+ "description": "Annotation label color. Accepts a TokenValue light/dark pair."
670
+ },
671
+ "annotationMuted": {
672
+ "$ref": "#/definitions/TokenValue",
673
+ "description": "Annotation muted color. Accepts a TokenValue light/dark pair."
674
+ },
675
+ "annotationLeader": {
676
+ "$ref": "#/definitions/TokenValue",
677
+ "description": "Annotation leader color. Accepts a TokenValue light/dark pair."
678
+ },
679
+ "annotationRule": {
680
+ "$ref": "#/definitions/TokenValue",
681
+ "description": "Annotation rule color. Accepts a TokenValue light/dark pair."
682
+ },
683
+ "annotationRangeFill": {
684
+ "$ref": "#/definitions/TokenValue",
685
+ "description": "Annotation rangefill color. Accepts a TokenValue light/dark pair."
686
+ },
687
+ "annotationMarkerFill": {
688
+ "$ref": "#/definitions/TokenValue",
689
+ "description": "Annotation markerfill color. Accepts a TokenValue light/dark pair."
690
+ },
691
+ "annotationPlate": {
692
+ "$ref": "#/definitions/TokenValue",
693
+ "description": "Annotation plate color. Accepts a TokenValue light/dark pair."
694
+ },
590
695
  "positive": {
591
696
  "$ref": "#/definitions/TokenValue",
592
697
  "description": "Semantic color for positive/up-trend values. Accepts a TokenValue for light/dark pairs."
@@ -719,10 +824,10 @@
719
824
  "eyebrow": {
720
825
  "anyOf": [
721
826
  {
722
- "type": "string"
827
+ "$ref": "#/definitions/ChromeThemeOverride"
723
828
  },
724
829
  {
725
- "$ref": "#/definitions/ChromeThemeOverride"
830
+ "type": "string"
726
831
  }
727
832
  ],
728
833
  "description": "Eyebrow (kicker) style override."
@@ -730,10 +835,10 @@
730
835
  "title": {
731
836
  "anyOf": [
732
837
  {
733
- "type": "string"
838
+ "$ref": "#/definitions/ChromeThemeOverride"
734
839
  },
735
840
  {
736
- "$ref": "#/definitions/ChromeThemeOverride"
841
+ "type": "string"
737
842
  }
738
843
  ],
739
844
  "description": "Title style override."
@@ -741,10 +846,10 @@
741
846
  "subtitle": {
742
847
  "anyOf": [
743
848
  {
744
- "type": "string"
849
+ "$ref": "#/definitions/ChromeThemeOverride"
745
850
  },
746
851
  {
747
- "$ref": "#/definitions/ChromeThemeOverride"
852
+ "type": "string"
748
853
  }
749
854
  ],
750
855
  "description": "Subtitle style override."
@@ -752,10 +857,10 @@
752
857
  "source": {
753
858
  "anyOf": [
754
859
  {
755
- "type": "string"
860
+ "$ref": "#/definitions/ChromeThemeOverride"
756
861
  },
757
862
  {
758
- "$ref": "#/definitions/ChromeThemeOverride"
863
+ "type": "string"
759
864
  }
760
865
  ],
761
866
  "description": "Source/attribution style override."
@@ -763,10 +868,10 @@
763
868
  "byline": {
764
869
  "anyOf": [
765
870
  {
766
- "type": "string"
871
+ "$ref": "#/definitions/ChromeThemeOverride"
767
872
  },
768
873
  {
769
- "$ref": "#/definitions/ChromeThemeOverride"
874
+ "type": "string"
770
875
  }
771
876
  ],
772
877
  "description": "Byline style override."
@@ -774,10 +879,10 @@
774
879
  "footer": {
775
880
  "anyOf": [
776
881
  {
777
- "type": "string"
882
+ "$ref": "#/definitions/ChromeThemeOverride"
778
883
  },
779
884
  {
780
- "$ref": "#/definitions/ChromeThemeOverride"
885
+ "type": "string"
781
886
  }
782
887
  ],
783
888
  "description": "Footer style override."
@@ -919,15 +1024,31 @@
919
1024
  {
920
1025
  "type": "boolean"
921
1026
  },
1027
+ {
1028
+ "$ref": "#/definitions/AnimationPreset"
1029
+ },
922
1030
  {
923
1031
  "$ref": "#/definitions/AnimationConfig"
924
1032
  }
925
1033
  ],
926
1034
  "description": "Animation spec property.\n- true: enable entrance animation with sensible defaults\n- false/omitted: no animation (current behavior)\n- AnimationConfig: full control via enter/update/exit phases"
927
1035
  },
1036
+ "AnimationPreset": {
1037
+ "type": "string",
1038
+ "enum": [
1039
+ "fluid",
1040
+ "subtle",
1041
+ "legacy"
1042
+ ],
1043
+ "description": "Opt-in motion language."
1044
+ },
928
1045
  "AnimationConfig": {
929
1046
  "type": "object",
930
1047
  "properties": {
1048
+ "preset": {
1049
+ "$ref": "#/definitions/AnimationPreset",
1050
+ "description": "Base preset; explicit phase settings take precedence."
1051
+ },
931
1052
  "enter": {
932
1053
  "anyOf": [
933
1054
  {
@@ -972,6 +1093,10 @@
972
1093
  "AnimationPhaseConfig": {
973
1094
  "type": "object",
974
1095
  "properties": {
1096
+ "spring": {
1097
+ "$ref": "#/definitions/SpringConfig",
1098
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
1099
+ },
975
1100
  "duration": {
976
1101
  "type": "number",
977
1102
  "description": "Duration in ms. Default: 500 for enter."
@@ -995,6 +1120,22 @@
995
1120
  "additionalProperties": false,
996
1121
  "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
997
1122
  },
1123
+ "SpringConfig": {
1124
+ "type": "object",
1125
+ "properties": {
1126
+ "stiffness": {
1127
+ "type": "number"
1128
+ },
1129
+ "damping": {
1130
+ "type": "number"
1131
+ },
1132
+ "mass": {
1133
+ "type": "number"
1134
+ }
1135
+ },
1136
+ "additionalProperties": false,
1137
+ "description": "Physical spring parameters. Quantitative motion is bounded at critical damping."
1138
+ },
998
1139
  "AnimationEase": {
999
1140
  "type": "string",
1000
1141
  "enum": [
@@ -1026,6 +1167,10 @@
1026
1167
  "UpdatePhaseConfig": {
1027
1168
  "type": "object",
1028
1169
  "properties": {
1170
+ "spring": {
1171
+ "$ref": "#/definitions/SpringConfig",
1172
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
1173
+ },
1029
1174
  "duration": {
1030
1175
  "type": "number",
1031
1176
  "description": "Duration in ms. Default: 500 for enter."