Skip to content

Commit

Permalink
implement cloneNode
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 6, 2024
1 parent 5478728 commit 4324fa0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/components/PlotRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ class Element {
child.parentNode = this;
return child;
}
cloneNode(deep) {
const clone = new Element(this.ownerDocument, this.tagName);
clone.attributes = {...this.attributes};
if (deep) clone.children = this.children.map((child) => child.cloneNode(deep));
return clone;
}
querySelector() {
return null;
}
Expand Down

0 comments on commit 4324fa0

Please sign in to comment.