@ericchen1990/pano-view 0.1.0 → 0.1.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/README.md +22 -12
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Composable React components for equirectangular and krpano-style multiresolution panorama viewers.
|
|
4
4
|
|
|
5
|
+
Try the components in the [live playground](https://pano-view-playground.vercel.app/).
|
|
6
|
+
|
|
7
|
+
## krpano-compatible tile output
|
|
8
|
+
|
|
9
|
+
Use this package when you want a React-native viewer around equirectangular
|
|
10
|
+
images or an existing krpano cube-tile pyramid. `Tile` understands the common
|
|
11
|
+
krpano-style multires directory layout by default, while keeping rendering,
|
|
12
|
+
controls, hotspots, and scene transitions in your React application. It is
|
|
13
|
+
compatible with that tile output format but is not affiliated with krpano.
|
|
14
|
+
|
|
5
15
|
## Install
|
|
6
16
|
|
|
7
17
|
```bash
|
|
@@ -17,7 +27,7 @@ React 19, React DOM 19, `@react-three/fiber` 9, and Three.js are peer dependenci
|
|
|
17
27
|
```tsx
|
|
18
28
|
"use client";
|
|
19
29
|
|
|
20
|
-
import { PanoView, Sphere } from "@pano-view
|
|
30
|
+
import { PanoView, Sphere } from "@ericchen1990/pano-view";
|
|
21
31
|
|
|
22
32
|
export function SphereExample() {
|
|
23
33
|
return (
|
|
@@ -41,7 +51,7 @@ tiles/{face}/l{level}/{row}/l{level}_{face}_{col}_{row}.webp
|
|
|
41
51
|
Faces are `f`, `r`, `b`, `l`, `u`, and `d`; rows and columns are 1-based.
|
|
42
52
|
|
|
43
53
|
```tsx
|
|
44
|
-
import { PanoView, Tile } from "@pano-view
|
|
54
|
+
import { PanoView, Tile } from "@ericchen1990/pano-view";
|
|
45
55
|
|
|
46
56
|
export function TileExample() {
|
|
47
57
|
return (
|
|
@@ -95,7 +105,7 @@ import {
|
|
|
95
105
|
PanoramaScenes,
|
|
96
106
|
PanoView,
|
|
97
107
|
type PanoramaScene,
|
|
98
|
-
} from "@pano-view
|
|
108
|
+
} from "@ericchen1990/pano-view";
|
|
99
109
|
|
|
100
110
|
const scenes: PanoramaScene[] = [
|
|
101
111
|
{ id: "lobby", type: "sphere", src: "/panoramas/lobby.webp" },
|
|
@@ -139,7 +149,7 @@ import {
|
|
|
139
149
|
Sphere,
|
|
140
150
|
AutoRotate,
|
|
141
151
|
type PanoViewHandle,
|
|
142
|
-
} from "@pano-view
|
|
152
|
+
} from "@ericchen1990/pano-view";
|
|
143
153
|
|
|
144
154
|
export function ControlledExample() {
|
|
145
155
|
const ref = useRef<PanoViewHandle>(null);
|
|
@@ -184,7 +194,7 @@ import {
|
|
|
184
194
|
Sphere,
|
|
185
195
|
panoPositionToVector3,
|
|
186
196
|
type HotspotPosition,
|
|
187
|
-
} from "@pano-view
|
|
197
|
+
} from "@ericchen1990/pano-view";
|
|
188
198
|
|
|
189
199
|
export function PlacementExample() {
|
|
190
200
|
const place = (position: HotspotPosition) => {
|
|
@@ -229,7 +239,7 @@ For persistence or a host-owned editor, use the exported discriminated
|
|
|
229
239
|
open `polyline` extension:
|
|
230
240
|
|
|
231
241
|
```ts
|
|
232
|
-
import type { HotspotDefinition } from "@pano-view
|
|
242
|
+
import type { HotspotDefinition } from "@ericchen1990/pano-view";
|
|
233
243
|
|
|
234
244
|
const hotspots: HotspotDefinition[] = [
|
|
235
245
|
{ type: "image", id: "gallery", position: { yaw: 24, pitch: -5 }, src: "/hotspots/card.webp" },
|
|
@@ -251,7 +261,7 @@ error reporting belong.
|
|
|
251
261
|
are angular degrees, so they remain independent of the canvas resolution.
|
|
252
262
|
|
|
253
263
|
```tsx
|
|
254
|
-
import { ImageHotspot, PanoView, Sphere } from "@pano-view
|
|
264
|
+
import { ImageHotspot, PanoView, Sphere } from "@ericchen1990/pano-view";
|
|
255
265
|
|
|
256
266
|
<PanoView style={{ height: 560 }}>
|
|
257
267
|
<Sphere src="/panoramas/room.webp" />
|
|
@@ -274,7 +284,7 @@ support `fill`, `stroke`, and `strokeWidth`; rectangles also support
|
|
|
274
284
|
`cornerRadius` and rings support `innerRadius`.
|
|
275
285
|
|
|
276
286
|
```tsx
|
|
277
|
-
import { GraphicHotspot } from "@pano-view
|
|
287
|
+
import { GraphicHotspot } from "@ericchen1990/pano-view";
|
|
278
288
|
|
|
279
289
|
<GraphicHotspot
|
|
280
290
|
id="wayfinding"
|
|
@@ -339,7 +349,7 @@ The component reports, rather than renders, self-intersecting polygons, shapes
|
|
|
339
349
|
that contain a pole, and shapes that cannot fit within one hemisphere.
|
|
340
350
|
|
|
341
351
|
```tsx
|
|
342
|
-
import { PolygonHotspot } from "@pano-view
|
|
352
|
+
import { PolygonHotspot } from "@ericchen1990/pano-view";
|
|
343
353
|
|
|
344
354
|
<PolygonHotspot
|
|
345
355
|
id="exhibit-zone"
|
|
@@ -378,7 +388,7 @@ whole-path drag, and vertex-change callback as `PolygonHotspot`, but it never
|
|
|
378
388
|
connects the final point to the first and has no fill.
|
|
379
389
|
|
|
380
390
|
```tsx
|
|
381
|
-
import { PolylineHotspot } from "@pano-view
|
|
391
|
+
import { PolylineHotspot } from "@ericchen1990/pano-view";
|
|
382
392
|
|
|
383
393
|
<PolylineHotspot
|
|
384
394
|
id="guided-route"
|
|
@@ -403,7 +413,7 @@ frame, rather than the full strip. `playing` is controlled by the host; `fps`
|
|
|
403
413
|
defaults to `12` and `loop` defaults to `true`.
|
|
404
414
|
|
|
405
415
|
```tsx
|
|
406
|
-
import { SequenceHotspot } from "@pano-view
|
|
416
|
+
import { SequenceHotspot } from "@ericchen1990/pano-view";
|
|
407
417
|
|
|
408
418
|
<SequenceHotspot
|
|
409
419
|
id="pulse"
|
|
@@ -429,7 +439,7 @@ released. `playsInline` defaults to `true`, `muted` to `true`, `loop` to
|
|
|
429
439
|
`false`, and `preload` to `"metadata"`.
|
|
430
440
|
|
|
431
441
|
```tsx
|
|
432
|
-
import { VideoHotspot } from "@pano-view
|
|
442
|
+
import { VideoHotspot } from "@ericchen1990/pano-view";
|
|
433
443
|
|
|
434
444
|
<VideoHotspot
|
|
435
445
|
id="clip"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ericchen1990/pano-view",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "React components for panoramic viewing experiences.",
|
|
5
5
|
"author": "Eric Chen",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,10 +44,6 @@
|
|
|
44
44
|
"react-dom": ">=19.0.0 <19.3.0",
|
|
45
45
|
"three": "^0.185.1"
|
|
46
46
|
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"build": "tsup",
|
|
49
|
-
"typecheck": "tsc --noEmit"
|
|
50
|
-
},
|
|
51
47
|
"devDependencies": {
|
|
52
48
|
"@react-three/fiber": "^9.7.0",
|
|
53
49
|
"@types/react": "^19.2.0",
|
|
@@ -57,5 +53,9 @@
|
|
|
57
53
|
"three": "^0.185.1",
|
|
58
54
|
"tsup": "^8.5.0",
|
|
59
55
|
"typescript": "^5.9.3"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"typecheck": "tsc --noEmit"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|