-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepareSVG.js
36 lines (28 loc) · 1.01 KB
/
prepareSVG.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export default function () {
// elements to be removed or guide the removal
const svg = document.querySelector("svg");
const hours = svg.querySelector("g:nth-child(18)");
const horizontalAxisGroup = svg.querySelectorAll(".Figure-HorizontalAxis-group");
const hoverRectangles = svg.querySelectorAll(".Figure-hoverRect");
const nowLineAndText = svg.querySelectorAll(".now");
const lines = svg.querySelector(".pointer_events_none");
const defs = svg.querySelector("defs");
defs.remove();
hoverRectangles.forEach((rect) => {
rect.remove();
});
nowLineAndText.forEach((n) => n.remove());
svg.removeChild(hours);
// moves inner month text outside of the parent. and removes the link.
horizontalAxisGroup.forEach((h) => {
h.outerHTML = h.innerHTML;
h.remove();
});
lines.remove();
const g = svg.querySelectorAll("g");
// remove every g element after the first g element.
for (let i = 1; i < g.length; i++) {
g[i].remove();
}
svg.setAttribute("viewBox", "75 10 603 375");
}