chartgpu 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -148,10 +148,28 @@ GPU-binned density/heatmap mode for scatter plots (`mode: 'density'`) to reveal
148
148
 
149
149
  ### 10M points (benchmark)
150
150
 
151
- 10,000,000 points rendered at ~120 FPS (benchmark mode).
151
+ 10,000,000 points rendered at ~80 FPS (benchmark mode).
152
152
 
153
153
  ![10 million point benchmark at 120 FPS](docs/assets/ulimate-benchmark-example.png)
154
154
 
155
+ ### Interactive Annotation Authoring
156
+
157
+ Full-featured annotation authoring system with interactive editing capabilities. Create, edit, drag, and delete annotations with an intuitive UI. Supports all annotation types: reference lines (horizontal/vertical), point markers, text annotations (plot-space + data-space tracking), labels, and styling options.
158
+
159
+ ![Annotations comprehensive demo](docs/assets/annotations.png)
160
+
161
+ **Key features:**
162
+ - **Right-click empty space** → Add vertical/horizontal line or text note with custom color, style & label
163
+ - **Click & drag annotations** → Reposition them (lines constrained to their axis)
164
+ - **Right-click on annotation** → Edit properties or delete
165
+ - **Full styling control** → Color picker, line style (solid/dashed), line width, and label customization
166
+ - **Undo/Redo support** → All annotations are reversible
167
+ - **Scroll to zoom, Drag to pan** → Standard chart interactions work seamlessly
168
+
169
+ ![Annotation configuration dialog](docs/assets/annontations-add-indicator.png)
170
+
171
+ The annotation authoring system is demonstrated in the [`examples/annotation-authoring/`](examples/annotation-authoring/) example.
172
+
155
173
  ## Quick start
156
174
 
157
175
  ```ts
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Configuration dialog for creating and editing annotations
3
+ *
4
+ * Provides a modal dialog for setting annotation properties:
5
+ * - Label, color, line style, line width (for lines)
6
+ * - Text content, color, font size (for text annotations)
7
+ * - Label, color, marker size (for point annotations)
8
+ */
9
+ import type { AnnotationConfig } from '../config/types.js';
10
+ export interface AnnotationConfigDialogOptions {
11
+ readonly palette?: readonly string[];
12
+ readonly zIndex?: number;
13
+ }
14
+ export interface AnnotationConfigDialog {
15
+ showCreate(annotationType: 'lineX' | 'lineY' | 'text' | 'point', defaults: Partial<AnnotationConfig>, onSave: (config: AnnotationConfig) => void, onCancel: () => void): void;
16
+ showEdit(annotation: AnnotationConfig, onSave: (updates: Partial<AnnotationConfig>) => void, onCancel: () => void): void;
17
+ hide(): void;
18
+ dispose(): void;
19
+ }
20
+ /**
21
+ * Creates a configuration dialog for annotations
22
+ */
23
+ export declare function createAnnotationConfigDialog(container: HTMLElement, options?: AnnotationConfigDialogOptions): AnnotationConfigDialog;
24
+ //# sourceMappingURL=createAnnotationConfigDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createAnnotationConfigDialog.d.ts","sourceRoot":"","sources":["../../src/components/createAnnotationConfigDialog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CACR,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,EACpD,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,MAAM,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,EAC1C,QAAQ,EAAE,MAAM,IAAI,GACnB,IAAI,CAAC;IAER,QAAQ,CACN,UAAU,EAAE,gBAAgB,EAC5B,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,EACpD,QAAQ,EAAE,MAAM,IAAI,GACnB,IAAI,CAAC;IAER,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;CACjB;AAiBD;;GAEG;AACH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