I'd like to offer my users an interface to edit JSON objects.
For example I have a JavaScript that calls Google charts with the following options:
var options={
chartType: "Pie",
title:"Chart title",
is3D:false,
width:500,
height:300,
};
Ideally my users should be able to modify the options themselves without having to look into the code. They would be presented with a UI automatically built from the object, where:
Are there libraries for this? If not, any suggestion to get started?
I could of course build the form manually, but the idea is to have a generic solution that works for any object.
JSON GUI is a tool for making even easier mock up a full REST API for your project. It's a GUI for json-server so you don't have to write JSON or generator functions to set up your API. Even though it's made for json-server, it can also be used as a JSON generator.
json format provides a schema to create a simple User Interface (UI) between geoh5py and Geoscience ANALYST Pro. The format uses JSON objects to represent script parameters used in the UI, and pass those parameters to an accompanying python script. Each ui.
JSON Object Example A JSON object contains data in the form of key/value pair. The keys are strings and the values are the JSON types. Keys and values are separated by colon. Each entry (key/value pair) is separated by comma.
JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa).
I found this link with conventions for describing JSON: http://www.json-schema.org/
Searching for "JSON schema" led me to a number of solutions, and in particular this post:
GUI-based or Web-based JSON editor that works like property explorer
It was started two years ago, but is apparently well documented and kept up to date.
Also, a post from April 2012 on the ibm website:
http://www.ibm.com/developerworks/library/wa-jsonschema/index.html?cmp=dw&cpb=dwwdv&ct=dwnew&cr=dwnen&ccy=zz&csr=040512
Problem
How to provide a user-friendly means of constructing arbitrary JSON structures where:
Solution
If this is the basic premise of the question, this approach does appear to be possible using any of various approaches under the "MVVM" nomenclature (which is apparently a variant of the "MVC" meme).
Examples
http://knockoutjs.com/examples/cartEditor.html http://en.wikipedia.org/wiki/Model_View_ViewModel#Open_source_MVVM_frameworks
See Also
GUI-based or Web-based JSON editor that works like property explorer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With