softwords opened a new issue #12763:
URL: https://github.com/apache/incubator-echarts/issues/12763
### Version
4.8.0
### Steps to reproduce
Some problems in typescript definitions `@types\echarts` (v4.6.1) for sankey
series cause compilation errors in typescript:
`name` is missing - this causes problems even when not working with sankey
chart.
`nodeAlign` is missing
`links` is defined as a single link object - should be an array of such
objects
### What is expected?
These snippets should compile:
1)
```
let option:echarts:EChartOption = { };
let seriesNames = option.series.map(s => s.name);
```
2)
```
let series: echarts.EChartOption.SeriesSankey = {
type: 'sankey',
focusNodeAdjacency: 'allEdges',
data: [{
name: 'a'
}, {
name: 'b'
}, {
name: 'a1'
}, {
name: 'a2'
}, {
name: 'b1'
}, {
name: 'c'
}],
links: [{
source: 'a',
target: 'a1',
value: 5
}, {
source: 'a',
target: 'a2',
value: 3
}, {
source: 'b',
target: 'b1',
value: 8
}, {
source: 'a',
target: 'b1',
value: 3
}, {
source: 'b1',
target: 'a1',
value: 1
}, {
source: 'b1',
target: 'c',
value: 2
}]
};
```
### What is actually happening?
1)
compilation error:
```
Property 'name' does not exist on type 'Series'.
Property 'name' does not exist on type 'SeriesSankey'.
```
2)
compilation error:
```
error TS2559: Type '{ source: string; target: string; value: number; }[]'
has no properties in common with type
'{ source?: string; target?: string; value?: number; lineStyle?: { color?:
string; opacity?:
number; curveness?: number; shadowBlur?: number; shadowColor?: string;
shadowOffsetX?: number; shadowOffsetY?: number; }; emphasis?: { ...; }; }'.
```
---
Not sure if this is the right place to report this, since the issue is in
the echarts .d.ts files, not echarts itself....
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]