antvis/G6
Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Feat]: More sophisticated way of managing states #6872
Bergiu posted onGitHub
Describe the feature / 功能描述
I'd like to add / remove a single state from a node.
Currently this could be done the following way:
graph.setElementState(node.id, [...node.states, add_state]);
graph.setElementState(node.id, node.states.filter(s => s !== rm_state));
The graph api could be improved by adding graph.addState(node, state)
and graph.removeState(node, state)
.
Are you willing to contribute? / 是否愿意参与贡献?
✅ Yes / 是