vizcraft 0.2.1 → 0.2.2

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,5 +1,11 @@
1
1
  # vizcraft
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7c9eb18`](https://github.com/ChipiKaf/vizcraft/commit/7c9eb185e727bde899b4779c4661d8b176db8549) Thanks [@ChipiKaf](https://github.com/ChipiKaf)! - update documentation
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Snapshot](https://github.com/ChipiKaf/vizcraft/actions/workflows/snapshot.yml/badge.svg)](https://github.com/ChipiKaf/vizcraft/actions/workflows/snapshot.yml)
8
8
  [![license](https://img.shields.io/npm/l/vizcraft.svg)](LICENSE)
9
9
 
10
- 📖 Full documentation: https://vizcraft-docs.vercel.app/
10
+ 📖 Full documentation: [docs here](https://vizcraft-docs.vercel.app/docs/intro)
11
11
 
12
12
  **A declarative, builder-based library for creating animated SVG network visualizations and algorithm demos.**
13
13
 
@@ -41,7 +41,6 @@ import { viz } from 'vizcraft';
41
41
  const builder = viz().view(800, 600);
42
42
 
43
43
  builder
44
- .view(500, 500)
45
44
  .node('a')
46
45
  .at(100, 100)
47
46
  .circle(15)
@@ -57,21 +56,21 @@ const container = document.getElementById('viz-basic');
57
56
  if (container) builder.mount(container);
58
57
  ```
59
58
 
