@echelon-framework/charts-core
v0.7.1
Published
Chart adapter contract + config types for Echelon visualisation widgets.
Maintainers
Readme
@echelon-framework/charts-core
Abstract chart interface for the Echelon framework. Adapter pattern — implement once, swap libraries freely.
Part of the Echelon Framework — Angular-based, config-driven dashboard & low-code platform.
Installation
npm install @echelon-framework/charts-coreArchitecture
charts-core (this package) charts-echarts (adapter)
ChartAdapter interface → EChartsAdapter implements ChartAdapter
ChartConfig types → maps to ECharts options
ChartDataset → feeds ECharts seriesUsage
import type { ChartAdapter, ChartConfig, ChartDataset } from '@echelon-framework/charts-core';
interface ChartConfig {
readonly type: 'line' | 'bar' | 'pie' | 'scatter' | 'candlestick' | 'area';
readonly title?: string;
readonly xAxis?: AxisConfig;
readonly yAxis?: AxisConfig;
readonly legend?: boolean;
readonly tooltip?: boolean;
readonly animate?: boolean;
}
interface ChartDataset {
readonly label: string;
readonly data: ReadonlyArray<number | [number, number]>;
readonly color?: string;
}Implementing an adapter
import type { ChartAdapter } from '@echelon-framework/charts-core';
export class MyChartAdapter implements ChartAdapter {
render(container: HTMLElement, config: ChartConfig, datasets: ChartDataset[]): void {
// Your rendering logic (D3, Chart.js, Highcharts, etc.)
}
update(datasets: ChartDataset[]): void {
/* ... */
}
destroy(): void {
/* ... */
}
}Available adapters
@echelon-framework/charts-echarts— Apache ECharts (default)
License
BUSL-1.1
