[echarts] minor corrections to sankey series (#45354)

* [echarts] minor corrections to sankey series

* [echarts]: add 'name' to themeriver; simple test
This commit is contained in:
Brian Lewis 2020-06-25 23:54:52 +10:00 committed by GitHub
parent 9eb48c844d
commit 9896e0ce66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 229 additions and 190 deletions

View File

@ -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]);

View File

@ -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;
};
};
}
}
}
}

View File

@ -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

View File

@ -18,6 +18,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
"index.d.ts",
"echarts-tests.ts"
]
}