@opendata-ai/openchart-core 6.27.0 → 6.27.2
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 +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types/events.ts +5 -0
- package/src/types/spec.ts +9 -1
package/package.json
CHANGED
package/src/types/events.ts
CHANGED
|
@@ -64,6 +64,11 @@ export const elementRef = {
|
|
|
64
64
|
* Fired by the `onEdit` callback when any editable chart element is modified.
|
|
65
65
|
* Covers repositioning (drag), deletion (Delete key), and text editing (double-click).
|
|
66
66
|
* Selection events (onSelect/onDeselect) are separate callbacks, not part of this union.
|
|
67
|
+
*
|
|
68
|
+
* For the `annotation` variant:
|
|
69
|
+
* - `annotation` is the ORIGINAL spec annotation (may have a stale or missing offset)
|
|
70
|
+
* - `offset` is the NEW accumulated position after the drag completes
|
|
71
|
+
* - To persist a drag edit back into your spec: `{ ...edit.annotation, offset: edit.offset }`
|
|
67
72
|
*/
|
|
68
73
|
export type ElementEdit =
|
|
69
74
|
| { type: 'annotation'; annotation: TextAnnotation; offset: AnnotationOffset }
|
package/src/types/spec.ts
CHANGED
|
@@ -321,7 +321,15 @@ export interface EncodingChannel {
|
|
|
321
321
|
* - undefined | true | 'zero': stack from zero baseline (default)
|
|
322
322
|
* - 'normalize': stack and normalize to fraction of total (0-1 per category)
|
|
323
323
|
* - 'center': center stacks around zero (streamgraph style)
|
|
324
|
-
* - null | false: no stacking
|
|
324
|
+
* - null | false: no stacking -- renders grouped (side-by-side) bars instead
|
|
325
|
+
*
|
|
326
|
+
* Use `stack: null` to get grouped/dodged bars. This is the idiomatic way to
|
|
327
|
+
* compare values across categories side-by-side rather than stacked on top of
|
|
328
|
+
* each other. Without it, multi-series bar data stacks by default.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* // Side-by-side grouped bars (comparing 2018 vs 2022 wages by firm size):
|
|
332
|
+
* "x": { "field": "pay", "type": "quantitative", "stack": null }
|
|
325
333
|
*/
|
|
326
334
|
stack?: boolean | 'zero' | 'normalize' | 'center' | null;
|
|
327
335
|
/**
|