@opendata-ai/openchart-vanilla 6.28.6 → 7.0.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 +13 -8
- package/dist/index.js +2797 -2356
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/__tests__/crosshair.test.ts +11 -2
- package/src/__tests__/events.test.ts +55 -10
- package/src/graph/__tests__/canvas-renderer.test.ts +1 -0
- package/src/interactions/chart-events.ts +139 -0
- package/src/interactions/crosshair.ts +228 -0
- package/src/interactions/drag-handler.ts +175 -0
- package/src/interactions/editing-drags.ts +512 -0
- package/src/interactions/index.ts +25 -0
- package/src/interactions/keyboard-nav.ts +111 -0
- package/src/interactions/legend-interaction.ts +38 -0
- package/src/interactions/selection.ts +271 -0
- package/src/interactions/tooltip-events.ts +72 -0
- package/src/mount.ts +182 -1761
- package/src/renderers/annotations.ts +82 -2
- package/src/renderers/axes.ts +18 -1
- package/src/renderers/brand.ts +7 -1
- package/src/renderers/chrome.ts +50 -3
- package/src/renderers/endpoint-labels.ts +164 -0
- package/src/renderers/legend.ts +32 -27
- package/src/renderers/marks.ts +65 -17
- package/src/renderers/metrics.ts +50 -0
- package/src/svg-renderer.ts +80 -20
- package/src/tilemap-mount.ts +6 -6
- package/src/tilemap-renderer.ts +0 -2
- package/src/tooltip.ts +27 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChartLayout, ChartSpec, CompileOptions, TableLayout, TableSpec, VizSpec } from '@opendata-ai/openchart-engine';
|
|
2
|
-
import { BarListSpec, BarListLayout, ThemeConfig, DarkMode, GraphSpec, ChartSpec, LayerSpec, ElementRef, ChartLayout, ChartEventHandlers, BarTableCell, CategoryTableCell, TableCell, FlagTableCell, HeatmapTableCell, ImageTableCell, SparklineTableCell, TextTableCell, SankeySpec, SankeyLayout, Mark, TableSpec, SortState, TableLayout, TileMapSpec, TileMapLayout, TooltipContent } from '@opendata-ai/openchart-core';
|
|
2
|
+
import { BarListSpec, BarListLayout, ThemeConfig, DarkMode, GraphSpec, ChartSpec, LayerSpec, ElementRef, ChartLayout, ChartEventHandlers, DataRow, BarTableCell, CategoryTableCell, TableCell, FlagTableCell, HeatmapTableCell, ImageTableCell, SparklineTableCell, TextTableCell, SankeySpec, SankeyLayout, Mark, TableSpec, SortState, TableLayout, TileMapSpec, TileMapLayout, TooltipContent } from '@opendata-ai/openchart-core';
|
|
3
|
+
import { Placement } from '@floating-ui/dom';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Export utilities: serialize charts to SVG, PNG, JPG, or CSV.
|
|
@@ -225,13 +226,8 @@ interface ChartInstance {
|
|
|
225
226
|
}
|
|
226
227
|
/**
|
|
227
228
|
* Create a chart instance from a spec and mount it into a container.
|
|
228
|
-
*
|
|
229
|
-
* @param container - The DOM element to render into.
|
|
230
|
-
* @param spec - The visualization spec.
|
|
231
|
-
* @param options - Mount options (theme, darkMode, responsive, etc.).
|
|
232
|
-
* @returns A ChartInstance with update/resize/export/destroy methods.
|
|
233
229
|
*/
|
|
234
|
-
declare function createChart(container: HTMLElement, spec: ChartSpec | LayerSpec | GraphSpec, options?: MountOptions): ChartInstance;
|
|
230
|
+
declare function createChart<TData extends DataRow = DataRow>(container: HTMLElement, spec: ChartSpec<TData> | LayerSpec<TData> | GraphSpec, options?: MountOptions): ChartInstance;
|
|
235
231
|
|
|
236
232
|
/**
|
|
237
233
|
* Table cell renderers: produce DOM elements for each cell type.
|
|
@@ -539,9 +535,18 @@ declare function createTileMap(container: HTMLElement, spec: TileMapSpec, option
|
|
|
539
535
|
* tap-outside-to-hide.
|
|
540
536
|
*/
|
|
541
537
|
|
|
538
|
+
interface TooltipShowOptions {
|
|
539
|
+
/**
|
|
540
|
+
* Floating-ui placement. Defaults to 'bottom-start' for mark hover
|
|
541
|
+
* (the legacy behavior). Line/area snap-tooltips pass 'right-start'
|
|
542
|
+
* so the card sits beside the snapped point and flips to 'left-start'
|
|
543
|
+
* via the flip middleware when crowding the right edge.
|
|
544
|
+
*/
|
|
545
|
+
placement?: Placement;
|
|
546
|
+
}
|
|
542
547
|
interface TooltipManager {
|
|
543
548
|
/** Show the tooltip with content at a given position. */
|
|
544
|
-
show(content: TooltipContent, x: number, y: number): void;
|
|
549
|
+
show(content: TooltipContent, x: number, y: number, opts?: TooltipShowOptions): void;
|
|
545
550
|
/** Hide the tooltip. */
|
|
546
551
|
hide(): void;
|
|
547
552
|
/** Remove the tooltip element and clean up event listeners. */
|