@graphysdk/viz-engine 0.0.1-experimental.3 → 0.0.1-experimental.5

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[];
@@ -5925,7 +5954,7 @@ export declare interface SpecInput {
5925
5954
  config: ConfigInput;
5926
5955
  }
5927
5956
 
5928
- declare type SpecItem = LayerInput | ScaleInput | CoordInput | ConfigItem | TransformInput | MappingItem | HighlightInput;
5957
+ declare type SpecItem = LayerInput | ScaleInput | CoordInput | ConfigItem | TransformInput | MappingItem | HighlightInput | AnnotationsItem;
5929
5958
 
5930
5959
  /**
5931
5960
  * Compiles a raw compiler input or graph config into a resolved Spec.