@opendata-ai/openchart-core 9.0.0-rc.2 → 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.
@@ -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": [
@@ -597,14 +597,14 @@
597
597
  "categorical": {
598
598
  "type": "array",
599
599
  "items": {
600
- "type": "string"
600
+ "$ref": "#/definitions/TokenValue"
601
601
  },
602
- "description": "Categorical stroke palette for nominal data (array of CSS color strings)."
602
+ "description": "Categorical stroke palette: CSS colors or explicit light/dark pairs."
603
603
  },
604
604
  "categoricalFill": {
605
605
  "type": "array",
606
606
  "items": {
607
- "type": "string"
607
+ "$ref": "#/definitions/TokenValue"
608
608
  },
609
609
  "description": "Categorical palette for area-filling marks (bar, area, arc, waffle, calendar, rect). Defaults to `categorical` when only that is set."
610
610
  },
@@ -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
  }