Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhangyu1818/rc-pannellum

React Pannellum
https://github.com/zhangyu1818/rc-pannellum

Last synced: 23 days ago
JSON representation

React Pannellum

Awesome Lists containing this project

README

        

# rc-pannellum

just a simple code encapsulation, written in typescript and has some types inferable

original library [pannellum](https://github.com/mpetroff/pannellum)

## usage

```sh
yarn add rc-pannellum
```

```tsx
import Pannellum, { PannellumRef } from 'rc-pannellum';

const App = () => {
const viewerRef = useRef(null);

useEffect(() => {
// viewer instance
const viewer = viewerRef.current?.getViewer();
if (viewer) {
viewer.on('mousedown', (e: MouseEvent) => {
console.log(e);
});
}
}, []);

const config = {
autoLoad: true,
panorama: 'https://pannellum.org/images/alma.jpg',
};

return (

);
};
```
## props

| name | type | |
| --------- | ------------- | -------------------------------- |
| style | CSSProperties | container style |
| className | string | container classname |
| clickInfo | boolean | console pitch and yaw when click |