Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhangyu1818/rc-pannellum
React Pannellum
https://github.com/zhangyu1818/rc-pannellum
Last synced: 23 days ago
JSON representation
React Pannellum
- Host: GitHub
- URL: https://github.com/zhangyu1818/rc-pannellum
- Owner: zhangyu1818
- Created: 2020-06-30T07:47:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-22T01:19:54.000Z (over 4 years ago)
- Last Synced: 2024-11-08T20:49:21.648Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 |