@opendata-ai/openchart-vanilla 7.8.0 → 7.9.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 CHANGED
@@ -1,5 +1,5 @@
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, DataRow, 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, RectMark, Mark, BarTableCell, CategoryTableCell, TableCell, FlagTableCell, HeatmapTableCell, ImageTableCell, SparklineTableCell, TextTableCell, SankeySpec, SankeyLayout, TableSpec, SortState, TableLayout, TileMapSpec, TileMapLayout, TooltipContent } from '@opendata-ai/openchart-core';
3
3
  import { Placement } from '@floating-ui/dom';
4
4
 
5
5
  /**
@@ -231,6 +231,30 @@ interface ChartInstance {
231
231
  */
232
232
  declare function createChart<TData extends DataRow = DataRow>(container: HTMLElement, spec: ChartSpec<TData> | LayerSpec<TData> | GraphSpec, options?: MountOptions): ChartInstance;
233
233
 
234
+ /**
235
+ * Mark rendering: dispatches to per-mark-type sub-renderers (line, area, rect,
236
+ * arc, point, text, rule, tick).
237
+ *
238
+ * Mark renderers read module-level animation and gradient state so their
239
+ * signatures stay `(mark, index) => SVGElement`. Callers must invoke
240
+ * `setMarkRenderState()` before `renderMarks()` and `resetMarkRenderState()`
241
+ * after.
242
+ */
243
+
244
+ type MarkRenderer<T extends Mark> = (mark: T, index: number) => SVGElement;
245
+ /**
246
+ * Register a mark renderer for a specific mark type.
247
+ * Built-in renderers are registered below for all chart types.
248
+ */
249
+ declare function registerMarkRenderer<T extends Mark>(type: T['type'], renderer: MarkRenderer<T>): void;
250
+ /**
251
+ * Build an SVG path describing a rectangle with selectively rounded corners.
252
+ * Used by stacked segments where only the leading edge (top of a vertical
253
+ * stack, right of a horizontal stack) should round so the seams between
254
+ * adjacent segments stay flush.
255
+ */
256
+ declare function rectPathWithCorners(mark: RectMark, sides: NonNullable<RectMark['cornerRadiusSides']>): string;
257
+
234
258
  /**
235
259
  * Table cell renderers: produce DOM elements for each cell type.
236
260
  *
@@ -316,23 +340,6 @@ interface SankeyInstance {
316
340
  */
317
341
  declare function createSankey(container: HTMLElement, spec: SankeySpec, options?: SankeyMountOptions): SankeyInstance;
318
342
 
319
- /**
320
- * Mark rendering: dispatches to per-mark-type sub-renderers (line, area, rect,
321
- * arc, point, text, rule, tick).
322
- *
323
- * Mark renderers read module-level animation and gradient state so their
324
- * signatures stay `(mark, index) => SVGElement`. Callers must invoke
325
- * `setMarkRenderState()` before `renderMarks()` and `resetMarkRenderState()`
326
- * after.
327
- */
328
-
329
- type MarkRenderer<T extends Mark> = (mark: T, index: number) => SVGElement;
330
- /**
331
- * Register a mark renderer for a specific mark type.
332
- * Built-in renderers are registered below for all chart types.
333
- */
334
- declare function registerMarkRenderer<T extends Mark>(type: T['type'], renderer: MarkRenderer<T>): void;
335
-
336
343
  /**
337
344
  * SVG renderer: converts a ChartLayout into SVG DOM elements.
338
345
  *
@@ -566,4 +573,4 @@ interface TooltipManager {
566
573
  */
567
574
  declare function createTooltipManager(container: HTMLElement): TooltipManager;
568
575
 
569
- 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 };
576
+ 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, rectPathWithCorners, registerMarkRenderer, renderBarCell, renderCategoryCell, renderCell, renderChartSVG, renderFlagCell, renderHeatmapCell, renderImageCell, renderSparklineCell, renderTable, renderTextCell };