@blueprint-chart/docs 1.0.0 → 1.2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprint-chart/docs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Public documentation for Blueprint Chart — handbook, guide, BPC DSL spec, and lib API reference.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"vitepress": "^1.5.0",
|
|
50
50
|
"vitest": "^3.2.4",
|
|
51
51
|
"vue": "^3.5",
|
|
52
|
-
"@blueprint-chart/lib": "1.
|
|
53
|
-
"@blueprint-chart/ui": "1.
|
|
52
|
+
"@blueprint-chart/lib": "1.2.0",
|
|
53
|
+
"@blueprint-chart/ui": "1.2.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "vitepress dev src --host 0.0.0.0 --port 4445",
|
|
@@ -89,7 +89,7 @@ From here you wire the `data` and `options` into the renderer of your choice —
|
|
|
89
89
|
If you don't need the programmatic API, use the bundled runtime. It picks up every `<script type="application/blueprint-chart">` tag and replaces it with a sandboxed iframe containing the rendered chart.
|
|
90
90
|
|
|
91
91
|
```html
|
|
92
|
-
<script src="https://unpkg.com/@blueprint-chart/lib/dist/
|
|
92
|
+
<script src="https://unpkg.com/@blueprint-chart/lib/dist/lib/lib.iife.js"></script>
|
|
93
93
|
|
|
94
94
|
<script type="application/blueprint-chart">
|
|
95
95
|
chart donut {
|
package/src/guide/mcp.md
CHANGED
|
@@ -85,6 +85,28 @@ claude mcp add blueprint-chart -- npx -y @blueprint-chart/mcp
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
```json [Windsurf]
|
|
89
|
+
{
|
|
90
|
+
"mcpServers": {
|
|
91
|
+
"blueprint-chart": {
|
|
92
|
+
"command": "npx",
|
|
93
|
+
"args": ["-y", "@blueprint-chart/mcp"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```json [Cline]
|
|
100
|
+
{
|
|
101
|
+
"mcpServers": {
|
|
102
|
+
"blueprint-chart": {
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": ["-y", "@blueprint-chart/mcp"]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
88
110
|
:::
|
|
89
111
|
|
|
90
112
|
Any other MCP client works too — run `npx -y @blueprint-chart/mcp` over stdio and drop it into
|
package/src/guide/scenes.md
CHANGED
|
@@ -194,7 +194,7 @@ that follow.
|
|
|
194
194
|
The controller is decoupled from the nav DOM it inserts — you can ignore the built-in buttons and call `next()`, `previous()`, or `goTo(index)` from any custom UI:
|
|
195
195
|
|
|
196
196
|
```ts
|
|
197
|
-
import { createSceneController } from '@blueprint-chart/lib/
|
|
197
|
+
import { createSceneController } from '@blueprint-chart/lib/runtime'
|
|
198
198
|
|
|
199
199
|
const controller = createSceneController(container, scenes, (scene, index) => {
|
|
200
200
|
renderChart(canvas, scene.data, true)
|
|
@@ -212,7 +212,7 @@ Call `controller.destroy()` to remove the injected nav when tearing the chart do
|
|
|
212
212
|
|
|
213
213
|
## API surface
|
|
214
214
|
|
|
215
|
-
Exported from `@blueprint-chart/lib/
|
|
215
|
+
Exported from `@blueprint-chart/lib/runtime`:
|
|
216
216
|
|
|
217
217
|
| Symbol | One-liner |
|
|
218
218
|
| --- | --- |
|
|
@@ -232,8 +232,8 @@ Each `ChartSample` exposes:
|
|
|
232
232
|
|
|
233
233
|
```ts
|
|
234
234
|
// Available only from the IIFE bundle (auto-initialized) or:
|
|
235
|
-
import { initBlueprint, createSceneController, createStepController } from '@blueprint-chart/lib/
|
|
236
|
-
import type { SceneDefinition, SceneController, StepDefinition, StepController } from '@blueprint-chart/lib/
|
|
235
|
+
import { initBlueprint, createSceneController, createStepController } from '@blueprint-chart/lib/runtime'
|
|
236
|
+
import type { SceneDefinition, SceneController, StepDefinition, StepController } from '@blueprint-chart/lib/runtime'
|
|
237
237
|
```
|
|
238
238
|
|
|
239
239
|
| Symbol | Purpose |
|
|
@@ -278,13 +278,18 @@ Drop a BPC source into the page inside a typed `<script>` tag, then call `initBl
|
|
|
278
278
|
</script>
|
|
279
279
|
|
|
280
280
|
<script type="module">
|
|
281
|
-
|
|
281
|
+
// Each chart renders inside a sandboxed iframe that reloads the standalone
|
|
282
|
+
// runtime bundle. In the IIFE form that URL is detected automatically; in the
|
|
283
|
+
// module form `document.currentScript` is null, so point the runtime at the
|
|
284
|
+
// IIFE bundle explicitly before calling initBlueprint().
|
|
285
|
+
globalThis.BLUEPRINT_CHART_RUNTIME_URL = 'https://unpkg.com/@blueprint-chart/lib/dist/lib/lib.iife.js'
|
|
286
|
+
import { initBlueprint } from '@blueprint-chart/lib/runtime'
|
|
282
287
|
initBlueprint()
|
|
283
288
|
</script>
|
|
284
289
|
```
|
|
285
290
|
|
|
286
291
|
::: info BPC source from `packages/lib/src/samples/bitcoin-price.bpc`
|
|
287
|
-
The IIFE bundle (`@blueprint-chart/lib/dist/lib/lib.iife.js`) calls `initBlueprint()` for you on `DOMContentLoaded`. Import the module form when you want to control timing or re-initialize after DOM updates.
|
|
292
|
+
The IIFE bundle (`@blueprint-chart/lib/dist/lib/lib.iife.js`) calls `initBlueprint()` for you on `DOMContentLoaded`. Import the module form when you want to control timing or re-initialize after DOM updates; set `globalThis.BLUEPRINT_CHART_RUNTIME_URL` to the IIFE bundle URL so each generated iframe can load the runtime.
|
|
288
293
|
:::
|
|
289
294
|
|
|
290
295
|
## Versioning
|