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

@wandelbots/wandelbots-js-react-components

v1.40.0

Published

React UI toolkit for building applications on top of the Wandelbots platform

Downloads

4,533

Readme

@wandelbots/wandelbots-js-react-components

NPM version npm bundle size Release

A growing collection of ready-made React UI components based on MaterialUI and React Three Fiber for use with the Wandelbots platform.

npm install @wandelbots/wandelbots-js-react-components

Basic usage:

Import your desired components or functions from the package:

import { JoggingPanel, ... } from '@wandelbots/wandelbots-js-react-components'

See the Storybook for implementation details of each component.

Index

UI

JoggingPanel

The JoggingPanel is a high-level user interface for manually moving a robot using the Wandelbots stack. It needs only a NovaClient instance from wandelbots-js and the id of a motion group to connect to.

type JoggingPanelProps = {
  /** Connection to a Nova instance to use for jogging */
  nova: NovaClient
  /** Id of the motion group to move e.g. 0@ur5e **/
  motionGroupId: string
  /** Callback with the jogging panel's state store for further customization/config */
  onSetup: (store: JoggingStore) => void
  /** Any children will go at the bottom of the panel under the default components */
  children?: React.ReactNode
}

WandelscriptEditor

The WandelscriptEditor provides an interface for editing snippets of Wandelscript code with the appropriate syntax highlighting. It uses the Monaco editor under the hood.

type WandelscriptEditorProps = {
  /** The current Wandelscript content of the code editor (controlled component) */
  code?: string
  /** What to do when the user edits the code */
  onChange?: (
    code: string | undefined,
    ev: editor.IModelContentChangedEvent,
  ) => void
  /** Callback to further configure monaco on startup if needed */
  monacoSetup?: (monaco: Monaco) => void
}

Theming

The UI components presented in this library will respect the Material UI theme of the application they are rendered within, allowing customization with the MUI theming system.

Using the Wandelbots MUI theme To make the components look exactly like they do in the storybook, pass the Wandelbots MUI theme to ThemeProvider.

import { ThemeProvider } from "@mui/material";
import { createNovaMuiTheme, JoggingPanel } from "@wandelbots/wandelbots-js-react-components"

const theme = createNovaMuiTheme()

<ThemeProvider theme={theme}>
  <JoggingPanel ... />
</ThemeProvider>

Viewport

Robot

This Robot component adds the robot to the 3D viewport. Use it together with the connectedMotionGroup from @wandelbots/wandelbots-js.

<Robot connectedMotionGroup={connectedMotionGroup} />

The robot model are loaded from the jsdelivr CDN.

In case you want to use the application offline, you can download the models and host them locally. You can override the URL resolver of the Robot component by passing a getModel function like:

<Robot
  getModel={() => `public/${connectedMotionGroup.modelFromController}.glb`}
  connectedMotionGroup={connectedMotionGroup}
/>
export type ConnectecMotionGroupRobotProps = {
  connectedMotionGroup: ConnectedMotionGroup // The connected motion group from wandelbots-js
  getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
  isGhost?: boolean // Whether the robot should be displayed transparently
} & GroupProps
SupportedRobot

The SupportedRobot can be used to display a robot model without the need for a connectedMotionGroup from @wandelbots/wandelbots-js.

<SupportedRobot
  rapidlyChangingMotionState={rapidlyChangingMotionState}
  dhParameters={dhParameters as any}
  modelFromController={modelFromController || ""}
  getModel={() => `./robot-pad/models/${modelFromController}.glb`}
/>
export type SupportedRobotProps = {
  rapidlyChangingMotionState: MotionGroupStateResponse // The motion state of the robot
  modelFromController: string // The model name of the robot
  dhParameters: DHParameter[] // The DH parameters of the robot
  getModel?: (modelFromController: string) => string // A function that returns the URL of the robot model
  isGhost?: boolean // Whether the robot should be displayed transparently
} & GroupProps

Lighting

The PresetEnvironment component adds a default lighting setup to the 3D viewport.

<PresetEnvironment>

Safety

The SafetyZonesRenderer component visualizes the safety zones of the controller.

<SafetyZonesRenderer safetyZones={connectedMotionGroup.safetyZones || []} />

Contributing

To set up wandelbots-js-react-components for development, first clone the repo and run:

npm install

Then you can run the storybook to develop the components:

npm run dev

Local Testing

To test the package locally, you can run:

npm run build
npm pack

this will generate a .tgz file in the root of the project. You can then install this package in another project with:

npm install /path/to/wandelbots-wandelbots-js-react-components-0.0.1.tgz

npm link leads to issues with the react three fiber components (peerDependencies are not supported), so it is recommended to use npm install with the .tgz file.