Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kappasigmamu/canary-component

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kappasigmamu/canary-component

React Component that renders the KappaSigmaMu Canary in 3D

  • 0.4.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-68.97%
Maintainers
3
Weekly downloads
 
Created
Source

3D Kusama Canary Component

3D Canary Screenshot

A React component to render an interactive 3D Kusama Canary built on react-three-fiber.

It also supports loading different models and can be changed by given configurations.

Using

Import the component:

 import ThreeCanary from "@kappasigmamu/canary-component"

Instatiate the component passing the model as attribute along with the right configurations for the model:

 const config = {
   "nodeCoords": "Baked_GIL_BUSTO003_1.geometry.attributes.position",
   "nodeSigns": [-1, 1, -1],
   "nodeScale": 0.5,
   "nodeGroupScale": 0.1,
   "meshColorIndex": 3,
   "modelMaterial": "MatWireframe",
   "modelScale": 0.2,
   "gridPosition": [0, -0,4, 0],
   "cameraPosition": [-1, 2.5, 4]
 }
 
 <ThreeCanary
   objectUrl={ "/assets/gil.glb" }
   nodes={ this.state.nodesData }
   onNodeClick={ (nodeId) => {
     console.log("onNodeClick", nodeId)}
   }
   config={ config }
 />

If no config is given, the components defaults to the Canary model to keep backward compatibility.

It's also possible to import default configurations for models related to KSM (e.g. Canary and Gilberto Gil's bust:

 import ThreeCanary, { defaultCanaryConfig} from "@kappasigmamu/canary-component"

 <ThreeCanary
   objectUrl={ "/assets/gil.glb" }
   nodes={ this.state.nodesData }
   onNodeClick={ (nodeId) => {
     console.log("onNodeClick", nodeId)}
   }
   config={ defaultCanaryConfig["gil"] }
 />

Check ./src/index.js for a complete example on how to use the component.

Developing

Make sure you have latest stable Node.js installed (see nvm):

git clone git@github.com:KappaSigmaMu/canary-component.git
cd canary-component/
npm install

Start development mode:

npm run start

That should bring you to http://localhost:3000 with a hot-reload React app. Edit files at src/ to see live updates.

Production build

npm run build
git commit ...
git tag 0.x.x
git push
npm publish

Keywords

FAQs

Package last updated on 27 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc