diff --git a/types/echarts/echarts-tests.ts b/types/echarts/echarts-tests.ts new file mode 100644 index 0000000000..0eb3c36b32 --- /dev/null +++ b/types/echarts/echarts-tests.ts @@ -0,0 +1,8 @@ +import * as echarts from 'echarts' + +const option:echarts.EChartOption = { + series:[] +}; + +// id, type, and name are defined for every series type +const map = option.series!.map( s => [s.id, s.name, s.type]); diff --git a/types/echarts/options/series/sankey.d.ts b/types/echarts/options/series/sankey.d.ts index 0a7381f6c3..dc53b4b9ba 100644 --- a/types/echarts/options/series/sankey.d.ts +++ b/types/echarts/options/series/sankey.d.ts @@ -51,6 +51,15 @@ declare namespace echarts { */ id?: string; + /** + * Series name used for displaying in + * [tooltip](https://echarts.apache.org/en/option.html#tooltip) + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.name + */ + name?: string; + /** * `zlevel` value of all graghical elements in . * @@ -183,6 +192,17 @@ declare namespace echarts { */ nodeGap?: number; + /** + * Alignment of nodes in the graph. + * + * May be 'left', 'right' or 'justify' + * + * @default + * justify + * @see https://echarts.apache.org/en/option.html#series-sankey.nodeAlign + */ + nodeAlign?: string; + /** * The iterations of layout, which is used to continuously optimize * the positions of nodes in graph, decreasing the overlapping between @@ -2277,194 +2297,7 @@ declare namespace echarts { * * @see https://echarts.apache.org/en/option.html#series-sankey.links */ - links?: { - - /** - * The - * [name of source node](https://echarts.apache.org/en/option.html#series-graph.data.name) - * of edge - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.source - */ - source?: string; - - /** - * The - * [name of target node](https://echarts.apache.org/en/option.html#series-graph.data.name) - * of edge - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.target - */ - target?: string; - - /** - * The value of edge, which decides the width of edge. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.value - */ - value?: number; - - /** - * The line stlye of edge. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle - */ - lineStyle?: { - - /** - * The color of the edge in sankey graphs. - * - * - * @default - * "'#314656" - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.color - */ - color?: string; - - /** - * The opacity of the edge in sankey graph. - * - * - * @default - * 0.2 - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.opacity - */ - opacity?: number; - - /** - * The curveness of the edge in sankey graph. - * - * - * @default - * 0.5 - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.curveness - */ - curveness?: number; - - /** - * Size of shadow blur. - * This attribute should be used along with `shadowColor`,`shadowOffsetX`, - * `shadowOffsetY` to set shadow to component. - * - * For example: - * - * [see doc](https://echarts.apache.org/en/option.html#series-sankey.sankey.links.lineStyle) - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowBlur - */ - shadowBlur?: number; - - /** - * Shadow color. Support same format as `color`. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowColor - */ - shadowColor?: string; - - /** - * Offset distance on the horizontal direction of shadow. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowOffsetX - */ - shadowOffsetX?: number; - - /** - * Offset distance on the vertical direction of shadow. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowOffsetY - */ - shadowOffsetY?: number; - }; - - /** - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis - */ - emphasis?: { - - /** - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle - */ - lineStyle?: { - - /** - * The color of the edge in sankey graphs. - * - * - * @default - * "'#314656" - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.color - */ - color?: string; - - /** - * The opacity of the edge in sankey graph. - * - * - * @default - * 0.2 - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.opacity - */ - opacity?: number; - - /** - * The curveness of the edge in sankey graph. - * - * - * @default - * 0.5 - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.curveness - */ - curveness?: number; - - /** - * Size of shadow blur. - * This attribute should be used along with `shadowColor`,`shadowOffsetX`, - * `shadowOffsetY` to set shadow to component. - * - * For example: - * - * [see doc](https://echarts.apache.org/en/option.html#series-sankey.sankey.links.emphasis.lineStyle) - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowBlur - */ - shadowBlur?: number; - - /** - * Shadow color. Support same format as `color`. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowColor - */ - shadowColor?: string; - - /** - * Offset distance on the horizontal direction of shadow. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowOffsetX - */ - shadowOffsetX?: number; - - /** - * Offset distance on the vertical direction of shadow. - * - * - * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowOffsetY - */ - shadowOffsetY?: number; - }; - }; - }; - + links?: SeriesSankey.LinkObject[]; /** * Equals to * [links](https://echarts.apache.org/en/option.html#series-sankey.links) @@ -4361,6 +4194,194 @@ declare namespace echarts { */ tooltip?: BaseTooltip; } + + interface LinkObject { + + /** + * The + * [name of source node](https://echarts.apache.org/en/option.html#series-graph.data.name) + * of edge + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.source + */ + source?: string; + + /** + * The + * [name of target node](https://echarts.apache.org/en/option.html#series-graph.data.name) + * of edge + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.target + */ + target?: string; + + /** + * The value of edge, which decides the width of edge. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.value + */ + value?: number; + + /** + * The line stlye of edge. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle + */ + lineStyle?: { + + /** + * The color of the edge in sankey graphs. + * + * + * @default + * "'#314656" + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.color + */ + color?: string; + + /** + * The opacity of the edge in sankey graph. + * + * + * @default + * 0.2 + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.opacity + */ + opacity?: number; + + /** + * The curveness of the edge in sankey graph. + * + * + * @default + * 0.5 + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.curveness + */ + curveness?: number; + + /** + * Size of shadow blur. + * This attribute should be used along with `shadowColor`,`shadowOffsetX`, + * `shadowOffsetY` to set shadow to component. + * + * For example: + * + * [see doc](https://echarts.apache.org/en/option.html#series-sankey.sankey.links.lineStyle) + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowBlur + */ + shadowBlur?: number; + + /** + * Shadow color. Support same format as `color`. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowColor + */ + shadowColor?: string; + + /** + * Offset distance on the horizontal direction of shadow. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowOffsetX + */ + shadowOffsetX?: number; + + /** + * Offset distance on the vertical direction of shadow. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.lineStyle.shadowOffsetY + */ + shadowOffsetY?: number; + }; + + /** + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis + */ + emphasis?: { + + /** + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle + */ + lineStyle?: { + + /** + * The color of the edge in sankey graphs. + * + * + * @default + * "'#314656" + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.color + */ + color?: string; + + /** + * The opacity of the edge in sankey graph. + * + * + * @default + * 0.2 + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.opacity + */ + opacity?: number; + + /** + * The curveness of the edge in sankey graph. + * + * + * @default + * 0.5 + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.curveness + */ + curveness?: number; + + /** + * Size of shadow blur. + * This attribute should be used along with `shadowColor`,`shadowOffsetX`, + * `shadowOffsetY` to set shadow to component. + * + * For example: + * + * [see doc](https://echarts.apache.org/en/option.html#series-sankey.sankey.links.emphasis.lineStyle) + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowBlur + */ + shadowBlur?: number; + + /** + * Shadow color. Support same format as `color`. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowColor + */ + shadowColor?: string; + + /** + * Offset distance on the horizontal direction of shadow. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowOffsetX + */ + shadowOffsetX?: number; + + /** + * Offset distance on the vertical direction of shadow. + * + * + * @see https://echarts.apache.org/en/option.html#series-sankey.links.emphasis.lineStyle.shadowOffsetY + */ + shadowOffsetY?: number; + }; + }; + } } } } diff --git a/types/echarts/options/series/theme-river.d.ts b/types/echarts/options/series/theme-river.d.ts index e976d0fc73..ec30231adf 100644 --- a/types/echarts/options/series/theme-river.d.ts +++ b/types/echarts/options/series/theme-river.d.ts @@ -42,7 +42,16 @@ declare namespace echarts { id?: string; /** - * `zlevel` value of all graghical elements in . + * Series name used for displaying in + * [tooltip](https://echarts.apache.org/en/option.html#tooltip) + * + * + * @see https://echarts.apache.org/en/option.html#series-themeRiver.name + */ + name?: string; + + /** + * `zlevel` value of all graphical elements in the series. * * `zlevel` is used to make layers with Canvas. * Graphical elements with different `zlevel` values will be placed diff --git a/types/echarts/tsconfig.json b/types/echarts/tsconfig.json index 71e6b79545..c2e21410f8 100644 --- a/types/echarts/tsconfig.json +++ b/types/echarts/tsconfig.json @@ -18,6 +18,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "echarts-tests.ts" ] }