@opendata-ai/openchart-core 9.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5515,7 +5515,7 @@
5515
5515
  "$ref": "#/definitions/AnimationConfig"
5516
5516
  }
5517
5517
  ],
5518
- "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"
5518
+ "description": "Animation spec property.\n- omitted or true: every phase (enter, update, exit) with its defaults\n- false: all motion off\n- preset name: that motion language across every phase\n- AnimationConfig: full control via enter/update/exit phases"
5519
5519
  },
5520
5520
  "AnimationPreset": {
5521
5521
  "type": "string",
@@ -5535,13 +5535,13 @@
5535
5535
  "enter": {
5536
5536
  "anyOf": [
5537
5537
  {
5538
- "$ref": "#/definitions/AnimationPhaseConfig"
5538
+ "$ref": "#/definitions/EnterPhaseConfig"
5539
5539
  },
5540
5540
  {
5541
5541
  "type": "boolean"
5542
5542
  }
5543
5543
  ],
5544
- "description": "Entrance animation when chart first renders."
5544
+ "description": "Entrance animation when chart first renders (by default, once it scrolls into view)."
5545
5545
  },
5546
5546
  "update": {
5547
5547
  "anyOf": [
@@ -5567,13 +5567,13 @@
5567
5567
  },
5568
5568
  "annotationDelay": {
5569
5569
  "type": "number",
5570
- "description": "Delay before annotations animate in (ms after marks). Default: 200."
5570
+ "description": "Gap in ms between the last mark reaching 90% of its entrance and annotations starting. Default: 150 (0 under a preset)."
5571
5571
  }
5572
5572
  },
5573
5573
  "additionalProperties": false,
5574
5574
  "description": "Full animation config object. Structured as enter/update/exit phases following Vega's encoding set model."
5575
5575
  },
5576
- "AnimationPhaseConfig": {
5576
+ "EnterPhaseConfig": {
5577
5577
  "type": "object",
5578
5578
  "properties": {
5579
5579
  "spring": {
@@ -5582,11 +5582,11 @@
5582
5582
  },
5583
5583
  "duration": {
5584
5584
  "type": "number",
5585
- "description": "Duration in ms. Default: 500 for enter."
5585
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
5586
5586
  },
5587
5587
  "ease": {
5588
5588
  "$ref": "#/definitions/AnimationEase",
5589
- "description": "Easing preset. Default: 'smooth'."
5589
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
5590
5590
  },
5591
5591
  "stagger": {
5592
5592
  "anyOf": [
@@ -5598,10 +5598,18 @@
5598
5598
  }
5599
5599
  ],
5600
5600
  "description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
5601
+ },
5602
+ "trigger": {
5603
+ "type": "string",
5604
+ "enum": [
5605
+ "visible",
5606
+ "mount"
5607
+ ],
5608
+ "description": "When the entrance starts. Default: 'visible'.\n- `visible`: hold the from-state until at least 25% of the chart (or 25% of the viewport's height, for a chart taller than the viewport) is on screen, then play. A chart already in view at mount plays at once.\n- `mount`: play as soon as the chart mounts, scrolled into view or not.\n\nIgnored by export and server-side rendering, which never animate."
5601
5609
  }
5602
5610
  },
5603
5611
  "additionalProperties": false,
5604
- "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
5612
+ "description": "Entrance phase config. Adds `trigger` on top of the shared phase options."
5605
5613
  },
5606
5614
  "SpringConfig": {
5607
5615
  "type": "object",
@@ -5623,16 +5631,17 @@
5623
5631
  "type": "string",
5624
5632
  "enum": [
5625
5633
  "smooth",
5626
- "snappy"
5634
+ "snappy",
5635
+ "gentle"
5627
5636
  ],
5628
- "description": "Named easing presets for entrance animations. Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention."
5637
+ "description": "Named easing presets for entrance animations. Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention.\n- `smooth` (default): soft ease-out with a gentle start that settles late, no overshoot.\n- `snappy`: a fast attack, settling by about half the duration.\n- `gentle`: the previous default, a slower ease-out."
5629
5638
  },
