Create metric selector via JS
This commit is contained in:
parent
8c7399725d
commit
d82804e209
9 changed files with 187 additions and 192 deletions
11
scripts/graph/util.ts
Normal file
11
scripts/graph/util.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Create an {@link HTMLElement}.
|
||||
*/
|
||||
export function el(name: string, attributes: { [key: string]: string; }, ...children: (string | Node)[]) {
|
||||
let element = document.createElement(name);
|
||||
for (let [name, value] of Object.entries(attributes)) {
|
||||
element.setAttribute(name, value);
|
||||
}
|
||||
element.append(...children);
|
||||
return element;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue