@opendata-ai/openchart-vanilla 6.27.2 → 6.28.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 +36 -2
- package/dist/index.js +901 -486
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/barlist-mount.ts +314 -0
- package/src/barlist-renderer.ts +264 -0
- package/src/index.ts +3 -0
- package/src/renderers/axes.ts +2 -2
- package/src/svg-renderer.ts +8 -2
- package/src/tilemap-renderer.ts +13 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ChartLayout, ChartSpec, CompileOptions, TableLayout, TableSpec, VizSpec } from '@opendata-ai/openchart-engine';
|
|
2
|
-
import {
|
|
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';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Export utilities: serialize charts to SVG, PNG, JPG, or CSV.
|
|
@@ -76,6 +76,40 @@ declare function exportJPG(svgElement: SVGElement, options?: JPGExportOptions):
|
|
|
76
76
|
*/
|
|
77
77
|
declare function exportCSV(data: Record<string, unknown>[]): string;
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* BarList mount API: the main entry point for vanilla JS barlist usage.
|
|
81
|
+
*
|
|
82
|
+
* createBarList() takes a container, BarListSpec, and options, compiles the
|
|
83
|
+
* barlist, renders it as SVG, sets up responsive resizing, tooltip interaction,
|
|
84
|
+
* and returns a BarListInstance with update/resize/export/destroy.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
interface BarListMountOptions {
|
|
88
|
+
theme?: ThemeConfig;
|
|
89
|
+
darkMode?: DarkMode;
|
|
90
|
+
responsive?: boolean;
|
|
91
|
+
watermark?: boolean;
|
|
92
|
+
tooltip?: boolean;
|
|
93
|
+
onRowClick?: (row: {
|
|
94
|
+
label: string;
|
|
95
|
+
value: number;
|
|
96
|
+
data: Record<string, unknown>;
|
|
97
|
+
}) => void;
|
|
98
|
+
onRowHover?: (row: {
|
|
99
|
+
label: string;
|
|
100
|
+
value: number;
|
|
101
|
+
data: Record<string, unknown>;
|
|
102
|
+
} | null) => void;
|
|
103
|
+
}
|
|
104
|
+
interface BarListInstance {
|
|
105
|
+
update(spec: BarListSpec): void;
|
|
106
|
+
resize(): void;
|
|
107
|
+
export(format: 'svg' | 'svg-with-fonts' | 'png' | 'jpg', options?: JPGExportOptions | SVGExportOptions): string | Promise<Blob> | Promise<string>;
|
|
108
|
+
destroy(): void;
|
|
109
|
+
readonly layout: BarListLayout;
|
|
110
|
+
}
|
|
111
|
+
declare function createBarList(container: HTMLElement, spec: BarListSpec, options?: BarListMountOptions): BarListInstance;
|
|
112
|
+
|
|
79
113
|
/**
|
|
80
114
|
* Creates a Web Worker running the force simulation.
|
|
81
115
|
*
|
|
@@ -525,4 +559,4 @@ interface TooltipManager {
|
|
|
525
559
|
*/
|
|
526
560
|
declare function createTooltipManager(container: HTMLElement): TooltipManager;
|
|
527
561
|
|
|
528
|
-
export { type ChartInstance, type ExportOptions, type GraphInstance, type GraphMountOptions, type JPGExportOptions, type KeyboardNavOptions, type MountOptions, type PNGExportOptions, type SVGExportOptions, type SankeyInstance, type SankeyMountOptions, type TableInstance, type TableMountOptions, type TableState, type TextEditOverlayConfig, type TileMapInstance, type TileMapMountOptions, type TooltipManager, type UpdateOptions, attachKeyboardNav, createChart, createGraph, createSankey, createSimulationWorker, createTable, createTextEditOverlay, createTileMap, createTooltipManager, exportCSV, exportJPG, exportPNG, exportSVG, exportSVGWithFonts, observeResize, registerMarkRenderer, renderBarCell, renderCategoryCell, renderCell, renderChartSVG, renderFlagCell, renderHeatmapCell, renderImageCell, renderSparklineCell, renderTable, renderTextCell };
|
|
562
|
+
export { type BarListInstance, type BarListMountOptions, type ChartInstance, type ExportOptions, type GraphInstance, type GraphMountOptions, type JPGExportOptions, type KeyboardNavOptions, type MountOptions, type PNGExportOptions, type SVGExportOptions, type SankeyInstance, type SankeyMountOptions, type TableInstance, type TableMountOptions, type TableState, type TextEditOverlayConfig, type TileMapInstance, type TileMapMountOptions, type TooltipManager, type UpdateOptions, attachKeyboardNav, createBarList, createChart, createGraph, createSankey, createSimulationWorker, createTable, createTextEditOverlay, createTileMap, createTooltipManager, exportCSV, exportJPG, exportPNG, exportSVG, exportSVGWithFonts, observeResize, registerMarkRenderer, renderBarCell, renderCategoryCell, renderCell, renderChartSVG, renderFlagCell, renderHeatmapCell, renderImageCell, renderSparklineCell, renderTable, renderTextCell };
|