5630
5639
  "AnimationStagger": {
5631
5640
  "type": "object",
5632
5641
  "properties": {
5633
5642
  "delay": {
5634
5643
  "type": "number",
5635
- "description": "Delay between each element in ms. Default: 80"
5644
+ "description": "Gap between consecutive elements in ms. Default: 80. A ceiling: the whole stagger spans at most 450ms, so n elements land min(delay, 450 / (n - 1)) apart."
5636
5645
  },
5637
5646
  "order": {
5638
5647
  "type": "string",
@@ -5656,11 +5665,11 @@
5656
5665
  },
5657
5666
  "duration": {
5658
5667
  "type": "number",
5659
- "description": "Duration in ms. Default: 500 for enter."
5668
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
5660
5669
  },
5661
5670
  "ease": {
5662
5671
  "$ref": "#/definitions/AnimationEase",
5663
- "description": "Easing preset. Default: 'smooth'."
5672
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
5664
5673
  },
5665
5674
  "stagger": {
5666
5675
  "anyOf": [
@@ -5675,19 +5684,49 @@
5675
5684
  },
5676
5685
  "maxMarks": {
5677
5686
  "type": "number",
5678
- "description": "Maximum mark count that still runs a tweened data-update transition. Default: 500. Above the cap the chart swaps instantly instead, because per-frame SVG attribute writes on thousands of elements drop frames on low-end devices. Raise it deliberately when the audience is desktop-heavy and you have measured the frame budget."
5687
+ "description": "Maximum mark count that still runs a tweened data-update transition. Charts default to 500 (20000 in canvas mark mode); bar lists, tile maps, sankeys and maps have no cap unless you set one; tables ignore it. Above the cap the visualization swaps instantly instead, because per-frame SVG attribute writes on thousands of elements drop frames on low-end devices. Raise it deliberately when the audience is desktop-heavy and you have measured the frame budget."
5679
5688
  }
5680
5689
  },
5681
5690
  "additionalProperties": false,
5682
5691
  "description": "Data-update phase config. Adds `maxMarks` on top of the shared phase options; the cap is meaningless for enter/exit, which animate via CSS."
5683
5692
  },
5693
+ "AnimationPhaseConfig": {
5694
+ "type": "object",
5695
+ "properties": {
5696
+ "spring": {
5697
+ "$ref": "#/definitions/SpringConfig",
5698
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
5699
+ },
5700
+ "duration": {
5701
+ "type": "number",
5702
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
5703
+ },
5704
+ "ease": {
5705
+ "$ref": "#/definitions/AnimationEase",
5706
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
5707
+ },
5708
+ "stagger": {
5709
+ "anyOf": [
5710
+ {
5711
+ "$ref": "#/definitions/AnimationStagger"
5712
+ },
5713
+ {
5714
+ "type": "boolean"
5715
+ }
5716
+ ],
5717
+ "description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
5718
+ }
5719
+ },
5720
+ "additionalProperties": false,
5721
+ "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
5722
+ },
5684
5723
  "Display": {
5685
5724
  "type": "string",
5686
5725
  "enum": [
5687
5726
  "full",
5688
5727
  "sparkline"
5689
5728
  ],
5690
- "description": "Chart display mode.\n- `'full'` (default): standard chart with chrome, axes, legend, padding.\n- `'sparkline'`: minimal inline mini-chart. Strips chrome, axes, legend, watermark, animation, and reduces margins to a tiny safety pad. The mark fills the container edge-to-edge. Best with `mark: 'line' | 'area' | 'bar'`. Explicit user fields (chrome, legend, encoding.x.axis, etc.) still render when set, so users can opt in to specific elements."
5729
+ "description": "Chart display mode.\n- `'full'` (default): standard chart with chrome, axes, legend, padding.\n- `'sparkline'`: minimal inline mini-chart. Strips chrome, axes, legend, watermark, and reduces margins to a tiny safety pad. The mark fills the container edge-to-edge. Best with `mark: 'line' | 'area' | 'bar'`. Explicit user fields (chrome, legend, encoding.x.axis, etc.) still render when set, so users can opt in to specific elements."
5691
5730
  },
5692
5731
  "SeriesSearchConfig": {
5693
5732
  "type": "object",
@@ -8190,7 +8229,7 @@
8190
8229
  },
8191
8230
  "animation": {
8192
8231
  "$ref": "#/definitions/AnimationSpec",
8193
- "description": "Animation configuration.\n- true: enable entrance animation with sensible defaults\n- false/omitted: no animation (current behavior)\n- AnimationConfig: full control via enter/update/exit phases"
8232
+ "description": "Motion. On by default: the entrance plays once the visualization scrolls into view, and data updates animate. Set false to turn all motion off, or pass an object to configure each phase. Static rendering and exports never animate, and prefers-reduced-motion always wins."
8194
8233
  },
8195
8234
  "crosshair": {
8196
8235
  "type": "boolean",
@@ -123,7 +123,7 @@
123
123
  },
124
124
  "animation": {
125
125
  "$ref": "#/definitions/AnimationSpec",
126
- "description": "Animation configuration for entrance animations."
126
+ "description": "Motion. On by default: the entrance plays once the visualization scrolls into view, and data updates animate. Set false to turn all motion off, or pass an object to configure each phase. Static rendering and exports never animate, and prefers-reduced-motion always wins. Tables animate their entrance only; updates re-render instantly."
127
127
  }
128
128
  },
