phoria2 1.0.0-rc.4 → 1.0.0-rc.5
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 +22 -6
- package/dist/charts.js +3 -2
- package/dist/charts.js.map +1 -1
- package/dist/core.js +377 -301
- package/dist/core.js.map +1 -1
- package/dist/explain.js +4 -4
- package/dist/explain.js.map +1 -1
- package/dist/types/View.d.ts +2 -2
- package/dist/types/explain.d.ts +9 -1
- package/dist/types/presets.d.ts +21 -0
- package/dist/types/scene/Node.d.ts +8 -0
- package/llms-full.txt +558 -0
- package/llms.txt +31 -0
- package/package.json +14 -4
package/README.md
CHANGED
|
@@ -13,6 +13,22 @@ business apps: charts, labelled scenes, diagrams, dashboards and product viewers
|
|
|
13
13
|
agents too.
|
|
14
14
|
- **No runtime dependencies.** ES modules, with TypeScript types.
|
|
15
15
|
|
|
16
|
+
**Using a coding agent?** Point it at [llms-full.txt](https://kevs3d.co.uk/phoria2/llms-full.txt) - the whole API
|
|
17
|
+
in one page ([llms.txt](https://kevs3d.co.uk/phoria2/llms.txt) is the short index). Both ship in the
|
|
18
|
+
package too, at `node_modules/phoria2/llms-full.txt`.
|
|
19
|
+
|
|
20
|
+
**Claude Code**: install the phoria2 plugin, and Claude reaches for phoria2 when asked for 3D charts,
|
|
21
|
+
diagrams, explainers or dashboards - with the reference to hand and a check that loads the page in
|
|
22
|
+
Chrome and reports what's wrong:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
/plugin marketplace add kevinroast/phoria2
|
|
26
|
+
/plugin install phoria2@phoria2
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The skill inside it ([claude-plugin/skills/phoria2](claude-plugin/skills/phoria2)) follows the Agent
|
|
30
|
+
Skills standard, so other agents that read skills can use the folder as it is.
|
|
31
|
+
|
|
16
32
|
## Install
|
|
17
33
|
|
|
18
34
|
```sh
|
|
@@ -35,12 +51,12 @@ own). Pin the version so a new release can't change your page:
|
|
|
35
51
|
<script type="importmap">
|
|
36
52
|
{
|
|
37
53
|
"imports": {
|
|
38
|
-
"phoria2": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
39
|
-
"phoria2/charts": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
40
|
-
"phoria2/particles": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
41
|
-
"phoria2/gltf": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
42
|
-
"phoria2/motion": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
43
|
-
"phoria2/edit": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.
|
|
54
|
+
"phoria2": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/phoria2.js",
|
|
55
|
+
"phoria2/charts": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/charts.js",
|
|
56
|
+
"phoria2/particles": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/particles.js",
|
|
57
|
+
"phoria2/gltf": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/gltf.js",
|
|
58
|
+
"phoria2/motion": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/motion.js",
|
|
59
|
+
"phoria2/edit": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.5/dist/edit.js"
|
|
44
60
|
}
|
|
45
61
|
}
|
|
46
62
|
</script>
|
package/dist/charts.js
CHANGED
|
@@ -186,7 +186,7 @@ function S({ box: e, axes: t, theme: r, overlap: i }) {
|
|
|
186
186
|
overlap: i
|
|
187
187
|
}));
|
|
188
188
|
}
|
|
189
|
-
}, E = (e) => e[1] >= -.08, D = (e) => e >=
|
|
189
|
+
}, E = (e) => e[1] >= -.08, D = (e) => e >= -.1 ? 1 : -1;
|
|
190
190
|
return T("x", [-1, 1].flatMap((e) => [0, o].map((t) => ({
|
|
191
191
|
when: (n) => t === 0 === E(n) && D(n[2]) === e,
|
|
192
192
|
at: (n, r) => [
|
|
@@ -1362,7 +1362,8 @@ function Te(e, t, n, r) {
|
|
|
1362
1362
|
let e = /* @__PURE__ */ new Set();
|
|
1363
1363
|
return Object.entries(t).filter(([t, n]) => n.field && t !== "key" && !e.has(n.field) && e.add(n.field)).map(([, e]) => e);
|
|
1364
1364
|
}
|
|
1365
|
-
|
|
1365
|
+
let i = Array.isArray(e) ? e : [e], a = (e) => typeof e == "string" && Object.entries(t).find(([t, n]) => t !== "key" && n.field === e)?.[1];
|
|
1366
|
+
return i.map((e) => a(e) || J("tooltip", e, n, r));
|
|
1366
1367
|
}
|
|
1367
1368
|
// src/charts/style.js
|
|
1368
1369
|
var Ee = "\n/* ticks are bare text: the padding is breathing room, so the overlap the label layout allows never runs them together */\n:where(.phoria-axis-tick) { padding: 0 4px; color: #8b909c; font: 11px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; }\n:where(.phoria-axis-title) { color: #c8ccd4; font: 600 12px/1.2 system-ui, sans-serif; }\n:where(.phoria-value) { padding: 1px 5px; border-radius: 4px; background: rgba(16, 16, 20, 0.72); color: #eee;\n font: 11px/1.3 system-ui, sans-serif; font-variant-numeric: tabular-nums; }\n:where(.phoria-light.phoria-axis-tick) { color: #5d6370; }\n:where(.phoria-light.phoria-axis-title) { color: #2b2f37; }\n:where(.phoria-light.phoria-value) { background: rgba(255, 255, 255, 0.85); color: #222; }\n:where(.phoria-legend) { position: absolute; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;\n border-radius: 8px; background: rgba(20, 20, 24, 0.78); color: #e6e6e6; font: 12px/1.3 system-ui, sans-serif;\n pointer-events: auto; max-height: calc(100% - 24px); overflow: auto; }\n:where(.phoria-light.phoria-legend) { background: rgba(255, 255, 255, 0.88); color: #222; }\n:where(.phoria-legend-top-right) { top: 12px; right: 12px; }\n:where(.phoria-legend-top-left) { top: 12px; left: 12px; }\n:where(.phoria-legend-bottom-right) { bottom: 12px; right: 12px; }\n:where(.phoria-legend-bottom-left) { bottom: 12px; left: 12px; }\n:where(.phoria-legend-title) { opacity: 0.7; font-size: 11px; margin-bottom: 2px; }\n:where(.phoria-legend-item) { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;\n color: inherit; font: inherit; text-align: left; cursor: pointer; }\n:where(.phoria-legend-item.off) { opacity: 0.35; }\n:where(.phoria-legend-swatch) { width: 10px; height: 10px; border-radius: 2px; flex: none; }\n:where(.phoria-legend-ramp) { width: 120px; height: 8px; border-radius: 2px; }\n:where(.phoria-legend-scale) { display: flex; justify-content: space-between; opacity: 0.7; font-size: 11px; }\n";
|