-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage #4
Comments
Sorry for the delay. I just merged a some code into this repo from another fork which is using the JSV as part of a larger application. I removed the extra code and have published to Bower(json-schema-viewer). You can install using Bower or clone the repo and use Grunt to build the JQM interface ( None of the extra attributes are required, if you don't supply them the viewer will ignore them or display a message stating that they weren't defined. However, the full draft-04 isn't supported, for example the viewer won't handle "format" - see the README for more background. I'll try to add some better documentation soon. |
Hey jlblcc, nice work...trying to use your code, however its hard to figure out how to use in browser..can you please provide some detailed documentation...thanks. |
It's on the todo list, #6. What issues are you having? |
I got past setup...i guess i am having trouble rendering properly...let me try and see if i can get past those... |
Hello, how I can load own schema to the viewer? |
You have smth like that (function($) {
var loc = window.location,
//if not already set, set the root schema location
//this allows dev ENV to override the schema location
schema = JSV.schema ? JSV.schema : loc.origin + loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1) + 'schemas/schema/schema.json';
JSV.init({
schema : schema,
plain : true, //don't use JQM
viewerHeight : $('#main-body').height(), //set initial dimensions of SVG
viewerWidth : $('#main-body').width()
}, function() {
$('#jsv-tree').css('width', '100%');
//set diagram width to 100%, this DOES NOT resize the svg container
//it will not adjust to window resize, needs a listener to support that
JSV.resetViewer();
$('#loading').fadeOut('slow');
});
})(jQuery); variable schema has to be the url of your schema. Otherwhie it loads Example: http://jlblcc.github.io/json-schema-viewer/basic.html |
Ok, thank you 2016-10-20 13:28 GMT+03:00 catalinux [email protected]:
|
I updated the README with the example from @catalinux. |
The text was updated successfully, but these errors were encountered: