0
文書(http://js.cytoscape.org/#eles.remove/http://js.cytoscape.org/#eles.restore)によれば、eles.restore()
メソッドを使用すると、以前に削除した要素をグラフから復元することができます。要素を復元していないサイトスコープ
しかし、私はこのサイトのすべての要素を復元できません。
applyElementFilters =() => {
const excluded = [1, 2, 3];
// Restore all elements first, this apparently does nothing
this.cy.elements().restore();
if (excluded && excluded.length > 0) {
const excludedElements = this.cy
.elements()
.filter(element => excluded.includes(element.data("id")));
this.cy.remove(excludedElements);
}
};
ああ、私は確かに、 ":removed"セレクタを使って見つけることができました。 – janhartmann
期待どおりに動作する場合は、マークを付けてください。 :) –
1分が残っています! ;-) – janhartmann