@graphysdk/viz-engine 0.0.1-experimental.2 → 0.0.1-experimental.4

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 CHANGED
@@ -110,6 +110,29 @@ declare interface AnnotationDataPoint {
110
110
  rowValue?: DataValue;
111
111
  }
112
112
 
113
+ /**
114
+ * Attach annotations to a spec. Multiple `annotations(...)` items append within
115
+ * each group (like `geom` layers and `highlight`s), they don't replace.
116
+ *
117
+ * @example
118
+ * pipe(
119
+ * createSpec({ x: 'quarter', y: 'revenue' }),
120
+ * geom.bar(),
121
+ * scale.x(),
122
+ * scale.y(),
123
+ * annotations({
124
+ * differenceArrows: [
125
+ * {
126
+ * start: { anchorValue: 'Q1', groupValue: null },
127
+ * end: { anchorValue: 'Q3', groupValue: null },
128
+ * label: 'relative-difference',
129
+ * },
130
+ * ],
131
+ * }),
132
+ * );
133
+ */
134
+ export declare const annotations: (input: AnnotationsInput) => AnnotationsItem;
135
+
113
136
  /**
114
137
  * Compiles annotations into a render-ready format.
115
138
  *
@@ -143,6 +166,12 @@ export declare interface AnnotationsInput {
143
166
  comments?: CommentAnnotationInput[];
144
167
  }
145
168
 
169
+ /** Annotations as a pipeable spec item. Produced by {@link annotations}. */
170
+ export declare interface AnnotationsItem {
171
+ type: 'annotations';
172
+ annotations: AnnotationsInput;
173
+ }
174
+
146
175
  /** Resolved annotations for a chart, with every group present and all fields defaulted. */
147
176
  export declare interface AnnotationsSpec {
148
177
  differenceArrows: DifferenceArrowSpec[];
@@ -4309,10 +4338,12 @@ declare class LayerValidator {
4309
4338
  }
4310
4339
 
4311
4340
  /**
4312
- * Outer padding around the whole chart, in pixels. Already baked into every {@link GraphLayout} rect
4313
- * (rects start at this inset), so don't re-add it when painting it is exported only so callers can
4314
- * reconcile against the container edge. The per-region gaps below are intentionally internal; trust the
4315
- * returned rects rather than reproducing the spacing.
4341
+ * Default outer padding around the whole chart, in pixels. Used when {@link buildLayoutGrid} is called
4342
+ * without an explicit `padding` (the renderer threads a resolved theme token in to override it). Once
4343
+ * resolved it is baked into every {@link GraphLayout} rect (rects start at this inset), so don't re-add
4344
+ * it when painting the constant is exported only so callers can reconcile against the container edge.
4345
+ * The per-region gaps below are intentionally internal; trust the returned rects rather than
4346
+ * reproducing the spacing.
4316
4347
  */
4317
4348
  export declare const LAYOUT_PADDING = 24;
4318
4349
 
@@ -4401,6 +4432,12 @@ export declare interface LayoutCompilerInput {
4401
4432
  * right panel-edge padding; otherwise it is inert.
4402
4433
  */
4403
4434
  textScale?: number;
4435
+ /**
4436
+ * Outer padding around the whole chart, in pixels, applied uniformly on all four sides. Defaults to
4437
+ * {@link LAYOUT_PADDING} when omitted. Renderers thread a resolved theme token here so a consumer can
4438
+ * tighten or loosen the frame (e.g. a borderless, recolored chart that wants less surrounding space).
4439
+ */
4440
+ padding?: number;
4404
4441
  }
4405
4442
 
4406
4443
  /** Positions where axes/labels/legends can be placed around the panel. */
@@ -5917,7 +5954,7 @@ export declare interface SpecInput {
5917
5954
  config: ConfigInput;
5918
5955
  }
5919
5956
 
5920
- declare type SpecItem = LayerInput | ScaleInput | CoordInput | ConfigItem | TransformInput | MappingItem | HighlightInput;
5957
+ declare type SpecItem = LayerInput | ScaleInput | CoordInput | ConfigItem | TransformInput | MappingItem | HighlightInput | AnnotationsItem;
5921
5958
 
5922
5959
  /**
5923
5960
  * Compiles a raw compiler input or graph config into a resolved Spec.