diff --git a/src/model/series/area-series.ts b/src/model/series/area-series.ts index a43c53edc..3b173a3fa 100644 --- a/src/model/series/area-series.ts +++ b/src/model/series/area-series.ts @@ -25,18 +25,12 @@ export const areaStyleDefaults: AreaStyleOptions = { pointMarkersVisible: false, }; -export class AreaSeries implements BuiltInSeriesDefinition<'Area'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Area' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; - public readonly defaultOptions: AreaStyleOptions = areaStyleDefaults; +export const areaSeries: BuiltInSeriesDefinition<'Area'> = { + type: 'Area' as const, + isBuiltIn: true as const, + defaultOptions: areaStyleDefaults, /** * @internal */ - public createPaneView(series: ISeries<'Area'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesAreaPaneView(series, model); - } -} - -export const areaSeries = new AreaSeries(); + createPaneView: (series: ISeries<'Area'>, model: IChartModelBase): IUpdatablePaneView => new SeriesAreaPaneView(series, model), +}; diff --git a/src/model/series/bar-series.ts b/src/model/series/bar-series.ts index be6af6c7f..bc208eb49 100644 --- a/src/model/series/bar-series.ts +++ b/src/model/series/bar-series.ts @@ -13,19 +13,24 @@ export const barStyleDefaults: BarStyleOptions = { thinBars: true, }; -export class BarSeries implements BuiltInSeriesDefinition<'Bar'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Bar' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; +// export class BarSeries implements BuiltInSeriesDefinition<'Bar'> { +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly type = 'Bar' as const; +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly isBuiltIn = true as const; - public readonly defaultOptions: BarStyleOptions = barStyleDefaults; - /** - * @internal - */ - public createPaneView(series: ISeries<'Bar'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesBarsPaneView(series, model); - } -} +// public readonly defaultOptions: BarStyleOptions = barStyleDefaults; +// /** +// * @internal +// */ +// public createPaneView(series: ISeries<'Bar'>, model: IChartModelBase): IUpdatablePaneView { +// return new SeriesBarsPaneView(series, model); +// } +// } -export const barSeries = new BarSeries(); +export const barSeries: BuiltInSeriesDefinition<'Bar'> = { + type: 'Bar' as const, + isBuiltIn: true as const, + defaultOptions: barStyleDefaults, + createPaneView: (series: ISeries<'Bar'>, model: IChartModelBase): IUpdatablePaneView => new SeriesBarsPaneView(series, model), +}; diff --git a/src/model/series/baseline-series.ts b/src/model/series/baseline-series.ts index 86b8584d0..e0fe98fc4 100644 --- a/src/model/series/baseline-series.ts +++ b/src/model/series/baseline-series.ts @@ -36,18 +36,23 @@ export const baselineStyleDefaults: BaselineStyleOptions = { pointMarkersVisible: false, }; -export class BaselineSeries implements BuiltInSeriesDefinition<'Baseline'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Baseline' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; - public readonly defaultOptions: BaselineStyleOptions = baselineStyleDefaults; - /** - * @internal - */ - public createPaneView(series: ISeries<'Baseline'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesBaselinePaneView(series, model); - } -} - -export const baselineSeries = new BaselineSeries(); +// export class BaselineSeries implements BuiltInSeriesDefinition<'Baseline'> { +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly type = 'Baseline' as const; +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly isBuiltIn = true as const; +// public readonly defaultOptions: BaselineStyleOptions = baselineStyleDefaults; +// /** +// * @internal +// */ +// public createPaneView(series: ISeries<'Baseline'>, model: IChartModelBase): IUpdatablePaneView { +// return new SeriesBaselinePaneView(series, model); +// } +// } +export const baselineSeries: BuiltInSeriesDefinition<'Baseline'> = { + type: 'Baseline' as const, + isBuiltIn: true as const, + defaultOptions: baselineStyleDefaults, + createPaneView: (series: ISeries<'Baseline'>, model: IChartModelBase): IUpdatablePaneView => new SeriesBaselinePaneView(series, model), +}; + diff --git a/src/model/series/candlestick-series.ts b/src/model/series/candlestick-series.ts index f8bde81cb..40adf6833 100644 --- a/src/model/series/candlestick-series.ts +++ b/src/model/series/candlestick-series.ts @@ -20,18 +20,23 @@ export const candlestickStyleDefaults: CandlestickStyleOptions = { wickDownColor: '#ef5350', }; -export class CandlestickSeries implements BuiltInSeriesDefinition<'Candlestick'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Candlestick' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; - public readonly defaultOptions: CandlestickStyleOptions = candlestickStyleDefaults; - /** - * @internal - */ - public createPaneView(series: ISeries<'Candlestick'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesCandlesticksPaneView(series, model); - } -} +// export class CandlestickSeries implements BuiltInSeriesDefinition<'Candlestick'> { +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly type = 'Candlestick' as const; +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly isBuiltIn = true as const; +// public readonly defaultOptions: CandlestickStyleOptions = candlestickStyleDefaults; +// /** +// * @internal +// */ +// public createPaneView(series: ISeries<'Candlestick'>, model: IChartModelBase): IUpdatablePaneView { +// return new SeriesCandlesticksPaneView(series, model); +// } +// } -export const candlestickSeries = new CandlestickSeries(); +export const candlestickSeries: BuiltInSeriesDefinition<'Candlestick'> = { + type: 'Candlestick' as const, + isBuiltIn: true as const, + defaultOptions: candlestickStyleDefaults, + createPaneView: (series: ISeries<'Candlestick'>, model: IChartModelBase): IUpdatablePaneView => new SeriesCandlesticksPaneView(series, model), +}; diff --git a/src/model/series/histogram-series.ts b/src/model/series/histogram-series.ts index fda7b9a31..8e61d453d 100644 --- a/src/model/series/histogram-series.ts +++ b/src/model/series/histogram-series.ts @@ -12,18 +12,23 @@ export const histogramStyleDefaults: HistogramStyleOptions = { base: 0, }; -export class HistogramSeries implements BuiltInSeriesDefinition<'Histogram'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Histogram' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; - public readonly defaultOptions: HistogramStyleOptions = histogramStyleDefaults; - /** - * @internal - */ - public createPaneView(series: ISeries<'Histogram'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesHistogramPaneView(series, model); - } -} +// export class HistogramSeries implements BuiltInSeriesDefinition<'Histogram'> { +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly type = 'Histogram' as const; +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly isBuiltIn = true as const; +// public readonly defaultOptions: HistogramStyleOptions = histogramStyleDefaults; +// /** +// * @internal +// */ +// public createPaneView(series: ISeries<'Histogram'>, model: IChartModelBase): IUpdatablePaneView { +// return new SeriesHistogramPaneView(series, model); +// } +// } +export const histogramSeries: BuiltInSeriesDefinition<'Histogram'> = { + type: 'Histogram' as const, + isBuiltIn: true as const, + defaultOptions: histogramStyleDefaults, + createPaneView: (series: ISeries<'Histogram'>, model: IChartModelBase): IUpdatablePaneView => new SeriesHistogramPaneView(series, model), +}; -export const histogramSeries = new HistogramSeries(); diff --git a/src/model/series/line-series.ts b/src/model/series/line-series.ts index d688b3f84..e646026e5 100644 --- a/src/model/series/line-series.ts +++ b/src/model/series/line-series.ts @@ -21,21 +21,27 @@ export const lineStyleDefaults: LineStyleOptions = { lastPriceAnimation: LastPriceAnimationMode.Disabled, pointMarkersVisible: false, }; + +// export class LineSeries implements BuiltInSeriesDefinition<'Line'> { +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly type = 'Line' as const; +// // eslint-disable-next-line @typescript-eslint/tslint/config +// public readonly isBuiltIn = true as const; +// public readonly defaultOptions: LineStyleOptions = lineStyleDefaults; +// /** +// * @internal +// */ +// public createPaneView(series: ISeries<'Line'>, model: IChartModelBase): IUpdatablePaneView { +// return new SeriesLinePaneView(series, model); +// } +// } /* * Line series */ -export class LineSeries implements BuiltInSeriesDefinition<'Line'> { - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly type = 'Line' as const; - // eslint-disable-next-line @typescript-eslint/tslint/config - public readonly isBuiltIn = true as const; - public readonly defaultOptions: LineStyleOptions = lineStyleDefaults; - /** - * @internal - */ - public createPaneView(series: ISeries<'Line'>, model: IChartModelBase): IUpdatablePaneView { - return new SeriesLinePaneView(series, model); - } -} +export const lineSeries: BuiltInSeriesDefinition<'Line'> = { + type: 'Line' as const, + isBuiltIn: true as const, + defaultOptions: lineStyleDefaults, + createPaneView: (series: ISeries<'Line'>, model: IChartModelBase): IUpdatablePaneView => new SeriesLinePaneView(series, model), +}; -export const lineSeries = new LineSeries();