New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mpilot-ui

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mpilot-ui

User interface for MPilot

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

MPilot Model Viewer

Mpilot UI is a JavaScript library for visualizing MPilot models. MPilot UI is implemented using Svelte and provides a Svelte component, as well as a vanilla JavaScript API.

Using with Svelte

You can use the ModelDiagram component to place a model visualization in your Svelte application. In order to do this, you will first have to create a program object from model source.

import { Program } from 'mpilot/lib'
const program = Program.fromSource(modelSource)  

With the program object, you can create the diagram in your Svelte component.

<script>
  import ModelDiagram from 'mpilot-ui/lib/components/ModelDiagram'
</script>

<ModelDiagram {program} />

In addition to program, the ModelDiagram component takes three other props that affect the visualization behavior.

Props

  • program -- The MPilot program object
  • values -- An object mapping nodes in the model to values (e.g., when the user clicks a location on a map). See below for the object format.
  • labels -- An object mapping nodes in the model to custom labels. See below for the object format.
  • mode -- The diagram mode. Can be either 'full' or 'narrow' (default). Narrow mode only shows part of the diagram at a time, adjusting which nodes are visible as the user explores the model.

Values object schema

{
  '<node result name>': {
    value: '<numerical value>',
    label: '<value label>',
    color: '<value color>'
  }
}

Labels object schema

{
  '<node result name>': '<label>'
}

Using with vanilla JavaScript

TODO...

FAQs

Package last updated on 24 Feb 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