ywx-sss opened a new pull request, #21893:
URL: https://github.com/apache/echarts/pull/21893

   Fixes #21887
   
   ## Problem
   
   `chord` with duplicate or empty node names crashes inside `Graph.update()`:
   
   ```text
   TypeError: Cannot set properties of undefined (setting 'dataIndex')
       at Graph.update
       at createGraphFromNodeEdge
       at ChordSeriesModel.getInitialData
   ```
   
   `Graph.addNode()` returns early when the node key already exists, so 
`graph.nodes`
   has fewer entries than the data; `Graph.update()` then indexes a missing 
node.
   
   ## Fix
   
   Validate chord node ids/names in `ChordSeries.getInitialData` before 
creating the graph:
   
   - empty name/id throws `Chord series: node name or id must not be empty.`
   - duplicate name/id throws `Chord series: duplicate node name or id "a" is 
not supported.`
   
   This is scoped to chord so graph/sankey behavior is unchanged.
   
   ## Tests
   
   Added `test/ut/spec/series/chord.test.ts` for both cases using `createChart` 
and
   `toThrow`.
   
   Thanks to @schizophrenicmaniac for the root-cause analysis in the issue.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to