vmihailenco opened a new issue, #19230:
URL: https://github.com/apache/echarts/issues/19230
### What problem does this feature solve?
Currently calling `setOption` causes force graph to update nodes position
which makes any kind of interactivity impossible:
- user hovers over the node
- setOption is called to show the node label
- force layout is triggered and the whole graph is re-arranged
```
{ type: 'graph', layout: 'force' }
```
This behavior can be seen on this
[example](https://echarts.apache.org/examples/en/editor.html?c=graph-force-dynamic)
which constantly adds new nodes. But it is the same if you just show/hide
labels via `setOption`.
### What does the proposed API look like?
Add an option to not update the layout:
```js
echarts.setOption(option, { preserveLayout: true })
```
Some libraries like Cytoscape have a separate API to update the layout when
needed:
```js
const layout = echarts.layout()
layout.run()
```
--
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]