@vanduo-oss/vd3-cbun 1.1.0 → 1.3.0
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 +78 -0
- package/README.md +26 -18
- package/SKILL.md +36 -8
- package/dist/charts/index.cjs +18 -8
- package/dist/charts/index.cjs.map +2 -2
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.js +18 -8
- package/dist/charts/index.js.map +2 -2
- package/dist/charts/vue.d.ts +78 -7
- package/dist/code-editor/index.cjs +5 -3
- package/dist/code-editor/index.cjs.map +2 -2
- package/dist/code-editor/index.js +5 -3
- package/dist/code-editor/index.js.map +2 -2
- package/dist/draw/core.d.ts +246 -0
- package/dist/draw/index.cjs +2248 -0
- package/dist/draw/index.cjs.map +7 -0
- package/dist/draw/index.d.ts +34 -0
- package/dist/draw/index.js +2225 -0
- package/dist/draw/index.js.map +7 -0
- package/dist/draw/shapes.d.ts +12 -0
- package/dist/draw/vd3-draw.css +301 -0
- package/dist/draw/vue.d.ts +68 -0
- package/dist/flowchart/index.cjs +4 -4
- package/dist/flowchart/index.cjs.map +2 -2
- package/dist/flowchart/index.js +4 -4
- package/dist/flowchart/index.js.map +2 -2
- package/dist/hex-grid/index.cjs +90 -62
- package/dist/hex-grid/index.cjs.map +3 -3
- package/dist/hex-grid/index.d.ts +1 -1
- package/dist/hex-grid/index.js +90 -62
- package/dist/hex-grid/index.js.map +3 -3
- package/dist/hex-grid/vue.d.ts +25 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -4
- package/dist/index.js.map +2 -2
- package/dist/meta.json +169 -45
- package/dist/music-player/index.cjs +3 -4
- package/dist/music-player/index.cjs.map +2 -2
- package/dist/music-player/index.d.ts +9 -1
- package/dist/music-player/index.js +3 -4
- package/dist/music-player/index.js.map +2 -2
- package/dist/music-player/vue.d.ts +49 -1
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,84 @@ All notable changes to `@vanduo-oss/vd3-cbun` are documented here. This file
|
|
|
4
4
|
tracks the PACKAGE only — never docs-site content. Per-component VERSION
|
|
5
5
|
constants are listed alongside each bundle release.
|
|
6
6
|
|
|
7
|
+
## 1.3.0 — 2026-07-24
|
|
8
|
+
|
|
9
|
+
Minor release. **New — chart mark clicks:** `VdChart` (and the typed
|
|
10
|
+
`VdBarChart` / `VdLineChart` / … wrappers) now forward the core's mark-click
|
|
11
|
+
callbacks as an idiomatic Vue emit family — `bar-click`, `point-click`, and
|
|
12
|
+
`slice-click`, each carrying the core `ClickEvent` (`{ event, datum, index }`).
|
|
13
|
+
The wrapper previously dropped the core's `onBarClick` / `onPointClick` /
|
|
14
|
+
`onSliceClick` options, so a `<VdChart>` consumer could not receive a mark click
|
|
15
|
+
at all even though the core's click wiring was already in place. Additive and
|
|
16
|
+
backward-compatible; the `VdChartEmits` type is exported from `./charts`. Takes
|
|
17
|
+
`VD_CHARTS_VERSION` `1.0.1 → 1.1.0`.
|
|
18
|
+
|
|
19
|
+
**Hardening — bounded deserialization (draw + flowchart):** `normalizeDocument()`
|
|
20
|
+
now caps an untrusted / corrupt document, **truncating (never throwing)** beyond
|
|
21
|
+
conservative limits so a shared or hostile document cannot freeze the tab by
|
|
22
|
+
being coerced O(n) and rendered — draw caps `MAX_SHAPES` (10 000) and
|
|
23
|
+
`MAX_POINTS_PER_SHAPE` (100 000); flowchart caps `MAX_NODES` / `MAX_EDGES`
|
|
24
|
+
(10 000 each). The `toJSON()` output is unchanged for in-range documents, so
|
|
25
|
+
`VD_DRAW_VERSION` stays `1.1.0` and `VD_FLOWCHART_VERSION` stays `1.2.0` (both
|
|
26
|
+
load-bearing — serialized into saved documents).
|
|
27
|
+
|
|
28
|
+
**Core bug fixes** (framework-agnostic, no API or serialization change).
|
|
29
|
+
**draw** — the undo history now coalesces only at the top of the stack, so a
|
|
30
|
+
coalescing edit (nudge / style / text) made right after an undo no longer
|
|
31
|
+
overwrites an earlier snapshot and corrupts the redo branch (mirrors the
|
|
32
|
+
flowchart core's guard). **charts** — `renderBarChart` / `renderMultiBarChart`
|
|
33
|
+
clamp the bar baseline into the rendered y-domain, so an explicit `yMin > 0` no
|
|
34
|
+
longer draws bars past the axis floor (matches the area/line clamp).
|
|
35
|
+
**music-player** — a repeat-off playlist now stops and dispatches
|
|
36
|
+
`musicplayer:ended` at the final track instead of wrapping with a modulo and
|
|
37
|
+
looping forever; the wrap stays exclusive to `repeat: 'all'`. **hex-grid** —
|
|
38
|
+
`destroy()` now removes every canvas listener `_setupEvents` attaches (stored
|
|
39
|
+
named handlers), fixing a leak on caller-supplied, reused canvases.
|
|
40
|
+
**code-editor** — the CSS/JavaScript tokenizer now classifies an unterminated
|
|
41
|
+
`/*` block comment to end-of-input as a `comment` instead of `plain`. Minor:
|
|
42
|
+
bundle `1.2.0 → 1.3.0`.
|
|
43
|
+
|
|
44
|
+
Also non-runtime: hex-grid + music-player `vue.d.ts` now type their emit events,
|
|
45
|
+
the draw type surface declares its constants in `shapes.d.ts` (matching runtime),
|
|
46
|
+
and added coverage for the code-editor keymap/`destroy()`, the music-player
|
|
47
|
+
recreate teardown, tokenizer edge classification, and draw `clearHistory()`.
|
|
48
|
+
|
|
49
|
+
Component versions in this release: **charts 1.1.0, code-editor 1.0.1, draw
|
|
50
|
+
1.1.0, flowchart 1.2.0, hex-grid 1.0.1, music-player 1.0.1** — `charts` takes a
|
|
51
|
+
minor bump `1.0.1 → 1.1.0` for the mark-click emits; code-editor, hex-grid, and
|
|
52
|
+
music-player carry their `1.0.1` core-fix patch; `draw` stays `1.1.0` and
|
|
53
|
+
`flowchart` continues its old-line `1.2.0` lineage (the deserialization caps
|
|
54
|
+
change neither `toJSON()` format).
|
|
55
|
+
|
|
56
|
+
## 1.2.0 — 2026-07-22
|
|
57
|
+
|
|
58
|
+
Adds a sixth component, **`draw`** (`@vanduo-oss/vd3-cbun/draw` + `./draw/css`),
|
|
59
|
+
exposing `VdDraw` — a first-party **vector drawing tool** (SVG world group with
|
|
60
|
+
matrix pan/zoom, the flowchart architecture family) built around a
|
|
61
|
+
dependency-free **brush engine**: freehand strokes are variable-width, smoothed,
|
|
62
|
+
pressure/velocity-driven filled outline paths. It ships **brush presets** (`pen`,
|
|
63
|
+
`pencil`, `marker`, `highlighter`, `calligraphy` — `BRUSH_PRESETS`), a **color
|
|
64
|
+
palette** (swatches + custom color, opacity, brush size, recent colors), a
|
|
65
|
+
**stroke eraser**, and secondary diagram shapes (rectangle / ellipse / arrow /
|
|
66
|
+
text / sticky) with z-order, grouping, copy/paste/duplicate, snapping guides,
|
|
67
|
+
keyboard shortcuts, and PNG + SVG export. The built-in toolbar uses inline
|
|
68
|
+
Phosphor icons. Undo/redo funnels through a single `emitChange → recordHistory`
|
|
69
|
+
whole-document choke point (pan/zoom not recorded); `toJSON()` / `load()`
|
|
70
|
+
serialize `{ version, viewport, shapes }` — freehand strokes carry `brush` /
|
|
71
|
+
`color` / `opacity` / per-point `pressure` — through a `normalizeDocument()`
|
|
72
|
+
migration gateway (a v1 constant-width freehand loads as the default pen brush).
|
|
73
|
+
Chrome theming is CSS-only through a `--vd-draw-*` → `--vd-*` layer; marks carry
|
|
74
|
+
an explicit picked color. No new runtime dependency — `vue` stays the only peer,
|
|
75
|
+
and every input bundled for the entry lives under `src/draw/` (the metafile
|
|
76
|
+
isolation guard passes). The five existing components are untouched (tree-shake
|
|
77
|
+
contract). Additive minor: bundle `1.1.0 → 1.2.0`.
|
|
78
|
+
|
|
79
|
+
Component versions in this release: **charts 1.0.0, code-editor 1.0.0, draw
|
|
80
|
+
1.1.0, flowchart 1.2.0, hex-grid 1.0.0, music-player 1.0.0** — `draw` entered the
|
|
81
|
+
`component-versions.json` manifest at `1.0.0`, and its serialization (freehand
|
|
82
|
+
`brush` / `color` / `pressure`) takes `VD_DRAW_VERSION` to `1.1.0`; the bundle's own semver
|
|
83
|
+
stays decoupled from the per-component `VERSION` constants.
|
|
84
|
+
|
|
7
85
|
## 1.1.0 — 2026-07-21
|
|
8
86
|
|
|
9
87
|
Adds a fifth component, **`code-editor`** (`@vanduo-oss/vd3-cbun/code-editor` +
|
package/README.md
CHANGED
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
[](./LICENSE)
|
|
4
4
|
|
|
5
5
|
The Vanduo **components bundle** for the vd3 line: Vue3-only charts, code-editor,
|
|
6
|
-
flowchart, hex-grid, and music-player consolidated into ONE package with
|
|
6
|
+
draw, flowchart, hex-grid, and music-player consolidated into ONE package with
|
|
7
7
|
tree-shakeable subpath exports. It replaces the four per-repo publishes
|
|
8
8
|
(`@vanduo-oss/charts`, `@vanduo-oss/flowchart`, `@vanduo-oss/hex-grid`,
|
|
9
9
|
`@vanduo-oss/music-player`) of the old line.
|
|
10
10
|
|
|
11
|
-
**Status: 1.1
|
|
11
|
+
**Status: 1.2.1.** Six Vue3-only component families — charts, code-editor, draw,
|
|
12
12
|
flowchart, hex-grid, music-player — each on its own tree-shakeable subpath, with
|
|
13
|
-
the esbuild metafile isolation guard in place. (1.
|
|
14
|
-
`
|
|
13
|
+
the esbuild metafile isolation guard in place. (1.2.0 adds the first-party
|
|
14
|
+
`draw` vector drawing tool — a brush engine + color palette; 1.2.1 patches four
|
|
15
|
+
core bug fixes across charts / draw / hex-grid / music-player; see the
|
|
16
|
+
[changelog](./CHANGELOG.md).)
|
|
15
17
|
|
|
16
18
|
## Install
|
|
17
19
|
|
|
@@ -35,6 +37,9 @@ import '@vanduo-oss/vd3-cbun/charts/css';
|
|
|
35
37
|
import { VdCodeEditor } from '@vanduo-oss/vd3-cbun/code-editor';
|
|
36
38
|
import '@vanduo-oss/vd3-cbun/code-editor/css';
|
|
37
39
|
|
|
40
|
+
import { VdDraw } from '@vanduo-oss/vd3-cbun/draw';
|
|
41
|
+
import '@vanduo-oss/vd3-cbun/draw/css';
|
|
42
|
+
|
|
38
43
|
import { VdFlowchart } from '@vanduo-oss/vd3-cbun/flowchart';
|
|
39
44
|
import '@vanduo-oss/vd3-cbun/flowchart/css';
|
|
40
45
|
|
|
@@ -53,8 +58,8 @@ import { VD3_CBUN_VERSIONS } from '@vanduo-oss/vd3-cbun';
|
|
|
53
58
|
|
|
54
59
|
Each subpath entry (`dist/<component>/index.js`) re-exports **both** the Vue
|
|
55
60
|
component and its framework-agnostic core (the core aliased with a `Core`
|
|
56
|
-
suffix where the names collide — `VdCodeEditorCore`, `
|
|
57
|
-
`VdHexGridCore`). Isolation
|
|
61
|
+
suffix where the names collide — `VdCodeEditorCore`, `VdDrawCore`,
|
|
62
|
+
`VdFlowchartCore`, `VdHexGridCore`). Isolation
|
|
58
63
|
is not a convention but a build guard: `scripts/build.js` bundles every entry
|
|
59
64
|
separately with `vue` external, emits an esbuild metafile (`dist/meta.json`),
|
|
60
65
|
and **fails the build** if any component entry's inputs reach outside its own
|
|
@@ -65,8 +70,8 @@ to confirm tree-shaking downstream.
|
|
|
65
70
|
|
|
66
71
|
Notes:
|
|
67
72
|
|
|
68
|
-
- `vue
|
|
69
|
-
|
|
73
|
+
- The `vue` peer (see [Install](#install)) is never bundled — it stays external
|
|
74
|
+
in both the esm and cjs outputs.
|
|
70
75
|
- Named exports only — no default exports on any subpath.
|
|
71
76
|
- No IIFE builds and no `./vue` subpaths — the Vue bindings ARE the subpath
|
|
72
77
|
exports; framework-agnostic cores stay exported alongside them.
|
|
@@ -78,16 +83,16 @@ Notes:
|
|
|
78
83
|
The bundle's own semver (`package.json` version) is decoupled from the
|
|
79
84
|
components inside it. Each component carries a VERSION constant tracked in
|
|
80
85
|
`component-versions.json` at the repo root and asserted in tests against the
|
|
81
|
-
exported `VD3_CBUN_VERSIONS` map. charts, code-editor, hex-grid, and
|
|
82
|
-
|
|
83
|
-
`1.2.0`** because `VD_FLOWCHART_VERSION` is load-bearing —
|
|
84
|
-
into user documents via `toJSON().version`. A new component
|
|
85
|
-
at `1.0.0` (`
|
|
86
|
+
exported `VD3_CBUN_VERSIONS` map. charts, code-editor, hex-grid, and music-player
|
|
87
|
+
sit at `1.0.1`, draw at `1.1.0`; **flowchart continues its
|
|
88
|
+
old-line lineage at `1.2.0`** because `VD_FLOWCHART_VERSION` is load-bearing —
|
|
89
|
+
it is serialized into user documents via `toJSON().version`. A new component
|
|
90
|
+
enters the manifest at `1.0.0` (`draw` did, in bundle 1.2.0).
|
|
86
91
|
|
|
87
92
|
## Theming
|
|
88
93
|
|
|
89
|
-
All
|
|
90
|
-
tokens `@vanduo-oss/vd3` defines. charts, code-editor, flowchart, and hex-grid
|
|
94
|
+
All six components render against Vanduo's `--vd-*` design tokens — the same
|
|
95
|
+
tokens `@vanduo-oss/vd3` defines. charts, code-editor, draw, flowchart, and hex-grid
|
|
91
96
|
carry built-in fallbacks and degrade gracefully without them; **music-player
|
|
92
97
|
expects the tokens**
|
|
93
98
|
and renders with unset colors/backgrounds if none are provided. For correct
|
|
@@ -109,9 +114,10 @@ tokens works — but it is the canonical source.)
|
|
|
109
114
|
|
|
110
115
|
## Security
|
|
111
116
|
|
|
112
|
-
- **
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
- **No bundled dependencies** — beyond the `vue` peer ([Install](#install)),
|
|
118
|
+
nothing is bundled or required; the build fails if any other module is
|
|
119
|
+
externalized or any `node_modules` input is bundled (the
|
|
120
|
+
[isolation guard](#subpath-import-model)).
|
|
115
121
|
- **Hardened `.npmrc`:** `ignore-scripts`, `minimum-release-age`, `save-exact`,
|
|
116
122
|
`strict-peer-dependencies`, `trust-policy=no-downgrade`,
|
|
117
123
|
`block-exotic-subdeps`, and an explicit `registry`.
|
|
@@ -127,6 +133,8 @@ tokens works — but it is the canonical source.)
|
|
|
127
133
|
| `@vanduo-oss/vd3-cbun/charts/css` | Charts stylesheet (`dist/charts/vd3-charts.css`) |
|
|
128
134
|
| `@vanduo-oss/vd3-cbun/code-editor` | `VdCodeEditor` + `VdCodeEditorCore`, `tokenize`, `highlight`, `LANGUAGES` |
|
|
129
135
|
| `@vanduo-oss/vd3-cbun/code-editor/css` | Code-editor stylesheet (`dist/code-editor/vd3-code-editor.css`) |
|
|
136
|
+
| `@vanduo-oss/vd3-cbun/draw` | `VdDraw` + `VdDrawCore`, `BRUSH_PRESETS`, `DRAW_TOOLS`, `VD_DRAW_VERSION` |
|
|
137
|
+
| `@vanduo-oss/vd3-cbun/draw/css` | Draw stylesheet (`dist/draw/vd3-draw.css`) |
|
|
130
138
|
| `@vanduo-oss/vd3-cbun/flowchart` | `VdFlowchart` + `VdFlowchartCore`, `computeLayout`, `FLOWCHART_*` |
|
|
131
139
|
| `@vanduo-oss/vd3-cbun/flowchart/css` | Flowchart stylesheet (`dist/flowchart/vd3-flowchart.css`) |
|
|
132
140
|
| `@vanduo-oss/vd3-cbun/hex-grid` | `VdHexGrid` + `VdHexGridCore`, `VD_HEX_VERSION` |
|
package/SKILL.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vanduo-vd3-cbun
|
|
3
|
-
description: Use when adding Vanduo vd3 components with @vanduo-oss/vd3-cbun — the Vue 3 components bundle (charts, code-editor, flowchart, hex-grid, music-player) with tree-shakeable subpath exports. Covers install, per-subpath imports, CSS, theming, and per-component versioning.
|
|
3
|
+
description: Use when adding Vanduo vd3 components with @vanduo-oss/vd3-cbun — the Vue 3 components bundle (charts, code-editor, draw, flowchart, hex-grid, music-player) with tree-shakeable subpath exports. Covers install, per-subpath imports, CSS, theming, and per-component versioning.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# @vanduo-oss/vd3-cbun
|
|
7
7
|
|
|
8
|
-
One bundle,
|
|
9
|
-
(`./charts`, `./code-editor`, `./flowchart`, `./hex-grid`, `./music-player`).
|
|
8
|
+
One bundle, six Vue 3 components, each on its own tree-shakeable subpath
|
|
9
|
+
(`./charts`, `./code-editor`, `./draw`, `./flowchart`, `./hex-grid`, `./music-player`).
|
|
10
10
|
`vue >=3.3.0` is a required peer. The root import exposes only `VD3_CBUN_VERSIONS` — the per-
|
|
11
11
|
component VERSION map. Every subpath re-exports the Vue wrapper AND the
|
|
12
12
|
framework-agnostic core alongside it (the core aliased with a `Core` suffix
|
|
@@ -43,7 +43,7 @@ the scales (`scaleLinear`, `scaleTime`, `scaleBand`, `scalePoint`,
|
|
|
43
43
|
`scaleOrdinal`), accessor/tick helpers (`createAccessor`, `ticks`,
|
|
44
44
|
`niceDomain`), the path builders (`linePath`, `areaPath`, `arcPath`), and
|
|
45
45
|
`resolveTheme`. No name collision, so the core factories keep their own names.
|
|
46
|
-
CSS ships at `@vanduo-oss/vd3-cbun/charts/css`. `VD_CHARTS_VERSION` is `1.0.
|
|
46
|
+
CSS ships at `@vanduo-oss/vd3-cbun/charts/css`. `VD_CHARTS_VERSION` is `1.0.1`.
|
|
47
47
|
|
|
48
48
|
## Code-editor
|
|
49
49
|
|
|
@@ -68,6 +68,34 @@ Key props: `language`, `readOnly`, `lineNumbers`, `tabSize`, `wrap`,
|
|
|
68
68
|
`blur`, `ready`. CSS ships at `@vanduo-oss/vd3-cbun/code-editor/css`.
|
|
69
69
|
`VD_CODE_EDITOR_VERSION` is `1.0.0`.
|
|
70
70
|
|
|
71
|
+
## Draw
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { VdDraw, VdDrawCore } from '@vanduo-oss/vd3-cbun/draw';
|
|
75
|
+
import '@vanduo-oss/vd3-cbun/draw/css';
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`VdDraw` is the Vue 3 wrapper; the framework-agnostic editor core shares the
|
|
79
|
+
class name, so it is re-exported as `VdDrawCore`. It is a first-party **vector
|
|
80
|
+
drawing tool** (SVG world group with matrix pan/zoom) with a **brush engine** —
|
|
81
|
+
freehand strokes are variable-width, smoothed, pressure/velocity-driven filled
|
|
82
|
+
outline paths — and brush presets (`pen`, `pencil`, `marker`, `highlighter`,
|
|
83
|
+
`calligraphy`, in `BRUSH_PRESETS`), a **color palette** (swatches + custom color,
|
|
84
|
+
opacity, size, recent colors), a **stroke eraser**, plus secondary diagram
|
|
85
|
+
shapes (rectangle / ellipse / arrow / text / sticky), z-order, grouping,
|
|
86
|
+
copy/paste/duplicate, snapping guides, and PNG + SVG export. The built-in toolbar
|
|
87
|
+
uses inline Phosphor icons. Undo/redo runs through a single `emitChange →
|
|
88
|
+
recordHistory` choke point (whole-document snapshots; pan/zoom not recorded);
|
|
89
|
+
`toJSON()` / `load()` serialize `{ version, viewport, shapes }` (freehand strokes
|
|
90
|
+
carry `brush` / `color` / `opacity` / per-point `pressure`) via a
|
|
91
|
+
`normalizeDocument()` migration gateway. Chrome theming is CSS-only via a
|
|
92
|
+
`--vd-draw-*` → `--vd-*` layer; marks carry an explicit picked color. The subpath
|
|
93
|
+
also re-exports `BRUSH_PRESETS`, `DRAW_TOOLS`, `DRAW_SHAPE_TYPES`, and
|
|
94
|
+
`VD_DRAW_VERSION`. Key props: `data`, `tool`, `readonly`, `gridSize`, `snap`,
|
|
95
|
+
`autoFit`, `history`, `historyLimit`; events: `change`, `select`, `viewport`,
|
|
96
|
+
`ready`. CSS ships at `@vanduo-oss/vd3-cbun/draw/css`. `VD_DRAW_VERSION` is
|
|
97
|
+
`1.1.0`.
|
|
98
|
+
|
|
71
99
|
## Flowchart
|
|
72
100
|
|
|
73
101
|
```js
|
|
@@ -108,7 +136,7 @@ subpath (coordinate transforms, rotation, distance, plus the terrain tables:
|
|
|
108
136
|
and the `isPassable` / `getMovementCost` / `getTerrainYields` / `getTerrainColor`
|
|
109
137
|
helpers). Hex-grid ships **no CSS** — it renders to a canvas and reads `--vd-*`
|
|
110
138
|
theme tokens off the host element via `getComputedStyle`. `VD_HEX_VERSION` is
|
|
111
|
-
`1.0.
|
|
139
|
+
`1.0.1`.
|
|
112
140
|
|
|
113
141
|
## Music-player
|
|
114
142
|
|
|
@@ -125,12 +153,12 @@ core (no name collision, so it keeps its own name) re-exported alongside
|
|
|
125
153
|
`musicplayer:detach`, `musicplayer:attach`, `musicplayer:minimize`,
|
|
126
154
|
`musicplayer:expand`); the wrapper re-emits each as a Vue event (`@play`,
|
|
127
155
|
`@trackchange`, …, plus `@ready`) carrying `event.detail`. CSS ships at
|
|
128
|
-
`@vanduo-oss/vd3-cbun/music-player/css`. `VD_MUSIC_PLAYER_VERSION` is `1.0.
|
|
156
|
+
`@vanduo-oss/vd3-cbun/music-player/css`. `VD_MUSIC_PLAYER_VERSION` is `1.0.1`.
|
|
129
157
|
|
|
130
158
|
## Theming
|
|
131
159
|
|
|
132
|
-
All
|
|
133
|
-
tokens `@vanduo-oss/vd3` defines. charts, flowchart, and hex-grid ship built-in
|
|
160
|
+
All six components render against Vanduo's `--vd-*` design tokens — the same
|
|
161
|
+
tokens `@vanduo-oss/vd3` defines. charts, code-editor, draw, flowchart, and hex-grid ship built-in
|
|
134
162
|
fallbacks and degrade gracefully without them; **music-player expects the tokens**
|
|
135
163
|
and renders with unset colors/backgrounds if none are present. Provide them on an
|
|
136
164
|
ancestor element — simplest is to import the vd3 stylesheet (`@vanduo-oss/vd3/css`,
|
package/dist/charts/index.cjs
CHANGED
|
@@ -70,7 +70,7 @@ var DEFAULT_COLORS = [
|
|
|
70
70
|
"#be4bdb",
|
|
71
71
|
"#fd7e14"
|
|
72
72
|
];
|
|
73
|
-
var VD_CHARTS_VERSION = "1.
|
|
73
|
+
var VD_CHARTS_VERSION = "1.1.0";
|
|
74
74
|
var chartId = 0;
|
|
75
75
|
function nextId(prefix) {
|
|
76
76
|
chartId += 1;
|
|
@@ -946,7 +946,7 @@ function renderBarChart(instance) {
|
|
|
946
946
|
drawAnnotations(svg, options, plot, xScale, yScale, theme);
|
|
947
947
|
const labels = dataLabelConfig(options);
|
|
948
948
|
const markGroup = append(svg, svgEl("g", { class: "vd-chart-marks vd-chart-bars" }));
|
|
949
|
-
const baseline = yScale(0);
|
|
949
|
+
const baseline = yScale(Math.min(Math.max(0, yDomain[0]), yDomain[1]));
|
|
950
950
|
rows.forEach((row) => {
|
|
951
951
|
const x = xScale(row.x);
|
|
952
952
|
const y = yScale(row.y);
|
|
@@ -1038,7 +1038,7 @@ function renderMultiBarChart(instance) {
|
|
|
1038
1038
|
drawAnnotations(svg, options, plot, xScale, yScale, theme);
|
|
1039
1039
|
const labels = dataLabelConfig(options);
|
|
1040
1040
|
const markGroup = append(svg, svgEl("g", { class: "vd-chart-marks vd-chart-bars" }));
|
|
1041
|
-
const baseline = yScale(0);
|
|
1041
|
+
const baseline = yScale(Math.min(Math.max(0, yDomain[0]), yDomain[1]));
|
|
1042
1042
|
seriesList.forEach((series) => {
|
|
1043
1043
|
const fill = seriesColor(series, theme);
|
|
1044
1044
|
series.rows.forEach((row) => {
|
|
@@ -1704,7 +1704,7 @@ var CHART_PROPS = {
|
|
|
1704
1704
|
xAxis: { type: Object, default: void 0 },
|
|
1705
1705
|
yAxis: { type: Object, default: void 0 }
|
|
1706
1706
|
};
|
|
1707
|
-
function optionsFrom(target, props) {
|
|
1707
|
+
function optionsFrom(target, props, emit) {
|
|
1708
1708
|
return {
|
|
1709
1709
|
target,
|
|
1710
1710
|
type: props.type,
|
|
@@ -1735,20 +1735,30 @@ function optionsFrom(target, props) {
|
|
|
1735
1735
|
xFormat: props.xFormat,
|
|
1736
1736
|
yFormat: props.yFormat,
|
|
1737
1737
|
xAxis: props.xAxis,
|
|
1738
|
-
yAxis: props.yAxis
|
|
1738
|
+
yAxis: props.yAxis,
|
|
1739
|
+
// Forward the core's mark-click callbacks as the Vue emit family. Passing
|
|
1740
|
+
// all three unconditionally is safe: the core only fires the callback
|
|
1741
|
+
// relevant to the rendered chart type (bars → onBarClick, points →
|
|
1742
|
+
// onPointClick, slices → onSliceClick).
|
|
1743
|
+
onBarClick: (e) => emit("bar-click", e),
|
|
1744
|
+
onPointClick: (e) => emit("point-click", e),
|
|
1745
|
+
onSliceClick: (e) => emit("slice-click", e)
|
|
1739
1746
|
};
|
|
1740
1747
|
}
|
|
1741
1748
|
var VdChart = (0, import_vue.defineComponent)({
|
|
1742
1749
|
name: "VdChart",
|
|
1743
1750
|
props: CHART_PROPS,
|
|
1744
|
-
|
|
1751
|
+
// Mark clicks the core reports through its callbacks are re-emitted here as
|
|
1752
|
+
// idiomatic kebab-case Vue events carrying the core `ClickEvent` payload.
|
|
1753
|
+
emits: ["point-click", "bar-click", "slice-click"],
|
|
1754
|
+
setup(props, { emit }) {
|
|
1745
1755
|
const el = (0, import_vue.ref)(null);
|
|
1746
1756
|
let instance = null;
|
|
1747
1757
|
let currentType = props.type;
|
|
1748
1758
|
const create = () => {
|
|
1749
1759
|
const factory = FACTORIES[props.type] || BarChart;
|
|
1750
1760
|
currentType = props.type;
|
|
1751
|
-
instance = factory(optionsFrom(el.value, props));
|
|
1761
|
+
instance = factory(optionsFrom(el.value, props, emit));
|
|
1752
1762
|
};
|
|
1753
1763
|
(0, import_vue.onMounted)(() => {
|
|
1754
1764
|
if (typeof window === "undefined" || !el.value) return;
|
|
@@ -1792,7 +1802,7 @@ var VdChart = (0, import_vue.defineComponent)({
|
|
|
1792
1802
|
instance.destroy();
|
|
1793
1803
|
create();
|
|
1794
1804
|
} else {
|
|
1795
|
-
instance.update(optionsFrom(el.value, props));
|
|
1805
|
+
instance.update(optionsFrom(el.value, props, emit));
|
|
1796
1806
|
}
|
|
1797
1807
|
},
|
|
1798
1808
|
{ deep: true }
|