Socket
Socket
Sign inDemoInstall

@biz-dev-ops/model-viewer

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @biz-dev-ops/model-viewer

Webcomponent to translate any JSON schema into a model view.


Version published
Maintainers
1
Created

Readme

Source

Model Viewer for md-docs

HTML5 web component which renders every JSON-schema object into a human-readable and -understandable form.

Installation

npm install --save @synion/model-viewer

Usage

  • Add model-viewer.js to the webpage
  • Add the model JSON to the global object window.modelViewer .
  • Add the <model-viewer></model-viewer> to the page

Attributes

id

The id attribute identifies the property within the window.modelViewer.

name

The name attribute is a human-readable name fallback. Only used when the model doesn't provide a title.

data-json

A HTML escaped version of the JSON-schema model.

model

The JSON-schema model, must be set via JavaScript.

Examples

HTML

<model-viewer 
    id="trainset"
    name="a name"
    data-json="{ &quot;key &quot;: &quot;value &quot; }" />

HTML and JavaScript

<model-viewer id="trainset" />

<script>
    document.getElementById('trainset').model = {
    	...
    }
<script>

Keywords

FAQs

Last updated on 24 Aug 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc