katucharts.js 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/LICENSE +106 -0
- package/README.md +1100 -0
- package/dist/__vite-optional-peer-dep_jspdf_katucharts-BDMct_Gn.js +4 -0
- package/dist/accessibility/A11yModule.d.ts +26 -0
- package/dist/axis/Axis.d.ts +140 -0
- package/dist/axis/AxisCoordinator.d.ts +38 -0
- package/dist/bio.d.ts +22 -0
- package/dist/components/Credits.d.ts +38 -0
- package/dist/components/Crosshair.d.ts +15 -0
- package/dist/components/DataLabels.d.ts +7 -0
- package/dist/components/ExportButton.d.ts +27 -0
- package/dist/components/Legend.d.ts +53 -0
- package/dist/components/TitleRenderer.d.ts +19 -0
- package/dist/components/Tooltip.d.ts +61 -0
- package/dist/core/Chart.d.ts +156 -0
- package/dist/core/EventBus.d.ts +14 -0
- package/dist/core/InteractionController.d.ts +62 -0
- package/dist/core/OptionsParser.d.ts +61 -0
- package/dist/core/Registry.d.ts +27 -0
- package/dist/core/SVGRenderer.d.ts +48 -0
- package/dist/core/ScrollablePlotOverlay.d.ts +31 -0
- package/dist/core/StackComputer.d.ts +25 -0
- package/dist/core/StateManager.d.ts +21 -0
- package/dist/core/UpdateScheduler.d.ts +28 -0
- package/dist/core/animationConstants.d.ts +20 -0
- package/dist/core/chartTypes.d.ts +46 -0
- package/dist/core/registerAll.d.ts +4 -0
- package/dist/core/registerBio.d.ts +4 -0
- package/dist/core/registerCore.d.ts +4 -0
- package/dist/core/registerFinance.d.ts +4 -0
- package/dist/core/registerFinancial.d.ts +4 -0
- package/dist/core/registerFlow.d.ts +4 -0
- package/dist/core/registerGeneral.d.ts +4 -0
- package/dist/datatable/DataTable.d.ts +162 -0
- package/dist/datatable/DataTableDefaults.d.ts +7 -0
- package/dist/datatable/api/TableApi.d.ts +35 -0
- package/dist/datatable/columns/ColumnDef.d.ts +16 -0
- package/dist/datatable/columns/ColumnManager.d.ts +31 -0
- package/dist/datatable/data/DataProcessor.d.ts +46 -0
- package/dist/datatable/data/DataSource.d.ts +26 -0
- package/dist/datatable/editing/CellEditor.d.ts +29 -0
- package/dist/datatable/export/TableExport.d.ts +23 -0
- package/dist/datatable/locales/en.d.ts +9 -0
- package/dist/datatable/locales/es.d.ts +6 -0
- package/dist/datatable/locales/index.d.ts +22 -0
- package/dist/datatable/locales/pt-BR.d.ts +6 -0
- package/dist/datatable/locales/resolveLocale.d.ts +16 -0
- package/dist/datatable/locales/zh.d.ts +6 -0
- package/dist/datatable/render/CellRenderer.d.ts +24 -0
- package/dist/datatable/render/HeaderRenderer.d.ts +51 -0
- package/dist/datatable/render/PaginationRenderer.d.ts +26 -0
- package/dist/datatable/render/SearchRenderer.d.ts +21 -0
- package/dist/datatable/render/TableRenderer.d.ts +81 -0
- package/dist/datatable/render/ToolbarRenderer.d.ts +34 -0
- package/dist/datatable/render/icons.d.ts +24 -0
- package/dist/datatable/render/popover.d.ts +15 -0
- package/dist/datatable/selection/SelectionManager.d.ts +29 -0
- package/dist/datatable/themes/TableTheme.d.ts +36 -0
- package/dist/datatable/themes/styleSheet.d.ts +16 -0
- package/dist/datatable.d.ts +19 -0
- package/dist/export/ChartExporter.d.ts +50 -0
- package/dist/export/Export.d.ts +76 -0
- package/dist/finance.d.ts +49 -0
- package/dist/index.d.ts +67 -0
- package/dist/indicators/Indicator.d.ts +23 -0
- package/dist/indicators/expandIndicators.d.ts +18 -0
- package/dist/indicators/moving-averages/DEMA.d.ts +10 -0
- package/dist/indicators/moving-averages/EMA.d.ts +12 -0
- package/dist/indicators/moving-averages/SMA.d.ts +11 -0
- package/dist/indicators/moving-averages/TEMA.d.ts +10 -0
- package/dist/indicators/moving-averages/WMA.d.ts +12 -0
- package/dist/indicators/oscillators/CCI.d.ts +11 -0
- package/dist/indicators/oscillators/MACD.d.ts +20 -0
- package/dist/indicators/oscillators/Momentum.d.ts +10 -0
- package/dist/indicators/oscillators/ROC.d.ts +10 -0
- package/dist/indicators/oscillators/RSI.d.ts +11 -0
- package/dist/indicators/oscillators/Stochastic.d.ts +20 -0
- package/dist/indicators/registry.d.ts +9 -0
- package/dist/indicators/trend/ADX.d.ts +11 -0
- package/dist/indicators/trend/IchimokuCloud.d.ts +14 -0
- package/dist/indicators/trend/PSAR.d.ts +11 -0
- package/dist/indicators/util.d.ts +8 -0
- package/dist/indicators/volatility/ATR.d.ts +11 -0
- package/dist/indicators/volatility/BollingerBands.d.ts +11 -0
- package/dist/indicators/volume/OBV.d.ts +11 -0
- package/dist/indicators/volume/VBP.d.ts +12 -0
- package/dist/indicators/volume/VWAP.d.ts +12 -0
- package/dist/interaction/Drilldown.d.ts +29 -0
- package/dist/interaction/HoverManager.d.ts +47 -0
- package/dist/interaction/Zoom.d.ts +68 -0
- package/dist/katucharts-bio.es.js +5861 -0
- package/dist/katucharts-bio.umd.js +1 -0
- package/dist/katucharts-datatable.es.js +3363 -0
- package/dist/katucharts-datatable.umd.js +296 -0
- package/dist/katucharts-finance.es.js +4364 -0
- package/dist/katucharts-finance.umd.js +1 -0
- package/dist/katucharts-react.es.js +35 -0
- package/dist/katucharts-react.umd.js +1 -0
- package/dist/katucharts.es.js +20531 -0
- package/dist/katucharts.umd.js +9 -0
- package/dist/layout/LayoutEngine.d.ts +44 -0
- package/dist/license/LicenseManager.d.ts +63 -0
- package/dist/options/defaults.d.ts +5 -0
- package/dist/react/KatuChartsReact.d.ts +16 -0
- package/dist/react.d.ts +2 -0
- package/dist/responsive/ResponsiveEngine.d.ts +15 -0
- package/dist/series/BaseSeries.d.ts +186 -0
- package/dist/series/bioinformatics/CircosChart.d.ts +4 -0
- package/dist/series/bioinformatics/ClusteredHeatmapChart.d.ts +22 -0
- package/dist/series/bioinformatics/ForestPlotChart.d.ts +21 -0
- package/dist/series/bioinformatics/KaplanMeierChart.d.ts +22 -0
- package/dist/series/bioinformatics/ManhattanChart.d.ts +34 -0
- package/dist/series/bioinformatics/PCoAChart.d.ts +22 -0
- package/dist/series/bioinformatics/PhyloTreeChart.d.ts +27 -0
- package/dist/series/bioinformatics/SequenceLogoChart.d.ts +21 -0
- package/dist/series/bioinformatics/ViolinChart.d.ts +23 -0
- package/dist/series/bioinformatics/VolcanoChart.d.ts +28 -0
- package/dist/series/bioinformatics/circos/CircosChart.d.ts +20 -0
- package/dist/series/bioinformatics/circos/CircosColorScales.d.ts +6 -0
- package/dist/series/bioinformatics/circos/CircosComparativeChart.d.ts +41 -0
- package/dist/series/bioinformatics/circos/CircosHeatmapChart.d.ts +31 -0
- package/dist/series/bioinformatics/circos/CircosLayoutEngine.d.ts +37 -0
- package/dist/series/bioinformatics/circos/CircosRules.d.ts +6 -0
- package/dist/series/bioinformatics/circos/CircosSpiralChart.d.ts +39 -0
- package/dist/series/bioinformatics/circos/CircosTypes.d.ts +131 -0
- package/dist/series/bioinformatics/circos/tracks/AreaTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/ConnectorTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/GlyphTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/HeatmapTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/HighlightTrackRenderer.d.ts +6 -0
- package/dist/series/bioinformatics/circos/tracks/HistogramTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/LineTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/LinkTrackRenderer.d.ts +8 -0
- package/dist/series/bioinformatics/circos/tracks/LollipopTrackRenderer.d.ts +9 -0
- package/dist/series/bioinformatics/circos/tracks/RibbonTrackRenderer.d.ts +9 -0
- package/dist/series/bioinformatics/circos/tracks/ScatterTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/StackTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/TextTrackRenderer.d.ts +8 -0
- package/dist/series/bioinformatics/circos/tracks/TileTrackRenderer.d.ts +7 -0
- package/dist/series/bioinformatics/circos/tracks/TrackAxesRenderer.d.ts +6 -0
- package/dist/series/bioinformatics/circos/tracks/TrackBackgroundRenderer.d.ts +5 -0
- package/dist/series/cartesian/AreaChart.d.ts +33 -0
- package/dist/series/cartesian/BoxPlotChart.d.ts +24 -0
- package/dist/series/cartesian/BubbleChart.d.ts +34 -0
- package/dist/series/cartesian/ColumnChart.d.ts +37 -0
- package/dist/series/cartesian/LineChart.d.ts +28 -0
- package/dist/series/cartesian/ScatterChart.d.ts +20 -0
- package/dist/series/cartesian/SplineChart.d.ts +9 -0
- package/dist/series/cartesian/WaterfallChart.d.ts +25 -0
- package/dist/series/financial/AreaRangeChart.d.ts +24 -0
- package/dist/series/financial/BaselineChart.d.ts +20 -0
- package/dist/series/financial/CandlestickChart.d.ts +55 -0
- package/dist/series/financial/ColumnRangeChart.d.ts +16 -0
- package/dist/series/financial/FlagsChart.d.ts +34 -0
- package/dist/series/financial/HeikinAshiChart.d.ts +11 -0
- package/dist/series/financial/HollowCandlestickChart.d.ts +17 -0
- package/dist/series/financial/KagiChart.d.ts +23 -0
- package/dist/series/financial/LineBreakChart.d.ts +23 -0
- package/dist/series/financial/PointAndFigureChart.d.ts +24 -0
- package/dist/series/financial/RenkoChart.d.ts +22 -0
- package/dist/series/financial/VBPChart.d.ts +18 -0
- package/dist/series/financial/VolumeChart.d.ts +15 -0
- package/dist/series/flow/DependencyWheelChart.d.ts +23 -0
- package/dist/series/flow/NetworkGraphChart.d.ts +18 -0
- package/dist/series/flow/SankeyChart.d.ts +24 -0
- package/dist/series/gauge/GaugeChart.d.ts +40 -0
- package/dist/series/heatmap/HeatmapChart.d.ts +18 -0
- package/dist/series/hierarchical/SunburstChart.d.ts +44 -0
- package/dist/series/hierarchical/TreegraphChart.d.ts +19 -0
- package/dist/series/hierarchical/TreemapChart.d.ts +20 -0
- package/dist/series/hierarchical/WordcloudChart.d.ts +19 -0
- package/dist/series/index.d.ts +45 -0
- package/dist/series/map/FlowmapChart.d.ts +33 -0
- package/dist/series/map/MapChart.d.ts +53 -0
- package/dist/series/map/MapPointChart.d.ts +26 -0
- package/dist/series/map/mapProjection.d.ts +46 -0
- package/dist/series/pie/PieChart.d.ts +53 -0
- package/dist/series/polar/PolarChart.d.ts +18 -0
- package/dist/series/race/BarRaceChart.d.ts +44 -0
- package/dist/series/timeline/TimelineChart.d.ts +23 -0
- package/dist/series/venn/VennChart.d.ts +28 -0
- package/dist/stock/DataGrouping.d.ts +21 -0
- package/dist/stock/Navigator.d.ts +25 -0
- package/dist/stock/RangeSelector.d.ts +9 -0
- package/dist/stock/StockController.d.ts +47 -0
- package/dist/stockcharts.d.ts +8 -0
- package/dist/streaming/StreamAdapter.d.ts +36 -0
- package/dist/types/datatable-options.d.ts +633 -0
- package/dist/types/options.d.ts +1333 -0
- package/dist/utils/CircularBuffer.d.ts +24 -0
- package/dist/utils/chartText.d.ts +18 -0
- package/dist/utils/color.d.ts +23 -0
- package/dist/utils/decimation.d.ts +19 -0
- package/dist/utils/deepMerge.d.ts +5 -0
- package/dist/utils/dom.d.ts +10 -0
- package/dist/utils/format.d.ts +42 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/math.d.ts +6 -0
- package/dist/utils/throttle.d.ts +2 -0
- package/package.json +95 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owns the chart's user-interaction behaviors: drilldown (with its history
|
|
3
|
+
* stack and transition), zoom/pan, series hover-dimming, and the accessibility
|
|
4
|
+
* module. Extracted from `Chart`; it reaches chart state through a narrow host
|
|
5
|
+
* interface and performs rebuilds/re-renders via host callbacks so it never
|
|
6
|
+
* touches the chart's private render internals directly.
|
|
7
|
+
*
|
|
8
|
+
* Note: responsive rules, reflow and the ResizeObserver intentionally remain on
|
|
9
|
+
* `Chart` — they belong to the sizing lifecycle (the public `reflow()`/`setSize`
|
|
10
|
+
* path) and share the ResizeObserver with the export/full-screen feature.
|
|
11
|
+
*/
|
|
12
|
+
import type { SVGRenderer } from './SVGRenderer';
|
|
13
|
+
import type { EventBus } from './EventBus';
|
|
14
|
+
import type { LayoutResult } from '../layout/LayoutEngine';
|
|
15
|
+
import type { BaseSeries } from '../series/BaseSeries';
|
|
16
|
+
import type { AxisInstance } from '../axis/Axis';
|
|
17
|
+
import type { InternalConfig, InternalSeriesConfig } from '../types/options';
|
|
18
|
+
type Group = ReturnType<SVGRenderer['createGroup']>;
|
|
19
|
+
export interface InteractionHost {
|
|
20
|
+
getOptions(): InternalConfig;
|
|
21
|
+
getContainer(): HTMLElement;
|
|
22
|
+
getEvents(): EventBus;
|
|
23
|
+
getRenderer(): SVGRenderer;
|
|
24
|
+
getSeriesGroup(): Group;
|
|
25
|
+
getPlotGroup(): Group;
|
|
26
|
+
getLayout(): LayoutResult;
|
|
27
|
+
getXAxes(): AxisInstance[];
|
|
28
|
+
getYAxes(): AxisInstance[];
|
|
29
|
+
getSeriesInstances(): BaseSeries[];
|
|
30
|
+
/** Replace the active (internal) series config — used by drilldown. */
|
|
31
|
+
setSeries(series: InternalSeriesConfig[]): void;
|
|
32
|
+
/** Destroy series instances, rebuild axes + series, and render everything. */
|
|
33
|
+
rebuild(): void;
|
|
34
|
+
/** Re-render axes, series and legend after a zoom/pan domain change. */
|
|
35
|
+
renderAfterZoom(): void;
|
|
36
|
+
fireEvent(name: string, ...args: any[]): void;
|
|
37
|
+
}
|
|
38
|
+
export declare class InteractionController {
|
|
39
|
+
private host;
|
|
40
|
+
private drilldown;
|
|
41
|
+
private zoom;
|
|
42
|
+
private a11yModule;
|
|
43
|
+
private origXDomains;
|
|
44
|
+
private origYDomains;
|
|
45
|
+
private isBoxZoomed;
|
|
46
|
+
constructor(host: InteractionHost);
|
|
47
|
+
setup(): void;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
private setupSeriesDimming;
|
|
50
|
+
private setupDrilldown;
|
|
51
|
+
private performDrillSwap;
|
|
52
|
+
private setupZoom;
|
|
53
|
+
/**
|
|
54
|
+
* Converts a pixel rectangle from a drag-selection into axis domains and
|
|
55
|
+
* re-renders. Original domains are captured on the first zoom so the reset
|
|
56
|
+
* button can restore the unzoomed view.
|
|
57
|
+
*/
|
|
58
|
+
private applyBoxZoom;
|
|
59
|
+
private resetBoxZoom;
|
|
60
|
+
private setupAccessibility;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline: validate → deepMerge with defaults → normalize shorthands → toInternal.
|
|
3
|
+
*/
|
|
4
|
+
import type { KatuChartsOptions, InternalConfig } from '../types/options';
|
|
5
|
+
export declare function setGlobalOptions(options: Partial<KatuChartsOptions>): void;
|
|
6
|
+
export declare function getGlobalOptions(): Partial<KatuChartsOptions>;
|
|
7
|
+
export declare class OptionsParser {
|
|
8
|
+
parse(userOptions: KatuChartsOptions): InternalConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Layers, lowest to highest precedence: built-in defaults, global options, the
|
|
11
|
+
* resolved `theme` fragment, then the user's explicit options. A theme thus
|
|
12
|
+
* overwrites every default color surface while any option the caller sets
|
|
13
|
+
* directly still wins over it.
|
|
14
|
+
*/
|
|
15
|
+
private mergeWithDefaults;
|
|
16
|
+
private normalize;
|
|
17
|
+
/**
|
|
18
|
+
* Derives a sensible chart height when the consumer left it unset (`null`/`undefined`):
|
|
19
|
+
* inverted (bar) charts with many categories grow their internal scroll area so rows stay
|
|
20
|
+
* legible instead of being crammed into a fixed height. Circular relationship charts
|
|
21
|
+
* (dependency wheel / network graph) are NOT forced to a fixed pixel height here — doing so
|
|
22
|
+
* overrode an explicitly sized container and overflowed it. They instead fall back to a
|
|
23
|
+
* square canvas via `Chart.getDefaultHeightAspectRatio()`, which only applies when the
|
|
24
|
+
* container itself has no measurable height.
|
|
25
|
+
*/
|
|
26
|
+
private applyAutoHeight;
|
|
27
|
+
/**
|
|
28
|
+
* Bridges top-level map options onto the map series so a config that places
|
|
29
|
+
* them at the chart level works unchanged: `colorAxis`, `mapView.projection`,
|
|
30
|
+
* `mapNavigation`, and `chart.map`. Series-level options always take
|
|
31
|
+
* precedence; when `series.colorAxis` is an axis index (number/boolean)
|
|
32
|
+
* rather than a full config object we fall back to the top-level colorAxis.
|
|
33
|
+
*/
|
|
34
|
+
private applyMapTopLevelOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Merges `dataLabels` layers (least → most specific) preserving array form.
|
|
37
|
+
* Single-object layers broadcast across every entry, so a default such as
|
|
38
|
+
* `{enabled:true}` refines each label instead of replacing a user array.
|
|
39
|
+
*/
|
|
40
|
+
private static mergeDataLabels;
|
|
41
|
+
private static mergeTwoDataLabels;
|
|
42
|
+
private normalizeSeries;
|
|
43
|
+
/**
|
|
44
|
+
* Series whose numeric-array shorthand maps onto OHLC fields rather than x/y/z.
|
|
45
|
+
*/
|
|
46
|
+
private static readonly OHLC_TYPES;
|
|
47
|
+
/**
|
|
48
|
+
* Series whose numeric-array shorthand maps onto low/high range fields.
|
|
49
|
+
*/
|
|
50
|
+
private static readonly RANGE_TYPES;
|
|
51
|
+
/**
|
|
52
|
+
* Array shorthand keys for OHLC and range series. The
|
|
53
|
+
* leading x value is optional, so the variant is chosen by the array length:
|
|
54
|
+
* `[o,h,l,c]`/`[x,o,h,l,c]` for OHLC, `[low,high]`/`[x,low,high]` for ranges.
|
|
55
|
+
*/
|
|
56
|
+
private defaultArrayKeys;
|
|
57
|
+
private normalizeDataPoint;
|
|
58
|
+
private normalizeDataBulk;
|
|
59
|
+
private enforceCredits;
|
|
60
|
+
private toInternal;
|
|
61
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin registry for chart types, enabling tree-shaking.
|
|
3
|
+
*/
|
|
4
|
+
import type { SeriesType } from '../types/options';
|
|
5
|
+
export interface SeriesConstructor {
|
|
6
|
+
new (...args: any[]): any;
|
|
7
|
+
}
|
|
8
|
+
export interface ModuleDefinition {
|
|
9
|
+
name: string;
|
|
10
|
+
init: (katucharts: any) => void;
|
|
11
|
+
}
|
|
12
|
+
declare class ChartRegistryClass {
|
|
13
|
+
types: Map<string, SeriesConstructor>;
|
|
14
|
+
registerType(name: SeriesType | string, constructor: SeriesConstructor): void;
|
|
15
|
+
getType(name: string): SeriesConstructor | undefined;
|
|
16
|
+
hasType(name: string): boolean;
|
|
17
|
+
getRegisteredTypes(): string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const ChartRegistry: ChartRegistryClass;
|
|
20
|
+
declare class ModuleRegistryClass {
|
|
21
|
+
modules: Map<string, ModuleDefinition>;
|
|
22
|
+
register(module: ModuleDefinition): void;
|
|
23
|
+
get(name: string): ModuleDefinition | undefined;
|
|
24
|
+
getAll(): ModuleDefinition[];
|
|
25
|
+
}
|
|
26
|
+
export declare const ModuleRegistry: ModuleRegistryClass;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps d3-selection to manage the root SVG element and provide drawing primitives.
|
|
3
|
+
*/
|
|
4
|
+
import { Selection } from 'd3-selection';
|
|
5
|
+
/**
|
|
6
|
+
* Thin chainable wrapper around a single SVG element, mirroring the subset of the
|
|
7
|
+
* `SVGElement` API (`attr`/`css`/`add`/`getBBox`/`destroy`) that consumers rely on inside
|
|
8
|
+
* custom `chart.events.render` callbacks (e.g. drawing corner labels). Elements are attached on
|
|
9
|
+
* creation, so `add()` is a no-op kept only for API compatibility.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RendererElement {
|
|
12
|
+
private readonly el;
|
|
13
|
+
constructor(el: Selection<SVGElement, unknown, null, undefined>);
|
|
14
|
+
attr(attrs: Record<string, any>): this;
|
|
15
|
+
css(styles: Record<string, any>): this;
|
|
16
|
+
add(): this;
|
|
17
|
+
getBBox(): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare class SVGRenderer {
|
|
26
|
+
readonly svg: Selection<SVGSVGElement, unknown, null, undefined>;
|
|
27
|
+
readonly defs: Selection<SVGDefsElement, unknown, null, undefined>;
|
|
28
|
+
private static clipPathCounter;
|
|
29
|
+
private static gradientCounter;
|
|
30
|
+
constructor(container: HTMLElement, width: number, height: number);
|
|
31
|
+
setSize(width: number, height: number): void;
|
|
32
|
+
createGroup(className?: string, parent?: Selection<any, any, any, any>): Selection<SVGGElement, unknown, null, undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Text factory. Appends a `<text>` to the SVG root at absolute
|
|
35
|
+
* coordinates and returns a chainable {@link RendererElement}. Used by custom render callbacks.
|
|
36
|
+
*/
|
|
37
|
+
text(str: string, x: number, y: number): RendererElement;
|
|
38
|
+
createClipPath(x: number, y: number, width: number, height: number): string;
|
|
39
|
+
updateClipPath(id: string, x: number, y: number, width: number, height: number): void;
|
|
40
|
+
createLinearGradient(id: string | null, x1: string, y1: string, x2: string, y2: string, stops: {
|
|
41
|
+
offset: string;
|
|
42
|
+
color: string;
|
|
43
|
+
opacity?: number;
|
|
44
|
+
}[]): string;
|
|
45
|
+
getSVGNode(): SVGSVGElement | null;
|
|
46
|
+
destroy(): void;
|
|
47
|
+
getSerializedSVG(): string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the fixed overlay that pins axes, title/subtitle, legend, export button
|
|
3
|
+
* and color axis in place while the plot area scrolls inside a scrollable
|
|
4
|
+
* container. Extracted from `Chart` as a pure function over an explicit context
|
|
5
|
+
* so it has no hidden dependency on chart internals; the caller owns the
|
|
6
|
+
* returned overlay element and its lifecycle.
|
|
7
|
+
*/
|
|
8
|
+
import type { SVGRenderer } from './SVGRenderer';
|
|
9
|
+
import type { LayoutResult } from '../layout/LayoutEngine';
|
|
10
|
+
import type { InternalConfig } from '../types/options';
|
|
11
|
+
import type { ExportButton } from '../components/ExportButton';
|
|
12
|
+
type PlotGroup = ReturnType<SVGRenderer['createGroup']>;
|
|
13
|
+
export interface ScrollableOverlayContext {
|
|
14
|
+
container: HTMLElement;
|
|
15
|
+
renderer: SVGRenderer;
|
|
16
|
+
options: InternalConfig;
|
|
17
|
+
plotGroup: PlotGroup;
|
|
18
|
+
layout: LayoutResult;
|
|
19
|
+
chartWidth: number;
|
|
20
|
+
chartHeight: number;
|
|
21
|
+
scrollableInner: HTMLDivElement | null;
|
|
22
|
+
scrollableOuterWidth: number;
|
|
23
|
+
scrollableOuterHeight: number;
|
|
24
|
+
useVerticalScroll: boolean;
|
|
25
|
+
useHorizontalScroll: boolean;
|
|
26
|
+
exportButton: ExportButton | null;
|
|
27
|
+
/** The overlay created by a previous call, removed before rebuilding. */
|
|
28
|
+
previousOverlay: SVGSVGElement | null;
|
|
29
|
+
}
|
|
30
|
+
export declare function createFixedAxisOverlay(ctx: ScrollableOverlayContext): SVGSVGElement | null;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared primitives for series stacking math. The chart computes per-stack
|
|
3
|
+
* totals and forward offsets in four places (series render, animated redraw,
|
|
4
|
+
* axis-domain updates and stack labels); these helpers keep the stack-key
|
|
5
|
+
* format and the accumulation loop in one place so the variants cannot drift.
|
|
6
|
+
*/
|
|
7
|
+
interface StackKeyConfig {
|
|
8
|
+
_internalType: string;
|
|
9
|
+
stack?: string | number;
|
|
10
|
+
}
|
|
11
|
+
interface StackPoint {
|
|
12
|
+
x?: number | string;
|
|
13
|
+
y?: number | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Identity of a stack group: series of the same internal type and `stack` name
|
|
17
|
+
* accumulate together.
|
|
18
|
+
*/
|
|
19
|
+
export declare function stackKey(cfg: StackKeyConfig): string;
|
|
20
|
+
/**
|
|
21
|
+
* Adds each point's `y` into `totals`, keyed by `x` (defaulting to 0). Mutates
|
|
22
|
+
* and returns `totals` so callers can fold several series into one map.
|
|
23
|
+
*/
|
|
24
|
+
export declare function accumulateStackTotals(data: ReadonlyArray<StackPoint>, totals: Map<number | string, number>): Map<number | string, number>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds normalized config and series data, routes mutations through events.
|
|
3
|
+
*/
|
|
4
|
+
import type { InternalConfig, InternalSeriesConfig, AxisOptions, SeriesOptions } from '../types/options';
|
|
5
|
+
import { EventBus } from './EventBus';
|
|
6
|
+
export declare class StateManager {
|
|
7
|
+
private config;
|
|
8
|
+
readonly events: EventBus;
|
|
9
|
+
constructor(config: InternalConfig, events: EventBus);
|
|
10
|
+
getConfig(): InternalConfig;
|
|
11
|
+
updateConfig(partial: Partial<InternalConfig>): void;
|
|
12
|
+
getSeries(): InternalSeriesConfig[];
|
|
13
|
+
getSeriesById(id: string): InternalSeriesConfig | undefined;
|
|
14
|
+
getSeriesByIndex(index: number): InternalSeriesConfig | undefined;
|
|
15
|
+
addSeries(series: InternalSeriesConfig): void;
|
|
16
|
+
removeSeries(index: number): InternalSeriesConfig | undefined;
|
|
17
|
+
updateSeries(index: number, updates: Partial<SeriesOptions>): void;
|
|
18
|
+
getXAxes(): AxisOptions[];
|
|
19
|
+
getYAxes(): AxisOptions[];
|
|
20
|
+
updateAxis(isX: boolean, index: number, updates: Partial<AxisOptions>): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sits between data mutations and DOM rendering.
|
|
3
|
+
* Batches updates and flushes via requestAnimationFrame with configurable FPS cap.
|
|
4
|
+
*/
|
|
5
|
+
import type { StreamingOptions } from '../types/options';
|
|
6
|
+
export type UpdateType = 'addPoint' | 'addPoints' | 'setData' | 'removePoint' | 'updateSeries';
|
|
7
|
+
export interface UpdateEntry {
|
|
8
|
+
type: UpdateType;
|
|
9
|
+
payload: any;
|
|
10
|
+
}
|
|
11
|
+
export declare class UpdateBatch {
|
|
12
|
+
entries: UpdateEntry[];
|
|
13
|
+
add(type: UpdateType, payload: any): void;
|
|
14
|
+
get isEmpty(): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class UpdateScheduler {
|
|
17
|
+
private pendingUpdates;
|
|
18
|
+
private rafId;
|
|
19
|
+
private lastFrameTime;
|
|
20
|
+
private maxFps;
|
|
21
|
+
private flushCallback;
|
|
22
|
+
constructor(options: StreamingOptions, flushCallback: () => void);
|
|
23
|
+
schedule(series: any, type: UpdateType, payload: any): void;
|
|
24
|
+
private requestFrame;
|
|
25
|
+
flush(): void;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
get hasPending(): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized animation timings and easings used across every series.
|
|
3
|
+
* Entry duration is unified to match the heatmap reference; hover transitions
|
|
4
|
+
* are smoothed to a clearly perceivable ~300 ms with cubic-out easing.
|
|
5
|
+
*/
|
|
6
|
+
import { easeCubicOut, easeCubicInOut } from 'd3-ease';
|
|
7
|
+
export declare const ENTRY_DURATION = 600;
|
|
8
|
+
export declare const ENTRY_STAGGER_PER_ITEM = 8;
|
|
9
|
+
export declare const ENTRY_DELAY_BASE = 0;
|
|
10
|
+
export declare const ENTRY_DATALABEL_DELAY: number;
|
|
11
|
+
/** Base animation duration for circos plot families. Sized so each staged
|
|
12
|
+
* sweep (ideogram, tracks) lands near the standard entry duration. */
|
|
13
|
+
export declare const ENTRY_CIRCOS_DURATION = 1600;
|
|
14
|
+
/** Gap inserted between hierarchical animation stages. */
|
|
15
|
+
export declare const ENTRY_STAGE_GAP = 120;
|
|
16
|
+
export declare const HOVER_DURATION = 300;
|
|
17
|
+
export declare const HOVER_INACTIVE_DURATION = 250;
|
|
18
|
+
export declare const EASE_ENTRY: typeof easeCubicOut;
|
|
19
|
+
export declare const EASE_HOVER: typeof easeCubicOut;
|
|
20
|
+
export declare const EASE_UPDATE: typeof easeCubicInOut;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical series-type classification sets shared across the chart, layout and
|
|
3
|
+
* axis subsystems. Previously each consumer maintained its own inline `Set`,
|
|
4
|
+
* which drifted out of sync (e.g. `treegraph`/`wordcloud` were missing from the
|
|
5
|
+
* layout engine's copy, causing it to reserve cartesian-axis space for them).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Series types that do not use cartesian x/y axes. When every series in a chart
|
|
9
|
+
* is one of these, the chart skips axis construction and cartesian layout.
|
|
10
|
+
*/
|
|
11
|
+
export declare const NO_AXES_TYPES: ReadonlySet<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Series types that render their own data labels (or have no cartesian point
|
|
14
|
+
* geometry), and therefore must not receive the generic cartesian
|
|
15
|
+
* `DataLabels.render` pass.
|
|
16
|
+
*/
|
|
17
|
+
export declare const NON_CARTESIAN_TYPES: ReadonlySet<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Cartesian series types that draw their own data labels internally, so the
|
|
20
|
+
* generic `DataLabels.render` pass should skip them to avoid duplicate labels.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SELF_RENDERED_DATALABEL_TYPES: ReadonlySet<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Series types whose geometry overflows the plot area and must not be clipped.
|
|
25
|
+
*/
|
|
26
|
+
export declare const NO_CLIP_TYPES: ReadonlySet<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Series types whose markers extend beyond data extents and need the plot clip
|
|
29
|
+
* region expanded by a margin.
|
|
30
|
+
*/
|
|
31
|
+
export declare const EXPAND_TYPES: ReadonlySet<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Cartesian series types that should anchor their value axis at zero by default.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ZERO_BASE_TYPES: ReadonlySet<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns true when the given series type uses cartesian x/y axes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hasAxes(internalType: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns true when a chart has series and every one of them is a non-cartesian
|
|
42
|
+
* type — i.e. the chart should skip axis construction and cartesian layout.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isNonCartesianChart(series: ReadonlyArray<{
|
|
45
|
+
_internalType: string;
|
|
46
|
+
}>): boolean;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KatuCharts DataTable — main orchestrator.
|
|
3
|
+
*/
|
|
4
|
+
import type { DataTableOptions, InternalColumnDef, ColumnDefinition, PageInfo, SortState, SortDirection, PinDirection } from '../types/datatable-options';
|
|
5
|
+
import { EventBus } from '../core/EventBus';
|
|
6
|
+
import { type TableApi, type TableHost } from './api/TableApi';
|
|
7
|
+
export declare class DataTable implements TableHost {
|
|
8
|
+
readonly container: HTMLElement;
|
|
9
|
+
readonly events: EventBus;
|
|
10
|
+
private options;
|
|
11
|
+
private resolvedLang;
|
|
12
|
+
private theme;
|
|
13
|
+
private dataSource;
|
|
14
|
+
private processor;
|
|
15
|
+
private columnManager;
|
|
16
|
+
private selectionManager;
|
|
17
|
+
private cellEditor;
|
|
18
|
+
private tableApi;
|
|
19
|
+
private tableRenderer;
|
|
20
|
+
private paginationRenderer;
|
|
21
|
+
private toolbarRenderer;
|
|
22
|
+
private rootEl;
|
|
23
|
+
private tableArea;
|
|
24
|
+
private columns;
|
|
25
|
+
private currentResult;
|
|
26
|
+
private currentPage;
|
|
27
|
+
private currentPageSize;
|
|
28
|
+
private searchQuery;
|
|
29
|
+
private sortState;
|
|
30
|
+
private filterState;
|
|
31
|
+
private groupExpanded;
|
|
32
|
+
private resizeObserver;
|
|
33
|
+
private destroyed;
|
|
34
|
+
private lastResponsiveWidth;
|
|
35
|
+
private refreshing;
|
|
36
|
+
private serverTotal;
|
|
37
|
+
private initialVisibility;
|
|
38
|
+
constructor(containerOrId: string | HTMLElement, options?: DataTableOptions);
|
|
39
|
+
/**
|
|
40
|
+
* Fold a TanStack-style `initialState` block into the matching option
|
|
41
|
+
* groups so the starting page size, sort, hidden columns and filters are
|
|
42
|
+
* honoured on first render.
|
|
43
|
+
*/
|
|
44
|
+
private applyInitialState;
|
|
45
|
+
/** Apply theme variables, data flags, class hooks and explicit container style to the root. */
|
|
46
|
+
private applyRootStyling;
|
|
47
|
+
private init;
|
|
48
|
+
private initAsync;
|
|
49
|
+
private initColumns;
|
|
50
|
+
private renderFull;
|
|
51
|
+
private isFilteringEnabled;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve which toolbar items to show. The column-toggle and export buttons
|
|
54
|
+
* are opt-out via their feature flags (`columnVisibility.enabled` /
|
|
55
|
+
* `exporting.enabled`), and a "reset filters" item is added automatically
|
|
56
|
+
* when filtering is active and not opted out.
|
|
57
|
+
*/
|
|
58
|
+
private resolveToolbarItems;
|
|
59
|
+
private processData;
|
|
60
|
+
private isVirtualEnabled;
|
|
61
|
+
private computeBodyHeight;
|
|
62
|
+
private wireEvents;
|
|
63
|
+
private bindUserEvents;
|
|
64
|
+
private handleSort;
|
|
65
|
+
private handleFilter;
|
|
66
|
+
private handleSearch;
|
|
67
|
+
private refreshRows;
|
|
68
|
+
private getExportData;
|
|
69
|
+
private setupResponsive;
|
|
70
|
+
private showContextMenu;
|
|
71
|
+
getInternalColumns(): InternalColumnDef[];
|
|
72
|
+
getRawData(): any[];
|
|
73
|
+
toggleSort(field: string, desc?: boolean): void;
|
|
74
|
+
setSort(field: string, dir: SortDirection): void;
|
|
75
|
+
clearColumnSort(field: string): void;
|
|
76
|
+
getSortDirection(field: string): SortDirection;
|
|
77
|
+
getFilterValue(field: string): any;
|
|
78
|
+
setColumnFilter(field: string, value: any): void;
|
|
79
|
+
isColumnVisible(field: string): boolean;
|
|
80
|
+
setColumnVisible(field: string, visible: boolean): void;
|
|
81
|
+
isRowSelected(index: number): boolean;
|
|
82
|
+
setRowSelected(index: number, selected: boolean): void;
|
|
83
|
+
isAllPageSelected(): boolean;
|
|
84
|
+
isSomePageSelected(): boolean;
|
|
85
|
+
toggleAllPageSelected(selected: boolean): void;
|
|
86
|
+
setPageSizeValue(size: number): void;
|
|
87
|
+
/** The TanStack Table-compatible facade for use in custom integrations. */
|
|
88
|
+
getTableApi(): TableApi;
|
|
89
|
+
/**
|
|
90
|
+
* Replace all table data. Columns are re-detected if not explicitly set.
|
|
91
|
+
* Use this to feed data from any source (your own fetch, websocket, etc.)
|
|
92
|
+
*/
|
|
93
|
+
setData(data: any[]): void;
|
|
94
|
+
/**
|
|
95
|
+
* Load data from a URL. Fetches JSON and calls setData().
|
|
96
|
+
* Supports GET/POST, custom headers, and response mapping.
|
|
97
|
+
*/
|
|
98
|
+
loadFromUrl(url: string, options?: {
|
|
99
|
+
method?: 'GET' | 'POST';
|
|
100
|
+
headers?: Record<string, string>;
|
|
101
|
+
body?: any;
|
|
102
|
+
responseMapper?: (json: any) => {
|
|
103
|
+
data: any[];
|
|
104
|
+
total?: number;
|
|
105
|
+
};
|
|
106
|
+
}): Promise<void>;
|
|
107
|
+
getData(): any[];
|
|
108
|
+
getFilteredData(): any[];
|
|
109
|
+
getSelectedData(): any[];
|
|
110
|
+
addRow(row: any, index?: number): void;
|
|
111
|
+
removeRow(indexOrPredicate: number | ((row: any) => boolean)): void;
|
|
112
|
+
updateRow(index: number, data: Partial<any>): void;
|
|
113
|
+
updateCell(rowIndex: number, column: string, value: any): void;
|
|
114
|
+
getRow(index: number): any;
|
|
115
|
+
getRowCount(): number;
|
|
116
|
+
getFilteredRowCount(): number;
|
|
117
|
+
getColumns(): ColumnDefinition[];
|
|
118
|
+
updateColumn(field: string, updates: Partial<ColumnDefinition>): void;
|
|
119
|
+
showColumn(field: string): void;
|
|
120
|
+
hideColumn(field: string): void;
|
|
121
|
+
pinColumn(field: string, direction: PinDirection): void;
|
|
122
|
+
sort(column: string, direction?: SortDirection): void;
|
|
123
|
+
clearSort(): void;
|
|
124
|
+
getSortState(): SortState[];
|
|
125
|
+
setFilter(column: string, value: any): void;
|
|
126
|
+
clearFilter(column?: string): void;
|
|
127
|
+
getFilterState(): Record<string, any>;
|
|
128
|
+
search(query: string): void;
|
|
129
|
+
clearSearch(): void;
|
|
130
|
+
goToPage(page: number): void;
|
|
131
|
+
setPageSize(size: number): void;
|
|
132
|
+
getPageInfo(): PageInfo;
|
|
133
|
+
selectRow(index: number | number[]): void;
|
|
134
|
+
deselectRow(index: number | number[]): void;
|
|
135
|
+
selectAll(): void;
|
|
136
|
+
deselectAll(): void;
|
|
137
|
+
getSelectedRows(): any[];
|
|
138
|
+
getSelectedIndices(): number[];
|
|
139
|
+
groupBy(columns: string[]): void;
|
|
140
|
+
ungroup(): void;
|
|
141
|
+
expandGroup(value: any): void;
|
|
142
|
+
collapseGroup(value: any): void;
|
|
143
|
+
expandAll(): void;
|
|
144
|
+
collapseAll(): void;
|
|
145
|
+
exportCSV(opts?: any): void;
|
|
146
|
+
exportJSON(opts?: any): void;
|
|
147
|
+
copyToClipboard(): void;
|
|
148
|
+
getCSV(): string;
|
|
149
|
+
getJSON(): string;
|
|
150
|
+
getHTML(): string;
|
|
151
|
+
update(options: Partial<DataTableOptions>): void;
|
|
152
|
+
/** Switch the active locale at runtime and redraw. Existing `lang` overrides are kept. */
|
|
153
|
+
setLocale(locale: string): void;
|
|
154
|
+
redraw(): void;
|
|
155
|
+
showLoading(text?: string): void;
|
|
156
|
+
hideLoading(): void;
|
|
157
|
+
scrollToRow(index: number): void;
|
|
158
|
+
trigger(action: string, payload?: any): this;
|
|
159
|
+
on(event: string, callback: (...args: any[]) => void): this;
|
|
160
|
+
off(event: string, callback?: (...args: any[]) => void): this;
|
|
161
|
+
destroy(): void;
|
|
162
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default option values for DataTable.
|
|
3
|
+
*/
|
|
4
|
+
import type { DataTableOptions } from '../types/datatable-options';
|
|
5
|
+
export declare const DATA_TABLE_DEFAULTS: DataTableOptions;
|
|
6
|
+
export declare const DENSITY_ROW_HEIGHTS: Record<string, number>;
|
|
7
|
+
export declare const DENSITY_HEADER_HEIGHTS: Record<string, number>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TanStack Table-compatible facade.
|
|
3
|
+
*
|
|
4
|
+
* Column `header`/`cell` callbacks are written against TanStack's `table`,
|
|
5
|
+
* `column` and `row` objects (`row.getValue(id)`, `row.original`,
|
|
6
|
+
* `column.toggleSorting()`, `table.getIsAllPageRowsSelected()`, …). This module
|
|
7
|
+
* reproduces that surface on top of KatuCharts' own engine so familiar
|
|
8
|
+
* TanStack-style column definitions run unchanged.
|
|
9
|
+
*/
|
|
10
|
+
import type { InternalColumnDef, SortDirection, PageInfo, ProcessedRow, ColumnApi, RowApi, TableApi } from '../../types/datatable-options';
|
|
11
|
+
export interface TableHost {
|
|
12
|
+
getInternalColumns(): InternalColumnDef[];
|
|
13
|
+
getRawData(): any[];
|
|
14
|
+
toggleSort(field: string, desc?: boolean): void;
|
|
15
|
+
setSort(field: string, dir: SortDirection): void;
|
|
16
|
+
clearColumnSort(field: string): void;
|
|
17
|
+
getSortDirection(field: string): SortDirection;
|
|
18
|
+
getFilterValue(field: string): any;
|
|
19
|
+
setColumnFilter(field: string, value: any): void;
|
|
20
|
+
isColumnVisible(field: string): boolean;
|
|
21
|
+
setColumnVisible(field: string, visible: boolean): void;
|
|
22
|
+
isRowSelected(index: number): boolean;
|
|
23
|
+
setRowSelected(index: number, selected: boolean): void;
|
|
24
|
+
isAllPageSelected(): boolean;
|
|
25
|
+
isSomePageSelected(): boolean;
|
|
26
|
+
toggleAllPageSelected(selected: boolean): void;
|
|
27
|
+
getPageInfo(): PageInfo;
|
|
28
|
+
goToPage(page: number): void;
|
|
29
|
+
setPageSizeValue(size: number): void;
|
|
30
|
+
}
|
|
31
|
+
export type { ColumnApi, RowApi, TableApi };
|
|
32
|
+
declare function makeColumnApi(host: TableHost, col: InternalColumnDef): ColumnApi;
|
|
33
|
+
export declare function makeRowApi(host: TableHost, row: ProcessedRow): RowApi;
|
|
34
|
+
export declare function createTableApi(host: TableHost): TableApi;
|
|
35
|
+
export { makeColumnApi };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column type detection, normalization, and processing.
|
|
3
|
+
*/
|
|
4
|
+
import type { ColumnDefinition, ColumnType, FilterType, InternalColumnDef, AlignType } from '../../types/datatable-options';
|
|
5
|
+
export declare function detectColumnType(values: any[]): ColumnType;
|
|
6
|
+
export declare function inferColumnsFromData(data: any[]): ColumnDefinition[];
|
|
7
|
+
export declare function defaultAlignForType(type?: ColumnType): AlignType;
|
|
8
|
+
export declare function defaultFilterTypeForColumn(col: ColumnDefinition): FilterType;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a column's value for a row, honouring an `accessorFn` (TanStack) when
|
|
11
|
+
* present and otherwise reading the flat `field`/`accessorKey`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveCellValue(row: any, col: ColumnDefinition): any;
|
|
14
|
+
export declare function normalizeColumns(columns: ColumnDefinition[], containerWidth: number, sample?: any[], reservedWidth?: number): InternalColumnDef[];
|
|
15
|
+
export declare function getVisibleColumns(columns: InternalColumnDef[]): InternalColumnDef[];
|
|
16
|
+
export declare function computePinnedOffsets(columns: InternalColumnDef[]): void;
|