Describe new mode `preview` in docs

This commit is contained in:
jos 2019-07-24 14:00:39 +02:00
parent 6bef66aaba
commit 72455e3302
3 changed files with 27 additions and 17 deletions

View File

@ -5,8 +5,8 @@ https://github.com/josdejong/jsoneditor
## not yet published, version 6.2.0
- Implemented new mode `preview`, capable of working with JSON files up to
about 500 MB.
- Implemented new mode `preview`, capable of working with JSON documents
up to 500 MiB.
- Fixed #730: in `code` mode, there was an initial undo action which clears
the content.
- Upgraded dependencies `vanilla-picker@2.9.1`, `mobius1-selectr@2.4.13`,

View File

@ -23,7 +23,10 @@ Cross browser testing for JSONEditor is generously provided by <a href="https://
## Features
### Tree editor
JSONEditor has various modes, with the following features.
### Tree mode
- Change, add, move, remove, and duplicate fields and values.
- Sort arrays and objects.
- Transform JSON using [JMESPath](http://jmespath.org/) queries.
@ -33,18 +36,27 @@ Cross browser testing for JSONEditor is generously provided by <a href="https://
- Undo and redo all actions.
- JSON schema validation (powered by [ajv](https://github.com/epoberezkin/ajv)).
### Code editor
### Code mode
- Colorized code (powered by [Ace](https://ace.c9.io)).
- Inspect JSON (powered by [Ace](https://ace.c9.io)).
- Format and compact JSON.
- Repair JSON.
- JSON schema validation (powered by [ajv](https://github.com/epoberezkin/ajv)).
### Text editor
### Text mode
- Format and compact JSON.
- Repair JSON.
- JSON schema validation (powered by [ajv](https://github.com/epoberezkin/ajv)).
### Preview mode
- Handle large JSON documents up to 500 MiB.
- Transform JSON using [JMESPath](http://jmespath.org/) queries.
- Format and compact JSON.
- Repair JSON.
- JSON schema validation (powered by [ajv](https://github.com/epoberezkin/ajv)).
## Documentation
@ -63,10 +75,6 @@ with npm (recommended):
npm install jsoneditor
with bower:
bower install jsoneditor
> Note that to use JSONEditor in Internet Explorer 11, it is necessary
> to load a polyfill for `Promise` in your application.

View File

@ -52,7 +52,7 @@ Constructs a new JSONEditor.
Set a callback function triggered when the contents of the JSONEditor change.
This callback does not pass the changed contents, use `get()` or `getText()` for that.
Note that `get()` can throw an exception in mode `text` or `code`, when the editor contains invalid JSON.
Note that `get()` can throw an exception in mode `text`, `code`, or `preview`, when the editor contains invalid JSON.
Will only be triggered on changes made by the user, not in case of programmatic changes via the functions `set`, `setText`, `update`, or `updateText`.
See also callback functions `onChangeJSON(json)` and `onChangeText(jsonString)`.
@ -198,7 +198,9 @@ Constructs a new JSONEditor.
- `{String} mode`
Set the editor mode. Available values: 'tree' (default), 'view', 'form', 'code', 'text'. In 'view' mode, the data and datastructure is read-only. In 'form' mode, only the value can be changed, the datastructure is read-only. Mode 'code' requires the Ace editor to be loaded on the page. Mode 'text' shows the data as plain text.
Set the editor mode. Available values: 'tree' (default), 'view', 'form', 'code', 'text', 'preview'. In 'view' mode, the data and datastructure is read-only. In 'form' mode, only the value can be changed, the data structure is read-only. Mode 'code' requires the Ace editor to be loaded on the page. Mode 'text' shows the data as plain text.
The 'preview' mode can handle large JSON documents up to 500 MiB. It shows a preview of the data, and allows to
transform, sort, filter, format, or compact the data.
- `{String[]} modes`
@ -229,7 +231,7 @@ Constructs a new JSONEditor.
- `{Number} indentation`
Number of indentation spaces. 2 by default. Only applicable when `mode` is 'code' or 'text'.
Number of indentation spaces. 2 by default. Only applicable when `mode` is 'code', 'text', or 'preview'.
- `{String} theme`
@ -326,7 +328,7 @@ Constructs a new JSONEditor.
- `{boolean} statusBar`
Adds status bar to the bottom of the editor - the status bar shows the cursor position and a count of the selected characters. True by default. Only applicable when `mode` is 'code' or 'text'.
Adds status bar to the bottom of the editor - the status bar shows the cursor position and a count of the selected characters. True by default. Only applicable when `mode` is 'code', 'text', or 'preview'.
- `{function} onTextSelectionChange(start, end, text)`
@ -497,7 +499,7 @@ Set focus to the JSONEditor.
Get JSON data.
This method throws an exception when the editor does not contain valid JSON,
which can be the case when the editor is in mode `code` or `text`.
which can be the case when the editor is in mode `code`, `text`, or `preview`.
*Returns:*
@ -513,7 +515,7 @@ Retrieve the current mode of the editor.
- `{String} mode`
Current mode of the editor for example `tree` or `code`.
Current mode of the editor, for example `tree` or `code`.
#### `JSONEditor.getName()`
@ -557,7 +559,7 @@ Get JSON data as string.
- `{String} jsonString`
Contents of the editor as string. When the editor is in code `text` or `code`,
Contents of the editor as string. When the editor is in code `text`, `code` or `preview`,
the returned text is returned as-is. For the other modes, the returned text
is a compacted string. In order to get the JSON formatted with a certain
number of spaces, use `JSON.stringify(JSONEditor.get(), null, 2)`.
@ -596,7 +598,7 @@ Switch mode. Mode `code` requires the [Ace editor](http://ace.ajax.org/).
- `{String} mode`
Available values: `tree`, `view`, `form`, `code`, `text`.
Available values: `tree`, `view`, `form`, `code`, `text`, `preview`.
#### `JSONEditor.setName(name)`