You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/09/16 06:19:22 UTC
[echarts] branch series-type-register created (now a11d9af)
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a change to branch series-type-register
in repository https://gitbox.apache.org/repos/asf/echarts.git.
at a11d9af feat(type): provide ability to extend series option
This branch includes the following new commits:
new a11d9af feat(type): provide ability to extend series option
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[echarts] 01/01: feat(type): provide ability to extend series option
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch series-type-register
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit a11d9af6f9633bf70142e0e8b02e4e5728c3db98
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Sep 16 14:17:37 2021 +0800
feat(type): provide ability to extend series option
---
src/export/option.ts | 63 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 41 insertions(+), 22 deletions(-)
diff --git a/src/export/option.ts b/src/export/option.ts
index 4980e43..dff46af 100644
--- a/src/export/option.ts
+++ b/src/export/option.ts
@@ -201,28 +201,47 @@ export type ThemeRiverSeriesOption = ThemeRiverSeriesOptionInner & SeriesInjecte
export type SunburstSeriesOption = SunburstSeriesOptionInner & SeriesInjectedOption;
export type CustomSeriesOption = CustomSeriesOptionInner & SeriesInjectedOption;
-export type SeriesOption = LineSeriesOption
- | BarSeriesOption
- | ScatterSeriesOption
- | PieSeriesOption
- | RadarSeriesOption
- | MapSeriesOption
- | TreeSeriesOption
- | TreemapSeriesOption
- | GraphSeriesOption
- | GaugeSeriesOption
- | FunnelSeriesOption
- | ParallelSeriesOption
- | SankeySeriesOption
- | BoxplotSeriesOption
- | CandlestickSeriesOption
- | EffectScatterSeriesOption
- | LinesSeriesOption
- | HeatmapSeriesOption
- | PictorialBarSeriesOption
- | ThemeRiverSeriesOption
- | SunburstSeriesOption
- | CustomSeriesOption;
+
+/**
+ * A map from series 'type' to series option
+ * It's used for declaration merging in echarts extensions.
+ * For example:
+ * ```ts
+ * import echarts from 'echarts';
+ * declare module 'echarts/types/dist/echarts' {
+ * interface RegisteredSeriesOption {
+ * wordCloud: WordCloudSeriesOption
+ * }
+ * }
+ * ```
+ */
+export interface RegisteredSeriesOption {
+ line: LineSeriesOption
+ bar: BarSeriesOption
+ scatter: ScatterSeriesOption
+ pie: PieSeriesOption
+ radar: RadarSeriesOption
+ map: MapSeriesOption
+ tree: TreeSeriesOption
+ treemap: TreemapSeriesOption
+ graph: GraphSeriesOption
+ gauge: GaugeSeriesOption
+ funnel: FunnelSeriesOption
+ parallel: ParallelSeriesOption
+ sankey: SankeySeriesOption
+ boxplot: BoxplotSeriesOption
+ candlestick: CandlestickSeriesOption
+ effectScatter: EffectScatterSeriesOption
+ lines: LinesSeriesOption
+ heatmap: HeatmapSeriesOption
+ pictorialBar: PictorialBarSeriesOption
+ themeRiver: ThemeRiverSeriesOption
+ sunburst: SunburstSeriesOption
+ custom: CustomSeriesOption
+}
+type Values<T> = T[keyof T];
+
+export type SeriesOption = Values<RegisteredSeriesOption>;
export interface EChartsOption extends ECBasicOption {
dataset?: DatasetComponentOption | DatasetComponentOption[];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org