npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mcmhomes/panorama-viewer

v1.11.2

Published

Provides React components to render panoramas.

Downloads

422

Readme

On Push to Master

@mcmhomes/panorama-viewer

@mcmhomes/panorama-viewer is a React library, made for visualizing the panorama pictures made by the MCM Panorama UnrealEngine plugin.

Installation

To install the library, run the following command:

npm install @mcmhomes/panorama-viewer

Usage

To show a panorama picture, you can use the PanoramaViewer component, like so:

import {PanoramaViewer} from '@mcmhomes/panorama-viewer';

...

<PanoramaViewer homeId="xxxxxxxxx"/>

The PanoramaViewer component can be found in the PanoramaViewer.jsx file.

The provided utility functions can be found in the PanoramaViewerUtils.jsx file.

For example code, see the MCM Panorama Demo Frontend, the AppViewer.jsx file in particular.

Panorama pictures

Rendering workflow

To create panorama pictures, the following steps are taken:

  1. The UnrealEngine project is set up with the MCM Panorama UnrealEngine plugin, and the render button is pressed.
  2. The raw panorama pictures will then have to be processed by the Docker script, located at scripts/postprocessor/.
    • more info down below on how to do this exactly
    • this will cause the ready-to-use panorama pictures (KTX2s) to be created
  3. Optionally, to use the pictures in production, the ready-to-use panorama pictures will have to be upload to the MCM Panorama S3 bucket.
    • the Docker script will also take care of this, more info down below
    • the panorama pictures can then be viewed at https://d11xh1fqz0z9k8.cloudfront.net/?a=xxxxxxxxx, where xxxxxxxxx is the home ID (the home ID is configured in Unreal)

Docker script

In order to process the raw panorama pictures, the Docker script will have to be used.

To run the Docker script, make sure of the following:

  1. Docker is installed, verify this by running docker --version in the command prompt.
  2. Docker is running, verify this by running docker ps in the command prompt.
    • this should not return an error
    • it should return a table, which can be empty
  3. The MCM Generate-Panorama Docker script is installed, to do this, run the scripts/postprocessor/Dockerfile.install.cmd script.
    • this will install the Docker script into your Docker installation
  4. Finally, the Docker script can be run, by copying the scripts/postprocessor/Dockerfile.run-XXX.cmd script into the panorama folder on which you'd like it to run on, and by then running the copied-over script file. There are three versions of the script:
    • the "test" script, called Dockerfile.run-test.cmd, which will simply process the panorama pictures for testing them locally
    • the "sso" script, called Dockerfile.run-sso.cmd, which will not only process the panorama pictures, but also upload them to the MCM Panorama S3 bucket (for production use)
    • the "sso-full" script, called Dockerfile.run-sso-full.cmd, which will do the same thing as the "sso" script, but will also make sure the latest version of the post-processing script is download and installed, this is the recommended script to use in production, as it ensures the latest version of the post-processing script is used (PS: before using this script, you'll have to edit it, so that it contains the path pointing to your git repo)

Locally testing panorama pictures (without uploading them to S3)

The MCM Panorama Demo Frontend (whether it's running locally or in production) can also access locally-hosted panorama pictures. This is useful to test panorama pictures before uploading them to production. To do this, make sure of the following:

  1. The panorama pictures are hosted locally, like by running npx --yes serve ./ -l 8080 --cors in the directory where all your panorama collection folders are located.
  2. You add the required query parameter to the URL, like so:
    • local demo frontend: http://localhost:8000/?c=http://localhost:8080
    • production demo frontend: https://d11xh1fqz0z9k8.cloudfront.net/?c=http://localhost:8080
    • the URL can be any URL, including any path, port number, etc, so a URL like this is also valid: http://localhost/my-panorama-pictures