@thi.ng/hiccup-svg 5.3.13 → 5.4.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-08-18T14:11:34Z
3
+ - **Last updated**: 2024-09-19T21:09:34Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ## [5.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-svg@5.4.0) (2024-09-16)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add pattern(), add/use Attribs type alias ([4c40840](https://github.com/thi-ng/umbrella/commit/4c40840))
17
+
12
18
  ## [5.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-svg@5.3.0) (2024-06-21)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -179,7 +179,7 @@ For Node.js REPL:
179
179
  const svg = await import("@thi.ng/hiccup-svg");
180
180
  ```
181
181
 
182
- Package sizes (brotli'd, pre-treeshake): ESM: 2.47 KB
182
+ Package sizes (brotli'd, pre-treeshake): ESM: 2.49 KB
183
183
 
184
184
  ## Dependencies
185
185
 
@@ -192,28 +192,29 @@ Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
192
192
 
193
193
  ## Usage examples
194
194
 
195
- 16 projects in this repo's
195
+ 17 projects in this repo's
196
196
  [/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
197
197
  directory are using this package:
198
198
 
199
- | Screenshot | Description | Live demo | Source |
200
- |:-------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------|
201
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/color-themes.png" width="240"/> | Probabilistic color theme generator | [Demo](https://demo.thi.ng/umbrella/color-themes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/color-themes) |
202
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/commit-heatmap.png" width="240"/> | Heatmap visualization of this mono-repo's commits | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/commit-heatmap) |
203
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/crypto-chart.png" width="240"/> | Basic crypto-currency candle chart with multiple moving averages plots | [Demo](https://demo.thi.ng/umbrella/crypto-chart/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/crypto-chart) |
204
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/dominant-colors.png" width="240"/> | Color palette generation via dominant color extraction from uploaded images | [Demo](https://demo.thi.ng/umbrella/dominant-colors/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/dominant-colors) |
205
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/gesture-analysis.png" width="240"/> | Mouse gesture / stroke analysis, simplification, corner detection | [Demo](https://demo.thi.ng/umbrella/gesture-analysis/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/gesture-analysis) |
206
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/hdom-canvas/hdom-canvas-shapes-results.png" width="240"/> | Various hdom-canvas shape drawing examples & SVG conversion / export | [Demo](https://demo.thi.ng/umbrella/hdom-canvas-shapes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-canvas-shapes) |
207
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/package-stats.png" width="240"/> | CLI util to visualize umbrella pkg stats | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/package-stats) |
208
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-svg.png" width="240"/> | Generate SVG using pointfree DSL | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-svg) |
209
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
210
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-reactive-svg.jpg" width="240"/> | Animated SVG elements with reactive attributes | [Demo](https://demo.thi.ng/umbrella/rdom-reactive-svg/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-reactive-svg) |
211
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-svg-nodes.png" width="240"/> | rdom powered SVG graph with draggable nodes | [Demo](https://demo.thi.ng/umbrella/rdom-svg-nodes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-svg-nodes) |
212
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rstream-grid.jpg" width="240"/> | Interactive grid generator, SVG generation & export, undo/redo support | [Demo](https://demo.thi.ng/umbrella/rstream-grid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rstream-grid) |
213
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-resample.png" width="240"/> | SVG path parsing & dynamic resampling | [Demo](https://demo.thi.ng/umbrella/svg-resample/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-resample) |
214
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-waveform.jpg" width="240"/> | Additive waveform synthesis & SVG visualization with undo/redo | [Demo](https://demo.thi.ng/umbrella/svg-waveform/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-waveform) |
215
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/viz-ridge-lines.avif" width="240"/> | Interactive ridge-line plot | [Demo](https://demo.thi.ng/umbrella/viz-ridge-lines/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/viz-ridge-lines) |
216
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/viz-scatter-plot.avif" width="240"/> | Interactive scatter & line plot of low-discrepancy samples | [Demo](https://demo.thi.ng/umbrella/viz-scatter-plot/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/viz-scatter-plot) |
199
+ | Screenshot | Description | Live demo | Source |
200
+ |:-------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------|
201
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/color-contrast.avif" width="240"/> | Tool to interactively compute & visualize color contrasts against WCAG threshold | [Demo](https://demo.thi.ng/umbrella/color-contrast/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/color-contrast) |
202
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/color-themes.png" width="240"/> | Probabilistic color theme generator | [Demo](https://demo.thi.ng/umbrella/color-themes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/color-themes) |
203
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/commit-heatmap.png" width="240"/> | Heatmap visualization of this mono-repo's commits | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/commit-heatmap) |
204
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/crypto-chart.png" width="240"/> | Basic crypto-currency candle chart with multiple moving averages plots | [Demo](https://demo.thi.ng/umbrella/crypto-chart/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/crypto-chart) |
205
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/dominant-colors.png" width="240"/> | Color palette generation via dominant color extraction from uploaded images | [Demo](https://demo.thi.ng/umbrella/dominant-colors/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/dominant-colors) |
206
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/gesture-analysis.png" width="240"/> | Mouse gesture / stroke analysis, simplification, corner detection | [Demo](https://demo.thi.ng/umbrella/gesture-analysis/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/gesture-analysis) |
207
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/hdom-canvas/hdom-canvas-shapes-results.png" width="240"/> | Various hdom-canvas shape drawing examples & SVG conversion / export | [Demo](https://demo.thi.ng/umbrella/hdom-canvas-shapes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-canvas-shapes) |
208
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/package-stats.png" width="240"/> | CLI util to visualize umbrella pkg stats | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/package-stats) |
209
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-svg.png" width="240"/> | Generate SVG using pointfree DSL | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-svg) |
210
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
211
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-reactive-svg.jpg" width="240"/> | Animated SVG elements with reactive attributes | [Demo](https://demo.thi.ng/umbrella/rdom-reactive-svg/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-reactive-svg) |
212
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-svg-nodes.png" width="240"/> | rdom powered SVG graph with draggable nodes | [Demo](https://demo.thi.ng/umbrella/rdom-svg-nodes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-svg-nodes) |
213
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rstream-grid.jpg" width="240"/> | Interactive grid generator, SVG generation & export, undo/redo support | [Demo](https://demo.thi.ng/umbrella/rstream-grid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rstream-grid) |
214
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-resample.png" width="240"/> | SVG path parsing & dynamic resampling | [Demo](https://demo.thi.ng/umbrella/svg-resample/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-resample) |
215
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-waveform.jpg" width="240"/> | Additive waveform synthesis & SVG visualization with undo/redo | [Demo](https://demo.thi.ng/umbrella/svg-waveform/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-waveform) |
216
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/viz-ridge-lines.avif" width="240"/> | Interactive ridge-line plot | [Demo](https://demo.thi.ng/umbrella/viz-ridge-lines/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/viz-ridge-lines) |
217
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/viz-scatter-plot.avif" width="240"/> | Interactive scatter & line plot of low-discrepancy samples | [Demo](https://demo.thi.ng/umbrella/viz-scatter-plot/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/viz-scatter-plot) |
217
218
 
218
219
  ## API
219
220
 
package/api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type Attribs = Record<string, any>;
1
2
  export type Vec2Like = ArrayLike<number>;
2
3
  export type PathSegmentMove = ["M" | "m", Vec2Like];
3
4
  export type PathSegmentLine = ["L" | "l", Vec2Like];
package/circle.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const circle: (p: Vec2Like, r: number, attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const circle: (p: Vec2Like, r: number, attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=circle.d.ts.map
package/convert.js CHANGED
@@ -191,6 +191,11 @@ const __convertAttrib = (res, id, v) => {
191
191
  case "baseline":
192
192
  res["dominant-baseline"] = BASE_LINE[v] || v;
193
193
  break;
194
+ // case "filter":
195
+ // TODO needs to be translated into <filter> def first
196
+ // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter
197
+ // https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter
198
+ // break;
194
199
  default:
195
200
  res[id] = v;
196
201
  }
package/ellipse.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const ellipse: (p: Vec2Like, rx: number, ry: number, attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const ellipse: (p: Vec2Like, rx: number, ry: number, attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=ellipse.d.ts.map
package/format.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Vec2Like } from "./api.js";
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ import type { Maybe } from "@thi.ng/api";
2
3
  export declare let PRECISION: number;
3
4
  /**
4
5
  * Sets the number of fractional digits used for formatting various floating
@@ -51,7 +52,7 @@ export declare const fpoints: (pts: Vec2Like[], sep?: string) => string;
51
52
  *
52
53
  * @internal
53
54
  */
54
- export declare const fattribs: (attribs: any, ...numericIDs: string[]) => any;
55
+ export declare const fattribs: (attribs: Maybe<Attribs>, ...numericIDs: string[]) => Attribs;
55
56
  /**
56
57
  * Attempts to convert a single color attrib value. If `col` is prefixed with
57
58
  * `$`, the value will be converted into a `url(#...)` reference. If not a
@@ -66,5 +67,5 @@ export declare const fattribs: (attribs: any, ...numericIDs: string[]) => any;
66
67
  */
67
68
  export declare const fcolor: (col: any) => string;
68
69
  /** @internal */
69
- export declare const withoutKeys: (src: any, keys: Set<PropertyKey>) => any;
70
+ export declare const withoutKeys: (src: Record<string, any>, keys: Set<PropertyKey>) => any;
70
71
  //# sourceMappingURL=format.d.ts.map
package/format.js CHANGED
@@ -20,7 +20,7 @@ const __numericAttribs = (attribs, ids) => {
20
20
  return attribs;
21
21
  };
22
22
  const fattribs = (attribs, ...numericIDs) => {
23
- if (!attribs) return;
23
+ if (!attribs) return {};
24
24
  const res = __ftransforms(attribs);
25
25
  let v;
26
26
  (v = attribs.fill) && (res.fill = fcolor(v));
package/gradients.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { GradientStop, Vec2Like } from "./api.js";
2
- export declare const linearGradient: (id: string, from: Vec2Like, to: Vec2Like, stops: GradientStop[], attribs?: any) => any[];
3
- export declare const radialGradient: (id: string, from: Vec2Like, to: Vec2Like, fr: number, r: number, stops: GradientStop[], attribs?: any) => any[];
1
+ import type { Attribs, GradientStop, Vec2Like } from "./api.js";
2
+ export declare const linearGradient: (id: string, from: Vec2Like, to: Vec2Like, stops: GradientStop[], attribs?: Attribs) => any[];
3
+ export declare const radialGradient: (id: string, from: Vec2Like, to: Vec2Like, fr: number, r: number, stops: GradientStop[], attribs?: Attribs) => any[];
4
4
  //# sourceMappingURL=gradients.d.ts.map
package/group.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Attribs } from "./api.js";
1
2
  /**
2
3
  * Creates a new SVG group element in hiccup format.
3
4
  *
@@ -9,7 +10,7 @@
9
10
  * @param attribs
10
11
  * @param body
11
12
  */
12
- export declare const group: (attribs: any, ...body: any[]) => any[];
13
+ export declare const group: (attribs: Attribs, ...body: any[]) => any[];
13
14
  /** @internal */
14
- export declare const __groupLayerID: (attribs: any) => any;
15
+ export declare const __groupLayerID: (attribs: Attribs) => Attribs;
15
16
  //# sourceMappingURL=group.d.ts.map
package/image.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const image: (pos: Vec2Like, url: string, attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const image: (pos: Vec2Like, url: string, attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=image.d.ts.map
package/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./group.js";
7
7
  export * from "./image.js";
8
8
  export * from "./line.js";
9
9
  export * from "./path.js";
10
+ export * from "./pattern.js";
10
11
  export * from "./points.js";
11
12
  export * from "./polygon.js";
12
13
  export * from "./polyline.js";
package/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./group.js";
7
7
  export * from "./image.js";
8
8
  export * from "./line.js";
9
9
  export * from "./path.js";
10
+ export * from "./pattern.js";
10
11
  export * from "./points.js";
11
12
  export * from "./polygon.js";
12
13
  export * from "./polyline.js";
package/line.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const line: (a: Vec2Like, b: Vec2Like, attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const line: (a: Vec2Like, b: Vec2Like, attribs?: Attribs, ...body: any[]) => any[];
3
3
  export declare const hline: (y: number, attribs?: any) => any[];
4
4
  export declare const vline: (x: number, attribs?: any) => any[];
5
5
  //# sourceMappingURL=line.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup-svg",
3
- "version": "5.3.13",
3
+ "version": "5.4.1",
4
4
  "description": "SVG element functions for @thi.ng/hiccup & related tooling",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,16 +36,16 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.9",
40
- "@thi.ng/checks": "^3.6.11",
41
- "@thi.ng/color": "^5.7.3",
42
- "@thi.ng/prefixes": "^2.3.26"
39
+ "@thi.ng/api": "^8.11.10",
40
+ "@thi.ng/checks": "^3.6.12",
41
+ "@thi.ng/color": "^5.7.5",
42
+ "@thi.ng/prefixes": "^2.3.27"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.47.5",
46
- "esbuild": "^0.23.0",
47
- "typedoc": "^0.26.5",
48
- "typescript": "^5.5.4"
45
+ "@microsoft/api-extractor": "^7.47.9",
46
+ "esbuild": "^0.23.1",
47
+ "typedoc": "^0.26.7",
48
+ "typescript": "^5.6.2"
49
49
  },
50
50
  "keywords": [
51
51
  "arc",
@@ -113,6 +113,9 @@
113
113
  "./path": {
114
114
  "default": "./path.js"
115
115
  },
116
+ "./pattern": {
117
+ "default": "./pattern.js"
118
+ },
116
119
  "./points": {
117
120
  "default": "./points.js"
118
121
  },
@@ -137,5 +140,5 @@
137
140
  "parent": "@thi.ng/hiccup",
138
141
  "year": 2016
139
142
  },
140
- "gitHead": "9f71f7f82fed2a980078a96bdafd2e706f526c75\n"
143
+ "gitHead": "b52baa3750ddd1256892df966ab7ac9b4806a9ef\n"
141
144
  }
package/path.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { PathSegment } from "./api.js";
2
- export declare const path: (segments: PathSegment[], attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, PathSegment } from "./api.js";
2
+ export declare const path: (segments: PathSegment[], attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=path.d.ts.map
package/pattern.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Attribs } from "./api.js";
2
+ export declare const pattern: (attribs: Attribs, ...body: any[]) => any[];
3
+ //# sourceMappingURL=pattern.d.ts.map
package/pattern.js ADDED
@@ -0,0 +1,9 @@
1
+ import { fattribs } from "./format.js";
2
+ const pattern = (attribs, ...body) => [
3
+ "pattern",
4
+ fattribs({ ...attribs }),
5
+ ...body
6
+ ];
7
+ export {
8
+ pattern
9
+ };
package/points.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Vec2Like } from "./api.js";
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
2
  /**
3
3
  * Shape instancing group.
4
4
  *
@@ -14,7 +14,7 @@ import type { Vec2Like } from "./api.js";
14
14
  * @param size - point size/radius
15
15
  * @param attribs - attributes
16
16
  */
17
- export declare const points: (pts: Iterable<Vec2Like>, shape: string, size?: number, attribs?: any, ...body: any[]) => any[];
17
+ export declare const points: (pts: Iterable<Vec2Like>, shape: string, size?: number, attribs?: Attribs, ...body: any[]) => any[];
18
18
  /**
19
19
  * Similar to {@link points}, but takes points from a single large flat
20
20
  * buffer of coordinates with arbitrary striding.
@@ -33,5 +33,5 @@ export declare const points: (pts: Iterable<Vec2Like>, shape: string, size?: num
33
33
  * @param size - point size/radius
34
34
  * @param attribs - other attributes
35
35
  */
36
- export declare const packedPoints: (pts: ArrayLike<number>, shape: string, size?: number, attribs?: any, ...body: any[]) => any[];
36
+ export declare const packedPoints: (pts: ArrayLike<number>, shape: string, size?: number, attribs?: Attribs, ...body: any[]) => any[];
37
37
  //# sourceMappingURL=points.d.ts.map
package/points.js CHANGED
@@ -2,7 +2,7 @@ import { fattribs, ff, withoutKeys } from "./format.js";
2
2
  const points = (pts, shape, size = 1, attribs, ...body) => {
3
3
  const group = [
4
4
  "g",
5
- fattribs(withoutKeys(attribs, /* @__PURE__ */ new Set(["shape", "size"]))),
5
+ fattribs(withoutKeys(attribs ?? {}, /* @__PURE__ */ new Set(["shape", "size"]))),
6
6
  ...body
7
7
  ];
8
8
  const href = __buildSymbol(group, shape, size);
package/polygon.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const polygon: (pts: Vec2Like[], attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const polygon: (pts: Vec2Like[], attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=polygon.d.ts.map
package/polyline.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const polyline: (pts: Vec2Like[], attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const polyline: (pts: Vec2Like[], attribs?: Attribs, ...body: any[]) => any[];
3
3
  //# sourceMappingURL=polyline.d.ts.map
package/rect.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const rect: (p: Vec2Like, width: number, height: number, attribs?: any, ...body: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const rect: (p: Vec2Like, width: number, height: number, attribs?: Attribs, ...body: any[]) => any[];
3
3
  export declare const roundedRect: (p: Vec2Like, width: number, height: number, rx: number, ry: number, attribs?: any, ...body: any[]) => any[];
4
4
  //# sourceMappingURL=rect.d.ts.map
package/svg.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Attribs } from "./api.js";
1
2
  /**
2
3
  * Defines an <svg> root element with default XML namespaces. By default
3
4
  * currently still defaults to SVG version to 1.1 to support Safari and other
@@ -19,5 +20,5 @@
19
20
  * @param attribs - attributes object
20
21
  * @param body - shape primitives
21
22
  */
22
- export declare const svg: (attribs: any, ...body: any[]) => any[];
23
+ export declare const svg: (attribs: Attribs, ...body: any[]) => any[];
23
24
  //# sourceMappingURL=svg.d.ts.map
package/text.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Vec2Like } from "./api.js";
2
- export declare const text: (p: Vec2Like, body: string, attribs?: any, ...children: any[]) => any[];
1
+ import type { Attribs, Vec2Like } from "./api.js";
2
+ export declare const text: (p: Vec2Like, body: string, attribs?: Attribs, ...children: any[]) => any[];
3
3
  //# sourceMappingURL=text.d.ts.map