@thi.ng/hiccup-svg 5.5.18 → 5.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/convert.js +1 -1
- package/format.js +2 -2
- package/package.json +6 -6
- package/path.js +1 -1
- package/points.js +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/convert.js
CHANGED
|
@@ -167,7 +167,7 @@ const convertTree = (tree) => {
|
|
|
167
167
|
const __convertAttribs = (attribs) => {
|
|
168
168
|
const res = {};
|
|
169
169
|
if (!attribs) return res;
|
|
170
|
-
for (
|
|
170
|
+
for (const id in attribs) {
|
|
171
171
|
const v = attribs[id];
|
|
172
172
|
const aid = ATTRIB_ALIASES[id];
|
|
173
173
|
if (aid) {
|
package/format.js
CHANGED
|
@@ -14,7 +14,7 @@ const DEFAULT_NUMERIC_IDS = [
|
|
|
14
14
|
];
|
|
15
15
|
const __numericAttribs = (attribs, ids) => {
|
|
16
16
|
let v;
|
|
17
|
-
for (
|
|
17
|
+
for (const id of DEFAULT_NUMERIC_IDS.concat(ids)) {
|
|
18
18
|
typeof (v = attribs[id]) === "number" && (attribs[id] = ff(v));
|
|
19
19
|
}
|
|
20
20
|
return attribs;
|
|
@@ -63,7 +63,7 @@ const __buildTransform = (attribs) => {
|
|
|
63
63
|
const fcolor = (col) => isString(col) ? col[0] === "$" ? `url(#${col.substring(1)})` : col : css(col);
|
|
64
64
|
const withoutKeys = (src, keys) => {
|
|
65
65
|
const dest = {};
|
|
66
|
-
for (
|
|
66
|
+
for (const k in src) {
|
|
67
67
|
src.hasOwnProperty(k) && !keys.has(k) && (dest[k] = src[k]);
|
|
68
68
|
}
|
|
69
69
|
return dest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hiccup-svg",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.20",
|
|
4
4
|
"description": "SVG element functions for @thi.ng/hiccup & related tooling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/checks": "^3.
|
|
44
|
-
"@thi.ng/color": "^5.8.
|
|
45
|
-
"@thi.ng/prefixes": "^2.3.
|
|
42
|
+
"@thi.ng/api": "^8.12.10",
|
|
43
|
+
"@thi.ng/checks": "^3.8.0",
|
|
44
|
+
"@thi.ng/color": "^5.8.5",
|
|
45
|
+
"@thi.ng/prefixes": "^2.3.61"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"esbuild": "^0.27.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"parent": "@thi.ng/hiccup",
|
|
143
143
|
"year": 2016
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
|
|
146
146
|
}
|
package/path.js
CHANGED
|
@@ -2,7 +2,7 @@ import { fattribs, ff, fpoint, fpoints } from "./format.js";
|
|
|
2
2
|
const DEG = 180 / Math.PI;
|
|
3
3
|
const path = (segments, attribs, ...body) => {
|
|
4
4
|
let res = [];
|
|
5
|
-
for (
|
|
5
|
+
for (const seg of segments) {
|
|
6
6
|
res.push(seg[0]);
|
|
7
7
|
switch (seg[0].toLowerCase()) {
|
|
8
8
|
case "a":
|
package/points.js
CHANGED
|
@@ -6,7 +6,7 @@ const points = (pts, shape, size = 1, attribs, ...body) => {
|
|
|
6
6
|
...body
|
|
7
7
|
];
|
|
8
8
|
const href = __buildSymbol(group, shape, size);
|
|
9
|
-
for (
|
|
9
|
+
for (const p of pts) {
|
|
10
10
|
group.push(["use", { "xlink:href": href, x: ff(p[0]), y: ff(p[1]) }]);
|
|
11
11
|
}
|
|
12
12
|
return group;
|