From 30c7d671a9927670f400578f5deed10c863b82d4 Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 26 Mar 2024 18:40:51 +0800 Subject: [PATCH] update --- src/elem.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/elem.js b/src/elem.js index d2fd633..538ac12 100644 --- a/src/elem.js +++ b/src/elem.js @@ -73,6 +73,8 @@ export class Component { return out } + /* ------------------------------ */ + g(...args) { let el = this.#create('g') if (args.length) { @@ -103,6 +105,14 @@ export class Component { 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) { return this.#create('path', { d }) }