Model Viewer for md-docs
HTML5 web component which renders every JSON-schema object into a human-readable and -understandable form.
- 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
The id attribute identifies the property within the window.modelViewer
.
The name attribute is a human-readable name fallback. Only used when the model doesn't provide a title.
A HTML escaped version of the JSON-schema model.
The JSON-schema model, must be set via JavaScript.
<model-viewer
id="trainset"
name="a name"
data-json="{ "key ": "value " }" />
<model-viewer id="trainset" />
<script>
document.getElementById('trainset').model = {
json-schema...
}
<script>