0.2.0 • Published 6 months ago

@synion/model-viewer v0.2.0

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
6 months ago

Model Viewer for md-docs

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

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 = {
    	json-schema...
    }
<script>
0.2.0

6 months ago

0.1.5

6 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago