phoria2 1.0.0-rc.2 → 1.0.0-rc.3
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 +26 -3
- package/dist/charts.js +309 -304
- package/dist/charts.js.map +1 -1
- package/dist/core.js +206 -53
- package/dist/core.js.map +1 -1
- package/dist/explain.js +1 -1
- package/dist/gltf.js +140 -140
- package/dist/gltf.js.map +1 -1
- package/dist/motion.js +170 -0
- package/dist/motion.js.map +1 -0
- package/dist/particles.js +37 -37
- package/dist/particles.js.map +1 -1
- package/dist/passes.js +12 -12
- package/dist/passes.js.map +1 -1
- package/dist/phoria2.js +1 -1
- package/dist/picking.js +5 -5
- package/dist/picking.js.map +1 -1
- package/dist/snapshot.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/types/geometry/Curve.d.ts +131 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/motion/Timeline.d.ts +103 -0
- package/dist/types/motion/ease.d.ts +4 -0
- package/dist/types/motion/follow.d.ts +66 -0
- package/dist/types/motion/index.d.ts +15 -0
- package/dist/types/scene/Node.d.ts +9 -5
- package/dist/types/value/Vec3.d.ts +2 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -27,6 +27,28 @@ Or straight from a CDN, with no build step:
|
|
|
27
27
|
</script>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
To use more than the core - charts, particles, glTF or motion - map each import to the package's own
|
|
31
|
+
files, so they share one copy of the core (the CDN's ready-made `+esm` builds each bundle their
|
|
32
|
+
own). Pin the version so a new release can't change your page:
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<script type="importmap">
|
|
36
|
+
{
|
|
37
|
+
"imports": {
|
|
38
|
+
"phoria2": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.3/dist/phoria2.js",
|
|
39
|
+
"phoria2/charts": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.3/dist/charts.js",
|
|
40
|
+
"phoria2/particles": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.3/dist/particles.js",
|
|
41
|
+
"phoria2/gltf": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.3/dist/gltf.js",
|
|
42
|
+
"phoria2/motion": "https://cdn.jsdelivr.net/npm/phoria2@1.0.0-rc.3/dist/motion.js"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
<script type="module">
|
|
47
|
+
import { View } from 'phoria2'
|
|
48
|
+
import { chart } from 'phoria2/charts'
|
|
49
|
+
</script>
|
|
50
|
+
```
|
|
51
|
+
|
|
30
52
|
## A first scene
|
|
31
53
|
|
|
32
54
|
```html
|
|
@@ -112,10 +134,11 @@ A full example, with a chart that follows its data, is in
|
|
|
112
134
|
|
|
113
135
|
| Import | |
|
|
114
136
|
|---|---|
|
|
115
|
-
| `phoria2` | the view, scene graph, cameras, lights, materials, geometry, textures, picking, labels, `create()` from JSON |
|
|
137
|
+
| `phoria2` | the view, scene graph, cameras, lights, materials, geometry, curves, textures, picking, labels, `create()` from JSON |
|
|
116
138
|
| `phoria2/charts` | `chart()` - charts from a spec of mark, data and channels, and the scales they use |
|
|
117
139
|
| `phoria2/particles` | `Emitter` and `Body` |
|
|
118
140
|
| `phoria2/gltf` | `loadGLTF()` - glTF 2.0 models with their materials and animations |
|
|
141
|
+
| `phoria2/motion` | `Timeline` - named steps played in order, `follow()` along a curve, `reveal()` a path as it's travelled - for explainers and guided tours |
|
|
119
142
|
|
|
120
143
|
## Browsers
|
|
121
144
|
|
|
@@ -123,8 +146,8 @@ Any browser with WebGL 2: current Chrome, Edge, Firefox and Safari (desktop and
|
|
|
123
146
|
|
|
124
147
|
## Examples
|
|
125
148
|
|
|
126
|
-
The demo gallery shows each feature and a few showcase scenes;
|
|
127
|
-
[`demos/`](https://github.com/kevinroast/phoria2/tree/main/demos).
|
|
149
|
+
The [demo gallery](https://kevs3d.co.uk/phoria2/) shows each feature and a few showcase scenes;
|
|
150
|
+
its source is in [`demos/`](https://github.com/kevinroast/phoria2/tree/main/demos).
|
|
128
151
|
|
|
129
152
|
## Licence
|
|
130
153
|
|