@opendata-ai/openchart-core 9.0.0 → 9.2.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.
- package/dist/index.d.ts +1596 -47
- package/dist/index.js +1338 -50
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/schema/chart.schema.json +177 -16
- package/schema/table.schema.json +54 -15
- package/schema/vizspec.schema.json +1749 -55
package/schema/chart.schema.json
CHANGED
|
@@ -417,6 +417,10 @@
|
|
|
417
417
|
],
|
|
418
418
|
"description": "Corner radius for rect/bar marks. 'pill' sets rx to half the bar thickness."
|
|
419
419
|
},
|
|
420
|
+
"mirror": {
|
|
421
|
+
"type": "boolean",
|
|
422
|
+
"description": "Mirror horizontal bars around a shared center axis (a population pyramid). Only meaningful when `type` is `'bar'`; needs a color field with exactly two values, the first drawn to the left. Defaults to false."
|
|
423
|
+
},
|
|
420
424
|
"type": {
|
|
421
425
|
"type": "string",
|
|
422
426
|
"const": "bar"
|
|
@@ -5515,7 +5519,7 @@
|
|
|
5515
5519
|
"$ref": "#/definitions/AnimationConfig"
|
|
5516
5520
|
}
|
|
5517
5521
|
],
|
|
5518
|
-
"description": "Animation spec property.\n- true:
|
|
5522
|
+
"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
5523
|
},
|
|
5520
5524
|
"AnimationPreset": {
|
|
5521
5525
|
"type": "string",
|
|
@@ -5535,13 +5539,13 @@
|
|
|
5535
5539
|
"enter": {
|
|
5536
5540
|
"anyOf": [
|
|
5537
5541
|
{
|
|
5538
|
-
"$ref": "#/definitions/
|
|
5542
|
+
"$ref": "#/definitions/EnterPhaseConfig"
|
|
5539
5543
|
},
|
|
5540
5544
|
{
|
|
5541
5545
|
"type": "boolean"
|
|
5542
5546
|
}
|
|
5543
5547
|
],
|
|
5544
|
-
"description": "Entrance animation when chart first renders."
|
|
5548
|
+
"description": "Entrance animation when chart first renders (by default, once it scrolls into view)."
|
|
5545
5549
|
},
|
|
5546
5550
|
"update": {
|
|
5547
5551
|
"anyOf": [
|
|
@@ -5567,13 +5571,13 @@
|
|
|
5567
5571
|
},
|
|
5568
5572
|
"annotationDelay": {
|
|
5569
5573
|
"type": "number",
|
|
5570
|
-
"description": "
|
|
5574
|
+
"description": "Gap in ms between the last mark reaching 90% of its entrance and annotations starting. Default: 150 (0 under a preset)."
|
|
5571
5575
|
}
|
|
5572
5576
|
},
|
|
5573
5577
|
"additionalProperties": false,
|
|
5574
5578
|
"description": "Full animation config object. Structured as enter/update/exit phases following Vega's encoding set model."
|
|
5575
5579
|
},
|
|
5576
|
-
"
|
|
5580
|
+
"EnterPhaseConfig": {
|
|
5577
5581
|
"type": "object",
|
|
5578
5582
|
"properties": {
|
|
5579
5583
|
"spring": {
|
|
@@ -5582,11 +5586,11 @@
|
|
|
5582
5586
|
},
|
|
5583
5587
|
"duration": {
|
|
5584
5588
|
"type": "number",
|
|
5585
|
-
"description": "Duration in ms. Default: 500 for
|
|
5589
|
+
"description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
|
|
5586
5590
|
},
|
|
5587
5591
|
"ease": {
|
|
5588
5592
|
"$ref": "#/definitions/AnimationEase",
|
|
5589
|
-
"description": "Easing preset. Default: 'smooth'."
|
|
5593
|
+
"description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
|
|
5590
5594
|
},
|
|
5591
5595
|
"stagger": {
|
|
5592
5596
|
"anyOf": [
|
|
@@ -5598,10 +5602,18 @@
|
|
|
5598
5602
|
}
|
|
5599
5603
|
],
|
|
5600
5604
|
"description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
|
|
5605
|
+
},
|
|
5606
|
+
"trigger": {
|
|
5607
|
+
"type": "string",
|
|
5608
|
+
"enum": [
|
|
5609
|
+
"visible",
|
|
5610
|
+
"mount"
|
|
5611
|
+
],
|
|
5612
|
+
"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
5613
|
}
|
|
5602
5614
|
},
|
|
5603
5615
|
"additionalProperties": false,
|
|
5604
|
-
"description": "
|
|
5616
|
+
"description": "Entrance phase config. Adds `trigger` on top of the shared phase options."
|
|
5605
5617
|
},
|
|
5606
5618
|
"SpringConfig": {
|
|
5607
5619
|
"type": "object",
|
|
@@ -5623,16 +5635,17 @@
|
|
|
5623
5635
|
"type": "string",
|
|
5624
5636
|
"enum": [
|
|
5625
5637
|
"smooth",
|
|
5626
|
-
"snappy"
|
|
5638
|
+
"snappy",
|
|
5639
|
+
"gentle"
|
|
5627
5640
|
],
|
|
5628
|
-
"description": "Named easing presets for entrance animations. Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention."
|
|
5641
|
+
"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
5642
|
},
|
|
5630
5643
|
"AnimationStagger": {
|
|
5631
5644
|
"type": "object",
|
|
5632
5645
|
"properties": {
|
|
5633
5646
|
"delay": {
|
|
5634
5647
|
"type": "number",
|
|
5635
|
-
"description": "
|
|
5648
|
+
"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
5649
|
},
|
|
5637
5650
|
"order": {
|
|
5638
5651
|
"type": "string",
|
|
@@ -5656,11 +5669,11 @@
|
|
|
5656
5669
|
},
|
|
5657
5670
|
"duration": {
|
|
5658
5671
|
"type": "number",
|
|
5659
|
-
"description": "Duration in ms. Default: 500 for
|
|
5672
|
+
"description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
|
|
5660
5673
|
},
|
|
5661
5674
|
"ease": {
|
|
5662
5675
|
"$ref": "#/definitions/AnimationEase",
|
|
5663
|
-
"description": "Easing preset. Default: 'smooth'."
|
|
5676
|
+
"description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
|
|
5664
5677
|
},
|
|
5665
5678
|
"stagger": {
|
|
5666
5679
|
"anyOf": [
|
|
@@ -5675,19 +5688,49 @@
|
|
|
5675
5688
|
},
|
|
5676
5689
|
"maxMarks": {
|
|
5677
5690
|
"type": "number",
|
|
5678
|
-
"description": "Maximum mark count that still runs a tweened data-update transition.
|
|
5691
|
+
"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
5692
|
}
|
|
5680
5693
|
},
|
|
5681
5694
|
"additionalProperties": false,
|
|
5682
5695
|
"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
5696
|
},
|
|
5697
|
+
"AnimationPhaseConfig": {
|
|
5698
|
+
"type": "object",
|
|
5699
|
+
"properties": {
|
|
5700
|
+
"spring": {
|
|
5701
|
+
"$ref": "#/definitions/SpringConfig",
|
|
5702
|
+
"description": "Spring mode. Cannot be combined with duration or ease in this phase."
|
|
5703
|
+
},
|
|
5704
|
+
"duration": {
|
|
5705
|
+
"type": "number",
|
|
5706
|
+
"description": "Duration in ms. Default: 800 for enter, 500 for update, 120 for exit."
|
|
5707
|
+
},
|
|
5708
|
+
"ease": {
|
|
5709
|
+
"$ref": "#/definitions/AnimationEase",
|
|
5710
|
+
"description": "Easing preset. Default: 'smooth' ('gentle' for exit)."
|
|
5711
|
+
},
|
|
5712
|
+
"stagger": {
|
|
5713
|
+
"anyOf": [
|
|
5714
|
+
{
|
|
5715
|
+
"$ref": "#/definitions/AnimationStagger"
|
|
5716
|
+
},
|
|
5717
|
+
{
|
|
5718
|
+
"type": "boolean"
|
|
5719
|
+
}
|
|
5720
|
+
],
|
|
5721
|
+
"description": "Stagger config. true = defaults, false = no stagger. Default: true for enter."
|
|
5722
|
+
}
|
|
5723
|
+
},
|
|
5724
|
+
"additionalProperties": false,
|
|
5725
|
+
"description": "Animation phase config. Follows Vega's enter/update/exit model. Each phase can be true (use defaults) or a config object."
|
|
5726
|
+
},
|
|
5684
5727
|
"Display": {
|
|
5685
5728
|
"type": "string",
|
|
5686
5729
|
"enum": [
|
|
5687
5730
|
"full",
|
|
5688
5731
|
"sparkline"
|
|
5689
5732
|
],
|
|
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,
|
|
5733
|
+
"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
5734
|
},
|
|
5692
5735
|
"SeriesSearchConfig": {
|
|
5693
5736
|
"type": "object",
|
|
@@ -5809,6 +5852,108 @@
|
|
|
5809
5852
|
],
|
|
5810
5853
|
"description": "Resolution strategy for shared resources across layers. 'shared' (default): union domains, single axis/legend. 'independent': each layer gets its own scale/axis/legend."
|
|
5811
5854
|
},
|
|
5855
|
+
"PlaybackConfig": {
|
|
5856
|
+
"type": "object",
|
|
5857
|
+
"properties": {
|
|
5858
|
+
"duration": {
|
|
5859
|
+
"type": "number",
|
|
5860
|
+
"description": "Total playback duration in milliseconds at 1× speed. Defaults to 700ms per period, clamped to 8000–90000ms. Mutually exclusive with `step`."
|
|
5861
|
+
},
|
|
5862
|
+
"step": {
|
|
5863
|
+
"type": "number",
|
|
5864
|
+
"description": "Duration per period in milliseconds. Omitted by default and mutually exclusive with `duration`."
|
|
5865
|
+
},
|
|
5866
|
+
"gaps": {
|
|
5867
|
+
"type": "string",
|
|
5868
|
+
"enum": [
|
|
5869
|
+
"interpolate",
|
|
5870
|
+
"hold",
|
|
5871
|
+
"drop"
|
|
5872
|
+
],
|
|
5873
|
+
"description": "Interior gap policy. Defaults to `interpolate`. Use `hold` to carry the previous value or `drop` to leave the value absent."
|
|
5874
|
+
},
|
|
5875
|
+
"holdEnd": {
|
|
5876
|
+
"type": "number",
|
|
5877
|
+
"description": "Time to dwell on the final frame in milliseconds. Defaults to 1500."
|
|
5878
|
+
},
|
|
5879
|
+
"loop": {
|
|
5880
|
+
"type": "boolean",
|
|
5881
|
+
"description": "Restart after the final hold. Defaults to false."
|
|
5882
|
+
},
|
|
5883
|
+
"autoplay": {
|
|
5884
|
+
"anyOf": [
|
|
5885
|
+
{
|
|
5886
|
+
"type": "string",
|
|
5887
|
+
"const": "visible"
|
|
5888
|
+
},
|
|
5889
|
+
{
|
|
5890
|
+
"type": "boolean"
|
|
5891
|
+
}
|
|
5892
|
+
],
|
|
5893
|
+
"description": "Start when 25% visible (`visible`, the default), immediately (`true`), or on demand (`false`). Reduced motion disables autoplay."
|
|
5894
|
+
},
|
|
5895
|
+
"controls": {
|
|
5896
|
+
"type": "boolean",
|
|
5897
|
+
"description": "Show play/pause, scrubber, and period readout. Defaults to true."
|
|
5898
|
+
},
|
|
5899
|
+
"period": {
|
|
5900
|
+
"anyOf": [
|
|
5901
|
+
{
|
|
5902
|
+
"type": "boolean",
|
|
5903
|
+
"const": false
|
|
5904
|
+
},
|
|
5905
|
+
{
|
|
5906
|
+
"type": "object",
|
|
5907
|
+
"properties": {
|
|
5908
|
+
"format": {
|
|
5909
|
+
"type": "string",
|
|
5910
|
+
"description": "Overrides the time channel's format."
|
|
5911
|
+
},
|
|
5912
|
+
"position": {
|
|
5913
|
+
"$ref": "#/definitions/PlaybackPeriodPosition",
|
|
5914
|
+
"description": "Where the label sits. Defaults to `auto`: centered for point charts, upper right for bars, and the corner that covers the least geography on maps."
|
|
5915
|
+
}
|
|
5916
|
+
},
|
|
5917
|
+
"additionalProperties": false
|
|
5918
|
+
}
|
|
5919
|
+
],
|
|
5920
|
+
"description": "Large period label. On by default with automatic placement and the time channel's format. Set false to hide it."
|
|
5921
|
+
},
|
|
5922
|
+
"labels": {
|
|
5923
|
+
"type": "array",
|
|
5924
|
+
"items": {
|
|
5925
|
+
"type": "string"
|
|
5926
|
+
},
|
|
5927
|
+
"description": "Point marks only: keys whose name is drawn next to the mark for the whole run."
|
|
5928
|
+
},
|
|
5929
|
+
"trails": {
|
|
5930
|
+
"anyOf": [
|
|
5931
|
+
{
|
|
5932
|
+
"type": "boolean"
|
|
5933
|
+
},
|
|
5934
|
+
{
|
|
5935
|
+
"type": "array",
|
|
5936
|
+
"items": {
|
|
5937
|
+
"type": "string"
|
|
5938
|
+
}
|
|
5939
|
+
}
|
|
5940
|
+
],
|
|
5941
|
+
"description": "Point marks only: draw past positions as a trail. `true` is every key; an array names keys. Defaults to false."
|
|
5942
|
+
}
|
|
5943
|
+
},
|
|
5944
|
+
"additionalProperties": false,
|
|
5945
|
+
"description": "Playback options for charts and maps with a `time` channel. Fields shared with the race's `race` block have the same names, types and defaults."
|
|
5946
|
+
},
|
|
5947
|
+
"PlaybackPeriodPosition": {
|
|
5948
|
+
"type": "string",
|
|
5949
|
+
"enum": [
|
|
5950
|
+
"auto",
|
|
5951
|
+
"center",
|
|
5952
|
+
"top-right",
|
|
5953
|
+
"bottom-left"
|
|
5954
|
+
],
|
|
5955
|
+
"description": "Placement of the large faint period label behind a playback chart."
|
|
5956
|
+
},
|
|
5812
5957
|
"ArcEncoding<DataRow>": {
|
|
5813
5958
|
"type": "object",
|
|
5814
5959
|
"properties": {
|
|
@@ -6166,6 +6311,10 @@
|
|
|
6166
6311
|
"column": {
|
|
6167
6312
|
"$ref": "#/definitions/FacetChannel%3CDataRow%3E",
|
|
6168
6313
|
"description": "Column facet channel: partitions data into side-by-side panels. Each unique value of the column field produces one panel, arranged in a single row. Shares the y-axis scale by default; x-axis is independent. Mutually exclusive with `facet` and `row`."
|
|
6314
|
+
},
|
|
6315
|
+
"time": {
|
|
6316
|
+
"$ref": "#/definitions/EncodingChannel%3CDataRow%3E",
|
|
6317
|
+
"description": "Playback field. Each distinct value is one period, and the chart animates through them with the shared `playback` controls. Temporal and quantitative periods sort by value; ordinal periods follow `sort` or first-seen order."
|
|
6169
6318
|
}
|
|
6170
6319
|
},
|
|
6171
6320
|
"required": [
|
|
@@ -6435,6 +6584,10 @@
|
|
|
6435
6584
|
"column": {
|
|
6436
6585
|
"$ref": "#/definitions/FacetChannel%3CDataRow%3E",
|
|
6437
6586
|
"description": "Column facet channel: partitions data into side-by-side panels. Each unique value of the column field produces one panel, arranged in a single row. Shares the y-axis scale by default; x-axis is independent. Mutually exclusive with `facet` and `row`."
|
|
6587
|
+
},
|
|
6588
|
+
"time": {
|
|
6589
|
+
"$ref": "#/definitions/EncodingChannel%3CDataRow%3E",
|
|
6590
|
+
"description": "Playback field. Each distinct value is one period, and the chart animates through them with the shared `playback` controls. Temporal and quantitative periods sort by value; ordinal periods follow `sort` or first-seen order."
|
|
6438
6591
|
}
|
|
6439
6592
|
},
|
|
6440
6593
|
"required": [
|
|
@@ -6558,6 +6711,10 @@
|
|
|
6558
6711
|
"column": {
|
|
6559
6712
|
"$ref": "#/definitions/FacetChannel%3CDataRow%3E",
|
|
6560
6713
|
"description": "Column facet channel: partitions data into side-by-side panels. Each unique value of the column field produces one panel, arranged in a single row. Shares the y-axis scale by default; x-axis is independent. Mutually exclusive with `facet` and `row`."
|
|
6714
|
+
},
|
|
6715
|
+
"time": {
|
|
6716
|
+
"$ref": "#/definitions/EncodingChannel%3CDataRow%3E",
|
|
6717
|
+
"description": "Playback field. Each distinct value is one period, and the chart animates through them with the shared `playback` controls. Temporal and quantitative periods sort by value; ordinal periods follow `sort` or first-seen order."
|
|
6561
6718
|
}
|
|
6562
6719
|
},
|
|
6563
6720
|
"required": [
|
|
@@ -8190,7 +8347,7 @@
|
|
|
8190
8347
|
},
|
|
8191
8348
|
"animation": {
|
|
8192
8349
|
"$ref": "#/definitions/AnimationSpec",
|
|
8193
|
-
"description": "
|
|
8350
|
+
"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
8351
|
},
|
|
8195
8352
|
"crosshair": {
|
|
8196
8353
|
"type": "boolean",
|
|
@@ -8222,6 +8379,10 @@
|
|
|
8222
8379
|
"zIndex": {
|
|
8223
8380
|
"type": "number",
|
|
8224
8381
|
"description": "Render order within a LayerSpec. Higher values render on top. When omitted, layers render in array order (later layers paint on top). Axis assignment (left/right y) is always determined by array position, not zIndex."
|
|
8382
|
+
},
|
|
8383
|
+
"playback": {
|
|
8384
|
+
"$ref": "#/definitions/PlaybackConfig",
|
|
8385
|
+
"description": "Playback timing, controls and period label for a chart with `encoding.time` (point, circle and bar marks). Ignored with a warning when the chart has no time channel."
|
|
8225
8386
|
}
|
|
8226
8387
|
}
|
|
8227
8388
|
}
|
package/schema/table.schema.json
CHANGED
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
"animation": {
|
|
125
125
|
"$ref": "#/definitions/AnimationSpec",
|
|
126
|
-
"description": "
|
|
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:
|
|
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/
|
|
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": "
|
|
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
|
-
"
|
|
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
|
|
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": "
|
|
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": "
|
|
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
|
|
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.
|
|
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
|
}
|