60
- More walkthroughs and examples: https://vizcraft-docs.vercel.app/
59
+ More walkthroughs and examples: [docs here](https://vizcraft-docs.vercel.app/docs/examples).
61
60
 
62
61
  ## 📚 Documentation (Topics)
63
62
 
64
- Full documentation site: https://vizcraft-docs.vercel.app/
63
+ Full documentation site: [docs here](https://vizcraft-docs.vercel.app/docs/intro)
65
64
 
66
- For a guided walkthrough, the repo docs are organized like this:
65
+ Docs topics (same as the sidebar):
67
66
 
68
- - [Introduction](../../packages/docs/docs/intro.md)
69
- - [Examples](../../packages/docs/docs/examples.mdx)
70
- - [Essentials](../../packages/docs/docs/essentials.mdx)
71
- - [Animations](../../packages/docs/docs/animations/index.mdx)
72
- - [Animation Builder API](../../packages/docs/docs/animations/animation-builder-api.mdx)
73
- - [Advanced](../../packages/docs/docs/advanced.mdx)
74
- - [Types](../../packages/docs/docs/types.mdx)
67
+ - [Introduction](https://vizcraft-docs.vercel.app/docs/intro)
68
+ - [Examples](https://vizcraft-docs.vercel.app/docs/examples)
69
+ - [Essentials](https://vizcraft-docs.vercel.app/docs/essentials)
70
+ - [Animations](https://vizcraft-docs.vercel.app/docs/animations)
71
+ - [Animation Builder API](https://vizcraft-docs.vercel.app/docs/animations/animation-builder-api)
72
+ - [Advanced](https://vizcraft-docs.vercel.app/docs/advanced)
73
+ - [Types](https://vizcraft-docs.vercel.app/docs/types)
75
74
 
76
75
  Run the docs locally (monorepo):
77
76
 
@@ -122,7 +121,7 @@ b.edge('n1', 'n2')
122
121
 
123
122
  ### Animations
124
123
 
125
- See the full Animations guide: https://vizcraft-docs.vercel.app/
124
+ See the full Animations guide [docs here](https://vizcraft-docs.vercel.app/docs/animations).
126
125
 
127
126
  VizCraft supports **two complementary animation approaches**:
128
127
 
@@ -153,7 +152,7 @@ b.node('a')
153
152
 
154
153
  2. **Data-only timeline animations (`AnimationSpec`)** (sequenced tweens)
155
154
 
156
- - Author with `builder.animate((anim) => ...)`.
155
+ - Author with `builder.animate((aBuilder) => ...)`.
157
156
  - VizCraft stores compiled specs on the scene as `scene.animationSpecs`.
158
157
  - Play them with `builder.play()`.
159
158
 
@@ -174,8 +173,8 @@ b.node('a')
174
173
  .arrow()
175
174
  .done();
176
175
 
177
- b.animate((anim) =>
178
- anim
176
+ b.animate((aBuilder) =>
177
+ aBuilder
179
178
  .node('a')
180
179
  .to({ x: 200, opacity: 0.35 }, { duration: 600 })
181
180
  .node('b')
@@ -206,8 +205,10 @@ b.node('a')
206
205
  .edge('a', 'b', 'e1')
207
206
  .done();
208
207
 
209
- b.animate((anim) =>
210
- anim.edge('a', 'b', 'e1').to({ strokeDashoffset: -120 }, { duration: 900 })
208
+ b.animate((aBuilder) =>
209
+ aBuilder
210
+ .edge('a', 'b', 'e1')
211
+ .to({ strokeDashoffset: -120 }, { duration: 900 })
211
212
  );
212
213
  ```
213
214
 
@@ -216,8 +217,8 @@ b.animate((anim) =>
216
217
  Specs can carry adapter extensions so you can animate your own numeric properties:
217
218
 
218
219
  ```ts
219
- b.animate((anim) =>
220
- anim
220
+ b.animate((aBuilder) =>
221
+ aBuilder
221
222
  .extendAdapter((adapter) => {
222
223
  adapter.register?.('node', 'r', {
223
224
  get: (target) => adapter.get(target, 'r'),
package/dist/styles.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const DEFAULT_VIZ_CSS = "\n.viz-canvas {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.viz-node-label,\n.viz-edge-label {\n dominant-baseline: middle;\n alignment-baseline: middle;\n transform: translateY(-0.1em);\n}\n\n.viz-canvas svg {\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n/* Keyframes */\n@keyframes vizFlow {\n from {\n stroke-dashoffset: 20;\n }\n to {\n stroke-dashoffset: 0;\n }\n}\n\n/* Animation Classes */\n\n/* Flow Animation (Dashed line moving) */\n.viz-anim-flow .viz-edge {\n stroke-dasharray: 5, 5;\n animation: vizFlow var(--viz-anim-duration, 2s) linear infinite;\n}\n\n/* Node Transition */\n.viz-node-group {\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n}\n\n/* Overlay Classes */\n.viz-grid-label {\n fill: #6B7280;\n font-size: 14px;\n font-weight: 600;\n opacity: 1;\n}\n\n.viz-signal {\n fill: #3B82F6;\n cursor: pointer;\n pointer-events: all; \n transition: transform 0.2s ease-out, fill 0.2s ease-out;\n}\n\n.viz-signal .viz-signal-shape {\n fill: inherit;\n}\n\n.viz-signal:hover {\n fill: #60A5FA;\n transform: scale(1.5);\n}\n\n.viz-data-point {\n fill: #F59E0B;\n transition: cx 0.3s ease-out, cy 0.3s ease-out;\n}\n";
1
+ export declare const DEFAULT_VIZ_CSS = "\n.viz-canvas {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.viz-node-label,\n.viz-edge-label {\n text-anchor: middle;\n dominant-baseline: middle;\n alignment-baseline: middle;\n transform: translateY(0);\n}\n\n.viz-canvas svg {\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n/* Keyframes */\n@keyframes vizFlow {\n from {\n stroke-dashoffset: 20;\n }\n to {\n stroke-dashoffset: 0;\n }\n}\n\n/* Animation Classes */\n\n/* Flow Animation (Dashed line moving) */\n.viz-anim-flow .viz-edge {\n stroke-dasharray: 5, 5;\n animation: vizFlow var(--viz-anim-duration, 2s) linear infinite;\n}\n\n/* Node Transition */\n.viz-node-group {\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n}\n\n/* Overlay Classes */\n.viz-grid-label {\n fill: #6B7280;\n font-size: 14px;\n font-weight: 600;\n opacity: 1;\n}\n\n.viz-signal {\n fill: #3B82F6;\n cursor: pointer;\n pointer-events: all; \n transition: transform 0.2s ease-out, fill 0.2s ease-out;\n}\n\n.viz-signal .viz-signal-shape {\n fill: inherit;\n}\n\n.viz-signal:hover {\n fill: #60A5FA;\n transform: scale(1.5);\n}\n\n.viz-data-point {\n fill: #F59E0B;\n transition: cx 0.3s ease-out, cy 0.3s ease-out;\n}\n";
package/dist/styles.js CHANGED
@@ -9,9 +9,10 @@ export const DEFAULT_VIZ_CSS = `
9
9
 
10
10
  .viz-node-label,
11
11
  .viz-edge-label {
12
+ text-anchor: middle;
12
13
  dominant-baseline: middle;
13
14
  alignment-baseline: middle;
14
- transform: translateY(-0.1em);
15
+ transform: translateY(0);
15
16
  }
16
17
 
17
18
  .viz-canvas svg {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vizcraft",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A fluent, type-safe SVG scene builder for composing nodes, edges, animations, and overlays with incremental DOM updates and no framework dependency.",
5
5
  "keywords": [
6
6
  "visualization",