master
yutent 2024-03-26 18:40:51 +08:00
parent 00889573db
commit 30c7d671a9
1 changed files with 10 additions and 0 deletions

View File

@ -73,6 +73,8 @@ export class Component {
return out return out
} }
/* ------------------------------ */
g(...args) { g(...args) {
let el = this.#create('g') let el = this.#create('g')
if (args.length) { if (args.length) {
@ -103,6 +105,14 @@ export class Component {
return this.#create('foreignObject', { x, y, width, height }, text) return this.#create('foreignObject', { x, y, width, height }, text)
} }
line(x1, y1, x2, y2, attr = {}) {
return this.#create('line', { x1, y1, x2, y2, ...attr })
}
polyline(...points) {
return this.#create('polyline', { points })
}
path(d) { path(d) {
return this.#create('path', { d }) return this.#create('path', { d })
} }