129
129
  "required": [
@@ -1007,7 +1007,7 @@
1007
1007
  "$ref": "#/definitions/AnimationConfig"
1008
1008
  }
1009
1009
  ],
1010
- "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"
1010
+ "description": "Animation spec property.\n- omitted or true: every phase (enter, update, exit) with its defaults\n- false: all motion off\n- preset name: that motion language across every phase\n- AnimationConfig: full control via enter/update/exit phases"
1011
1011
  },
1012
1012
  "AnimationPreset": {
1013
1013
  "type": "string",
@@ -1027,13 +1027,13 @@
1027
1027
  "enter": {
1028
1028
  "anyOf": [
1029
1029
  {
1030
- "$ref": "#/definitions/AnimationPhaseConfig"
1030
+ "$ref": "#/definitions/EnterPhaseConfig"
1031
1031
  },
1032
1032
  {
1033
1033
  "type": "boolean"
1034
1034
  }
1035
1035
  ],
1036
- "description": "Entrance animation when chart first renders."
1036
+ "description": "Entrance animation when chart first renders (by default, once it scrolls into view)."
1037
1037
  },
1038
1038
  "update": {
1039
1039
  "anyOf": [
@@ -1059,13 +1059,13 @@
1059
1059
  },
1060
1060
  "annotationDelay": {
1061
1061
  "type": "number",
1062
- "description": "Delay before annotations animate in (ms after marks). Default: 200."
1062
+ "description": "Gap in ms between the last mark reaching 90% of its entrance and annotations starting. Default: 150 (0 under a preset)."
1063
1063
  }
1064
1064
  },
1065
1065
  "additionalProperties": false,
1066
1066
  "description": "Full animation config object. Structured as enter/update/exit phases following Vega's encoding set model."
1067
1067
  },
1068
- "AnimationPhaseConfig": {
1068
+ "EnterPhaseConfig": {
1069
1069
  "type": "object",
1070
1070
  "properties": {
1071
1071
  "spring": {
@@ -1074,11 +1074,11 @@
1074
1074
  },
1075
1075
  "duration": {
1076
1076
  "type": "number",
1077
- "description": "Duration in ms. Default: 500 for enter."
1077
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
1078
1078
  },
1079
1079
  "ease": {
1080
1080
  "$ref": "#/definitions/AnimationEase",
1081
- "description": "Easing preset. Default: 'smooth'."
1081
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
1082
1082
  },
1083
1083
  "stagger": {
1084
1084
  "anyOf": [
@@ -1090,10 +1090,18 @@
1090
1090
  }
1091
1091
  ],
1092
1092
  "description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
1093
+ },
1094
+ "trigger": {
1095
+ "type": "string",
1096
+ "enum": [
1097
+ "visible",
1098
+ "mount"
1099
+ ],
1100
+ "description": "When the entrance starts. Default: 'visible'.\n- `visible`: hold the from-state until at least 25% of the chart (or 25% of the viewport's height, for a chart taller than the viewport) is on screen, then play. A chart already in view at mount plays at once.\n- `mount`: play as soon as the chart mounts, scrolled into view or not.\n\nIgnored by export and server-side rendering, which never animate."
1093
1101
  }
1094
1102
  },
1095
1103
  "additionalProperties": false,
1096
- "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
1104
+ "description": "Entrance phase config. Adds `trigger` on top of the shared phase options."
1097
1105
  },
1098
1106
  "SpringConfig": {
1099
1107
  "type": "object",
@@ -1115,16 +1123,17 @@
1115
1123
  "type": "string",
1116
1124
  "enum": [
1117
1125
  "smooth",
1118
- "snappy"
1126
+ "snappy",
1127
+ "gentle"
1119
1128
  ],
1120
- "description": "Named easing presets for entrance animations. Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention."
1129
+ "description": "Named easing presets for entrance animations. Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention.\n- `smooth` (default): soft ease-out with a gentle start that settles late, no overshoot.\n- `snappy`: a fast attack, settling by about half the duration.\n- `gentle`: the previous default, a slower ease-out."
1121
1130
  },
1122
1131
  "AnimationStagger": {
1123
1132
  "type": "object",
1124
1133
  "properties": {
1125
1134
  "delay": {
1126
1135
  "type": "number",
1127
- "description": "Delay between each element in ms. Default: 80"
1136
+ "description": "Gap between consecutive elements in ms. Default: 80. A ceiling: the whole stagger spans at most 450ms, so n elements land min(delay, 450 / (n - 1)) apart."
1128
1137
  },
1129
1138
  "order": {
1130
1139
  "type": "string",
@@ -1148,11 +1157,11 @@
1148
1157
  },
1149
1158
  "duration": {
1150
1159
  "type": "number",
1151
- "description": "Duration in ms. Default: 500 for enter."
1160
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
1152
1161
  },
1153
1162
  "ease": {
1154
1163
  "$ref": "#/definitions/AnimationEase",
1155
- "description": "Easing preset. Default: 'smooth'."
1164
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
1156
1165
  },
1157
1166
  "stagger": {
1158
1167
  "anyOf": [
@@ -1167,11 +1176,41 @@
1167
1176
  },
1168
1177
  "maxMarks": {
1169
1178
  "type": "number",
1170
- "description": "Maximum mark count that still runs a tweened data-update transition. Default: 500. Above the cap the chart swaps instantly instead, because per-frame SVG attribute writes on thousands of elements drop frames on low-end devices. Raise it deliberately when the audience is desktop-heavy and you have measured the frame budget."
1179
+ "description": "Maximum mark count that still runs a tweened data-update transition. Charts default to 500 (20000 in canvas mark mode); bar lists, tile maps, sankeys and maps have no cap unless you set one; tables ignore it. Above the cap the visualization swaps instantly instead, because per-frame SVG attribute writes on thousands of elements drop frames on low-end devices. Raise it deliberately when the audience is desktop-heavy and you have measured the frame budget."
1171
1180
  }
1172
1181
  },
1173
1182
  "additionalProperties": false,
1174
1183
  "description": "Data-update phase config. Adds `maxMarks` on top of the shared phase options; the cap is meaningless for enter/exit, which animate via CSS."
1184
+ },
1185
+ "AnimationPhaseConfig": {
1186
+ "type": "object",
1187
+ "properties": {
1188
+ "spring": {
1189
+ "$ref": "#/definitions/SpringConfig",
1190
+ "description": "Spring mode. Cannot be combined with duration or ease in this phase."
1191
+ },
1192
+ "duration": {
1193
+ "type": "number",
1194
+ "description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
1195
+ },
1196
+ "ease": {
1197
+ "$ref": "#/definitions/AnimationEase",
1198
+ "description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
1199
+ },
1200
+ "stagger": {
1201
+ "anyOf": [
1202
+ {
1203
+ "$ref": "#/definitions/AnimationStagger"
1204
+ },
1205
+ {
1206
+ "type": "boolean"
1207
+ }
1208
+ ],
1209
+ "description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
1210
+ }
1211
+ },
1212
+ "additionalProperties": false,
1213
+ "description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
1175
1214
  }
1176
1215
  }
1177
1216
  }