G6 icon indicating copy to clipboard operation
G6 copied to clipboard

[Feat]: More sophisticated way of managing states

Open Bergiu opened this issue 1 year ago • 0 comments

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 / 是

Bergiu avatar Mar 16 '25 11:03 Bergiu