You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It returns a `JsonNodeElement` object, that is an `HTMLDivElement` with some extras. You can insert it anywhere in your DOM.
63
+
It returns a `BigJsonViewerDom` instance. Call `getRootElement()` on it to get a `JsonNodeElement`, that is an `HTMLDivElement` with some extras. You can insert it anywhere in your DOM.
66
64
67
65
## Options
68
66
69
-
When calling `elementFromData`, you can provide an object matching the interface `BigJsonViewerOptions`.
67
+
When calling `fromData`, you can provide an object matching the interface `BigJsonViewerOptions`.
70
68
71
69
Example:
72
70
@@ -80,6 +78,26 @@ Example:
80
78
81
79
## API
82
80
81
+
## `BigJsonViewerDom` methods
82
+
83
+
#### `getRootElement()`
84
+
85
+
Returns the `JsonNodeElement` that can be appended to the DOM.
86
+
87
+
#### `destroy()`
88
+
89
+
Call this to free resources. It will terminate any by the instance started worker.
Searches the tree by the specified `pattern` and `searchArea`. Returns a `TreeSearchCursor`, which contains all matches and methods to jump the focus between the matches.
94
+
95
+
*`openLimit` is `1` by default. But can be `Infinity` or any number.
96
+
*`searchArea` describes where the pattern should be searched. Has the following options:
97
+
*`'all'` search in keys and values (default)
98
+
*`'keys'` search only in keys
99
+
*`'values'` search only in values
100
+
83
101
## `JsonNodeElement` methods
84
102
85
103
#### `openNode()`
@@ -115,16 +133,6 @@ Returns a list of opened paths.
115
133
116
134
When you have a limit of 50 nodes and you open the second stub `[50 ... 99]`, a path it retuned that contains the name of the first node in the stub.
Searches the tree by the specified `pattern` and `searchArea`. Returns a `TreeSearchCursor`, which contains all matches and methods to jump the focus between the matches.
121
-
122
-
*`openLimit` is `1` by default. But can be `Infinity` or any number.
123
-
*`searchArea` describes where the pattern should be searched. Has the following options:
124
-
*`'all'` search in keys and values (default)
125
-
*`'keys'` search only in keys
126
-
*`'values'` search only in values
127
-
128
136
### `JsonNodeElement` Events
129
137
130
138
The following events are being fired on the visible DOM elements. The events bubble up, so you just need a listener to your root element.
@@ -163,9 +171,7 @@ Fires when the user clicks on the Copy Path link of a node.
163
171
164
172
## Future TODOs
165
173
166
-
* Fix highlight all on search and not only the first
167
174
* Improve display of large strings.
168
-
* Run the parser in a WebWorker
169
175
* Support JSON Schema. If provided show meta information from the schema definition.
0 commit comments