import type { ECharts as Instance , EChartsOption as Configuration } from 'echarts' ; import { BaseChartisan , BaseChartisanOptions , Setup } from '@chartisan/chartisan' ; import { Echarts } from './Chart' ; import { Controller } from './Controller' ; import { Builder } from './Builder' ; export type ChartisanOptions < Meta = unknown > = BaseChartisanOptions < Instance , Configuration , Meta , Builder > ; export class Chartisan < Meta = unknown > extends BaseChartisan < Instance , Configuration , Meta , Builder > { param name returns throws public static chart < Meta = unknown > ( name ) { if ( name in Chartisan . charts ) { return Chartisan . charts [ name ] as unknown as BaseChartisan < Instance , Configuration , Meta , Builder > ; } throw new Error ( `Unable to find a chart named '${ name }'.` ) ; } return { Setup < Instance , Configuration , Meta > } protected setup ( ) { return { provider : new Echarts ( ) , builder : new Builder ( { xAxis : { } , yAxis : { } , series : [ ] , } ) , defaultController : new Controller < Meta > ( ) , } ; } } if ( typeof window !== 'undefined' && window . Chartisan === undefined ) window . Chartisan = Chartisan ;