1 | <a name="module_perspective-viewer"></a>
|
2 |
|
3 | ## perspective-viewer
|
4 | Module for the `<perspective-viewer>` custom element.
|
5 |
|
6 | This module has no exports, but importing it has a side
|
7 | effect: the [module:perspective_viewer~PerspectiveViewer](module:perspective_viewer~PerspectiveViewer) class is
|
8 | registered as a custom element, after which it can be used as a standard DOM
|
9 | element.
|
10 |
|
11 | The documentation in this module defines the instance structure of a
|
12 | `<perspective-viewer>` DOM object instantiated typically, through HTML or any
|
13 | relevent DOM method e.g. `document.createElement("perspective-viewer")` or
|
14 | `document.getElementsByTagName("perspective-viewer")`.
|
15 |
|
16 |
|
17 | * [perspective-viewer](#module_perspective-viewer)
|
18 | * [~PerspectiveViewer](#module_perspective-viewer..PerspectiveViewer) ⇐ <code>HTMLElement</code>
|
19 | * [new PerspectiveViewer()](#new_module_perspective-viewer..PerspectiveViewer_new)
|
20 | * [.sort](#module_perspective-viewer..PerspectiveViewer+sort) : <code>[ 'Array' ].<String></code>
|
21 | * [.columns](#module_perspective-viewer..PerspectiveViewer+columns) : <code>[ 'Array' ].<String></code>
|
22 | * [.computed-columns](#module_perspective-viewer..PerspectiveViewer+computed-columns) : <code>[ 'Array' ].<Object></code>
|
23 | * [.aggregates](#module_perspective-viewer..PerspectiveViewer+aggregates) : <code>Object</code>
|
24 | * [.filters](#module_perspective-viewer..PerspectiveViewer+filters) : <code>[ 'Array' ].<Array></code>
|
25 | * [.plugin](#module_perspective-viewer..PerspectiveViewer+plugin) : <code>String</code>
|
26 | * [.column-pivots](#module_perspective-viewer..PerspectiveViewer+column-pivots) : <code>[ 'Array' ].<String></code>
|
27 | * [.row-pivots](#module_perspective-viewer..PerspectiveViewer+row-pivots) : <code>[ 'Array' ].<String></code>
|
28 | * [.editable](#module_perspective-viewer..PerspectiveViewer+editable) : <code>Boolean</code>
|
29 | * [.throttle](#module_perspective-viewer..PerspectiveViewer+throttle) : <code>Number</code> \| <code>String</code>
|
30 | * [.worker](#module_perspective-viewer..PerspectiveViewer+worker)
|
31 | * [.table](#module_perspective-viewer..PerspectiveViewer+table)
|
32 | * [.view](#module_perspective-viewer..PerspectiveViewer+view)
|
33 | * [.load(data)](#module_perspective-viewer..PerspectiveViewer+load) ⇒ <code>[ 'Promise' ].<void></code>
|
34 | * [.update(data)](#module_perspective-viewer..PerspectiveViewer+update)
|
35 | * [.notifyResize()](#module_perspective-viewer..PerspectiveViewer+notifyResize)
|
36 | * [.clone(widget)](#module_perspective-viewer..PerspectiveViewer+clone)
|
37 | * [.delete(delete_table)](#module_perspective-viewer..PerspectiveViewer+delete) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
38 | * [.restyleElement()](#module_perspective-viewer..PerspectiveViewer+restyleElement)
|
39 | * [.save()](#module_perspective-viewer..PerspectiveViewer+save) ⇒ <code>object</code>
|
40 | * [.restore(config)](#module_perspective-viewer..PerspectiveViewer+restore) ⇒ <code>[ 'Promise' ].<void></code>
|
41 | * [.flush()](#module_perspective-viewer..PerspectiveViewer+flush) ⇒ <code>[ 'Promise' ].<void></code>
|
42 | * [.clear()](#module_perspective-viewer..PerspectiveViewer+clear)
|
43 | * [.replace()](#module_perspective-viewer..PerspectiveViewer+replace)
|
44 | * [.reset()](#module_perspective-viewer..PerspectiveViewer+reset)
|
45 | * [.copy()](#module_perspective-viewer..PerspectiveViewer+copy)
|
46 | * [.toggleConfig()](#module_perspective-viewer..PerspectiveViewer+toggleConfig)
|
47 | * [.getEditPort()](#module_perspective-viewer..PerspectiveViewer+getEditPort)
|
48 |
|
49 |
|
50 | * * *
|
51 |
|
52 | <a name="module_perspective-viewer..PerspectiveViewer"></a>
|
53 |
|
54 | ### perspective-viewer~PerspectiveViewer ⇐ <code>HTMLElement</code>
|
55 | **Kind**: inner class of [<code>perspective-viewer</code>](#module_perspective-viewer)
|
56 | **Extends**: <code>HTMLElement</code>
|
57 |
|
58 | * [~PerspectiveViewer](#module_perspective-viewer..PerspectiveViewer) ⇐ <code>HTMLElement</code>
|
59 | * [new PerspectiveViewer()](#new_module_perspective-viewer..PerspectiveViewer_new)
|
60 | * [.sort](#module_perspective-viewer..PerspectiveViewer+sort) : <code>[ 'Array' ].<String></code>
|
61 | * [.columns](#module_perspective-viewer..PerspectiveViewer+columns) : <code>[ 'Array' ].<String></code>
|
62 | * [.computed-columns](#module_perspective-viewer..PerspectiveViewer+computed-columns) : <code>[ 'Array' ].<Object></code>
|
63 | * [.aggregates](#module_perspective-viewer..PerspectiveViewer+aggregates) : <code>Object</code>
|
64 | * [.filters](#module_perspective-viewer..PerspectiveViewer+filters) : <code>[ 'Array' ].<Array></code>
|
65 | * [.plugin](#module_perspective-viewer..PerspectiveViewer+plugin) : <code>String</code>
|
66 | * [.column-pivots](#module_perspective-viewer..PerspectiveViewer+column-pivots) : <code>[ 'Array' ].<String></code>
|
67 | * [.row-pivots](#module_perspective-viewer..PerspectiveViewer+row-pivots) : <code>[ 'Array' ].<String></code>
|
68 | * [.editable](#module_perspective-viewer..PerspectiveViewer+editable) : <code>Boolean</code>
|
69 | * [.throttle](#module_perspective-viewer..PerspectiveViewer+throttle) : <code>Number</code> \| <code>String</code>
|
70 | * [.worker](#module_perspective-viewer..PerspectiveViewer+worker)
|
71 | * [.table](#module_perspective-viewer..PerspectiveViewer+table)
|
72 | * [.view](#module_perspective-viewer..PerspectiveViewer+view)
|
73 | * [.load(data)](#module_perspective-viewer..PerspectiveViewer+load) ⇒ <code>[ 'Promise' ].<void></code>
|
74 | * [.update(data)](#module_perspective-viewer..PerspectiveViewer+update)
|
75 | * [.notifyResize()](#module_perspective-viewer..PerspectiveViewer+notifyResize)
|
76 | * [.clone(widget)](#module_perspective-viewer..PerspectiveViewer+clone)
|
77 | * [.delete(delete_table)](#module_perspective-viewer..PerspectiveViewer+delete) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
78 | * [.restyleElement()](#module_perspective-viewer..PerspectiveViewer+restyleElement)
|
79 | * [.save()](#module_perspective-viewer..PerspectiveViewer+save) ⇒ <code>object</code>
|
80 | * [.restore(config)](#module_perspective-viewer..PerspectiveViewer+restore) ⇒ <code>[ 'Promise' ].<void></code>
|
81 | * [.flush()](#module_perspective-viewer..PerspectiveViewer+flush) ⇒ <code>[ 'Promise' ].<void></code>
|
82 | * [.clear()](#module_perspective-viewer..PerspectiveViewer+clear)
|
83 | * [.replace()](#module_perspective-viewer..PerspectiveViewer+replace)
|
84 | * [.reset()](#module_perspective-viewer..PerspectiveViewer+reset)
|
85 | * [.copy()](#module_perspective-viewer..PerspectiveViewer+copy)
|
86 | * [.toggleConfig()](#module_perspective-viewer..PerspectiveViewer+toggleConfig)
|
87 | * [.getEditPort()](#module_perspective-viewer..PerspectiveViewer+getEditPort)
|
88 |
|
89 |
|
90 | * * *
|
91 |
|
92 | <a name="new_module_perspective-viewer..PerspectiveViewer_new"></a>
|
93 |
|
94 | #### new PerspectiveViewer()
|
95 | The HTMLElement class for `<perspective-viewer>` custom element.
|
96 |
|
97 | This class is not exported, so this constructor cannot be invoked in the
|
98 | typical manner; instead, instances of the class are created through the
|
99 | Custom Elements DOM API.
|
100 |
|
101 | Properties of an instance of this class, such as
|
102 | [module:perspective_viewer~PerspectiveViewer#columns](module:perspective_viewer~PerspectiveViewer#columns), are reflected on
|
103 | the DOM element as Attributes, and should be accessed as such - e.g.
|
104 | `instance.setAttribute("columns", JSON.stringify(["a", "b"]))`.
|
105 |
|
106 | **Example**
|
107 | ```js
|
108 | // Create a new `<perspective-viewer>`
|
109 | const elem = document.createElement("perspective-viewer");
|
110 | elem.setAttribute("columns", JSON.stringify(["a", "b"]));
|
111 | document.body.appendChild(elem);
|
112 | ```
|
113 |
|
114 | * * *
|
115 |
|
116 | <a name="module_perspective-viewer..PerspectiveViewer+sort"></a>
|
117 |
|
118 | #### perspectiveViewer.sort : <code>[ 'Array' ].<String></code>
|
119 | Sets this `perspective.table.view`'s `sort` property, an Array of column
|
120 | names.
|
121 |
|
122 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
123 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
124 | **Example** *(via Javascript DOM)*
|
125 | ```js
|
126 | let elem = document.getElementById('my_viewer');
|
127 | elem.setAttribute('sort', JSON.stringify([["x","desc"]));
|
128 | ```
|
129 | **Example** *(via HTML)*
|
130 | ```js
|
131 | <perspective-viewer sort='[["x","desc"]]'></perspective-viewer>
|
132 | ```
|
133 |
|
134 | * * *
|
135 |
|
136 | <a name="module_perspective-viewer..PerspectiveViewer+columns"></a>
|
137 |
|
138 | #### perspectiveViewer.columns : <code>[ 'Array' ].<String></code>
|
139 | The set of visible columns.
|
140 |
|
141 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
142 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
143 | **Params**
|
144 |
|
145 | - columns <code>Array</code> - An Array of strings, the names of visible columns.
|
146 |
|
147 | **Example** *(via Javascript DOM)*
|
148 | ```js
|
149 | let elem = document.getElementById('my_viewer');
|
150 | elem.setAttribute('columns', JSON.stringify(["x", "y'"]));
|
151 | ```
|
152 | **Example** *(via HTML)*
|
153 | ```js
|
154 | <perspective-viewer columns='["x", "y"]'></perspective-viewer>
|
155 | ```
|
156 |
|
157 | * * *
|
158 |
|
159 | <a name="module_perspective-viewer..PerspectiveViewer+computed-columns"></a>
|
160 |
|
161 | #### perspectiveViewer.computed-columns : <code>[ 'Array' ].<Object></code>
|
162 | Sets new computed columns for the viewer.
|
163 |
|
164 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
165 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
166 | **Params**
|
167 |
|
168 | - computed-columns <code>[ 'Array' ].<Object></code> - An Array of computed column objects,
|
169 | which have three properties: `column`, a column name for the new column,
|
170 | `computed_function_name`, a String representing the computed function to
|
171 | apply, and `inputs`, an Array of String column names to be used as
|
172 | inputs to the computation.
|
173 |
|
174 | **Example** *(via Javascript DOM)*
|
175 | ```js
|
176 | let elem = document.getElementById('my_viewer');
|
177 | elem.setAttribute('computed-columns', JSON.stringify([{column: "x+y", computed_function_name: "+", inputs: ["x", "y"]}]));
|
178 | ```
|
179 | **Example** *(via HTML)*
|
180 | ```js
|
181 | <perspective-viewer computed-columns="[{column:'x+y',computed_function_name:'+',inputs:['x','y']}]""></perspective-viewer>
|
182 | ```
|
183 |
|
184 | * * *
|
185 |
|
186 | <a name="module_perspective-viewer..PerspectiveViewer+aggregates"></a>
|
187 |
|
188 | #### perspectiveViewer.aggregates : <code>Object</code>
|
189 | The set of column aggregate configurations.
|
190 |
|
191 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
192 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
193 | **Params**
|
194 |
|
195 | - aggregates <code>Object</code> - A dictionary whose keys are column names, and
|
196 | values are valid aggregations. The `aggregates` attribute works as an
|
197 | override; in lieu of a key for a column supplied by the developers, a
|
198 | default will be selected and reflected to the attribute based on the
|
199 | column's type. See [perspective/src/js/defaults.js](perspective/src/js/defaults.js)
|
200 |
|
201 | **Example** *(via Javascript DOM)*
|
202 | ```js
|
203 | let elem = document.getElementById('my_viewer');
|
204 | elem.setAttribute('aggregates', JSON.stringify({x: "distinct count"}));
|
205 | ```
|
206 | **Example** *(via HTML)*
|
207 | ```js
|
208 | <perspective-viewer aggregates='{"x": "distinct count"}'>
|
209 | </perspective-viewer>
|
210 | ```
|
211 |
|
212 | * * *
|
213 |
|
214 | <a name="module_perspective-viewer..PerspectiveViewer+filters"></a>
|
215 |
|
216 | #### perspectiveViewer.filters : <code>[ 'Array' ].<Array></code>
|
217 | The set of column filter configurations.
|
218 |
|
219 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
220 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
221 | **Example** *(via Javascript DOM)*
|
222 | ```js
|
223 | let filters = [
|
224 | ["x", "<", 3],
|
225 | ["y", "contains", "abc"]
|
226 | ];
|
227 | let elem = document.getElementById('my_viewer');
|
228 | elem.setAttribute('filters', JSON.stringify(filters));
|
229 | ```
|
230 | **Example** *(via HTML)*
|
231 | ```js
|
232 | <perspective-viewer filters='[["x", "<", 3], ["y", "contains", "abc"]]'>
|
233 | </perspective-viewer>
|
234 | ```
|
235 |
|
236 | * * *
|
237 |
|
238 | <a name="module_perspective-viewer..PerspectiveViewer+plugin"></a>
|
239 |
|
240 | #### perspectiveViewer.plugin : <code>String</code>
|
241 | Sets the currently selected plugin, via its `name` field, and removes
|
242 | any children the previous plugin may have left behind in the light DOM.
|
243 |
|
244 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
245 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
246 |
|
247 | * * *
|
248 |
|
249 | <a name="module_perspective-viewer..PerspectiveViewer+column-pivots"></a>
|
250 |
|
251 | #### perspectiveViewer.column-pivots : <code>[ 'Array' ].<String></code>
|
252 | Sets this `perspective.table.view`'s `column_pivots` property.
|
253 |
|
254 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
255 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
256 |
|
257 | * * *
|
258 |
|
259 | <a name="module_perspective-viewer..PerspectiveViewer+row-pivots"></a>
|
260 |
|
261 | #### perspectiveViewer.row-pivots : <code>[ 'Array' ].<String></code>
|
262 | Sets this `perspective.table.view`'s `row_pivots` property.
|
263 |
|
264 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
265 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
266 |
|
267 | * * *
|
268 |
|
269 | <a name="module_perspective-viewer..PerspectiveViewer+editable"></a>
|
270 |
|
271 | #### perspectiveViewer.editable : <code>Boolean</code>
|
272 | Determines whether this viewer is editable or not (though it is
|
273 | ultimately up to the plugin as to whether editing is implemented).
|
274 |
|
275 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
276 | **Emits**: <code>PerspectiveViewer#event:perspective-config-update</code>
|
277 |
|
278 | * * *
|
279 |
|
280 | <a name="module_perspective-viewer..PerspectiveViewer+throttle"></a>
|
281 |
|
282 | #### perspectiveViewer.throttle : <code>Number</code> \| <code>String</code>
|
283 | Determines the render throttling behavior. Can be an integer, for
|
284 | millisecond window to throttle render event; or, if `undefined`,
|
285 | will try to determine the optimal throttle time from this component's
|
286 | render framerate.
|
287 |
|
288 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
289 | **Example**
|
290 | ```js
|
291 | <!-- Only draws at most 1 frame/sec. -->
|
292 | <perspective-viewer throttle="1000"></perspective-viewer>
|
293 | ```
|
294 |
|
295 | * * *
|
296 |
|
297 | <a name="module_perspective-viewer..PerspectiveViewer+worker"></a>
|
298 |
|
299 | #### perspectiveViewer.worker
|
300 | This element's `perspective` worker instance. This property is not
|
301 | reflected as an HTML attribute, and is readonly; it can be effectively
|
302 | set however by calling the `load() method with a `perspective.table`
|
303 | instance from the preferred worker.
|
304 |
|
305 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
306 | **Read only**: true
|
307 | **Example**
|
308 | ```js
|
309 | let elem = document.getElementById('my_viewer');
|
310 | let table = elem.worker.table([{x:1, y:2}]);
|
311 | elem.load(table);
|
312 | ```
|
313 |
|
314 | * * *
|
315 |
|
316 | <a name="module_perspective-viewer..PerspectiveViewer+table"></a>
|
317 |
|
318 | #### perspectiveViewer.table
|
319 | This element's `perspective.table` instance.
|
320 |
|
321 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
322 | **Read only**: true
|
323 |
|
324 | * * *
|
325 |
|
326 | <a name="module_perspective-viewer..PerspectiveViewer+view"></a>
|
327 |
|
328 | #### perspectiveViewer.view
|
329 | This element's `perspective.table.view` instance. The instance itself
|
330 | will change after every `PerspectiveViewer#perspective-config-update`
|
331 | event.
|
332 |
|
333 | **Kind**: instance property of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
334 | **Read only**: true
|
335 |
|
336 | * * *
|
337 |
|
338 | <a name="module_perspective-viewer..PerspectiveViewer+load"></a>
|
339 |
|
340 | #### perspectiveViewer.load(data) ⇒ <code>[ 'Promise' ].<void></code>
|
341 | Load data. If `load` or `update` have already been called on this
|
342 | element, its internal `perspective.table` will also be deleted.
|
343 |
|
344 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
345 | **Returns**: <code>[ 'Promise' ].<void></code> - A promise which resolves once the data is loaded
|
346 | and a `perspective.view` has been created.
|
347 | **Emits**: <code>module:perspective\_viewer~PerspectiveViewer#perspective-click
|
348 | PerspectiveViewer#perspective-view-update
|
349 | ]);event:</code>
|
350 | **Params**
|
351 |
|
352 | - data <code>any</code> - The data to load. Works with the same input types
|
353 | supported by `perspective.table`.
|
354 |
|
355 | **Example** *(Load CSV)*
|
356 | ```js
|
357 | const my_viewer = document.getElementById('#my_viewer');
|
358 | my_viewer.load("x,y\n1,a\n2,b");
|
359 | ```
|
360 | **Example** *(Load perspective.table)*
|
361 | ```js
|
362 | const my_viewer = document.getElementById('#my_viewer');
|
363 | const tbl = perspective.table("x,y\n1,a\n2,b");
|
364 | my_viewer.load(tbl);
|
365 | ```
|
366 | **Example** *(Load Promise<perspective.table>)*
|
367 | ```js
|
368 | const my_viewer = document.getElementById('#my_viewer');
|
369 | const tbl = async () => perspective.table("x,y\n1,a\n2,b");
|
370 | my_viewer.load(tbl);
|
371 | ```
|
372 |
|
373 | * * *
|
374 |
|
375 | <a name="module_perspective-viewer..PerspectiveViewer+update"></a>
|
376 |
|
377 | #### perspectiveViewer.update(data)
|
378 | Updates this element's `perspective.table` with new data.
|
379 |
|
380 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
381 | **Emits**: <code>PerspectiveViewer#event:perspective-view-update</code>
|
382 | **Params**
|
383 |
|
384 | - data <code>any</code> - The data to load. Works with the same input types
|
385 | supported by `perspective.table.update`.
|
386 |
|
387 | **Example**
|
388 | ```js
|
389 | const my_viewer = document.getElementById('#my_viewer');
|
390 | my_viewer.update([
|
391 | {x: 1, y: 'a'},
|
392 | {x: 2, y: 'b'}
|
393 | ]);
|
394 | ```
|
395 |
|
396 | * * *
|
397 |
|
398 | <a name="module_perspective-viewer..PerspectiveViewer+notifyResize"></a>
|
399 |
|
400 | #### perspectiveViewer.notifyResize()
|
401 | Determine whether to reflow the viewer and redraw.
|
402 |
|
403 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
404 |
|
405 | * * *
|
406 |
|
407 | <a name="module_perspective-viewer..PerspectiveViewer+clone"></a>
|
408 |
|
409 | #### perspectiveViewer.clone(widget)
|
410 | Duplicate an existing `<perspective-element>`, including data and view
|
411 | settings. The underlying `perspective.table` will be shared between both
|
412 | elements
|
413 |
|
414 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
415 | **Params**
|
416 |
|
417 | - widget <code>any</code> - A `<perspective-viewer>` instance to clone.
|
418 |
|
419 |
|
420 | * * *
|
421 |
|
422 | <a name="module_perspective-viewer..PerspectiveViewer+delete"></a>
|
423 |
|
424 | #### perspectiveViewer.delete(delete_table) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
425 | Deletes this element's data and clears it's internal state (but not its
|
426 | user state). This (or the underlying `perspective.table`'s equivalent
|
427 | method) must be called in order for its memory to be reclaimed.
|
428 |
|
429 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
430 | **Returns**: <code>[ 'Promise' ].<Boolean></code> - Whether or not this call resulted in the
|
431 | underlying `perspective.table` actually being deleted.
|
432 | **Params**
|
433 |
|
434 | - delete_table <code>Boolean</code> <code> = true</code> - Should a delete call also be made to the
|
435 | underlying `table()`.
|
436 |
|
437 |
|
438 | * * *
|
439 |
|
440 | <a name="module_perspective-viewer..PerspectiveViewer+restyleElement"></a>
|
441 |
|
442 | #### perspectiveViewer.restyleElement()
|
443 | Restyles the elements and to pick up any style changes
|
444 |
|
445 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
446 |
|
447 | * * *
|
448 |
|
449 | <a name="module_perspective-viewer..PerspectiveViewer+save"></a>
|
450 |
|
451 | #### perspectiveViewer.save() ⇒ <code>object</code>
|
452 | Serialize this element's attribute/interaction state.
|
453 |
|
454 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
455 | **Returns**: <code>object</code> - a serialized element.
|
456 |
|
457 | * * *
|
458 |
|
459 | <a name="module_perspective-viewer..PerspectiveViewer+restore"></a>
|
460 |
|
461 | #### perspectiveViewer.restore(config) ⇒ <code>[ 'Promise' ].<void></code>
|
462 | Restore this element to a state as generated by a reciprocal call to
|
463 | `save` or `serialize`.
|
464 |
|
465 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
466 | **Returns**: <code>[ 'Promise' ].<void></code> - A promise which resolves when the changes have
|
467 | been applied.
|
468 | **Params**
|
469 |
|
470 | - config <code>Object</code> | <code>String</code> - returned by `save` or `serialize`.
|
471 |
|
472 |
|
473 | * * *
|
474 |
|
475 | <a name="module_perspective-viewer..PerspectiveViewer+flush"></a>
|
476 |
|
477 | #### perspectiveViewer.flush() ⇒ <code>[ 'Promise' ].<void></code>
|
478 | Flush any pending attribute modifications to this element.
|
479 |
|
480 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
481 | **Returns**: <code>[ 'Promise' ].<void></code> - A promise which resolves when the current
|
482 | attribute state has been applied.
|
483 |
|
484 | * * *
|
485 |
|
486 | <a name="module_perspective-viewer..PerspectiveViewer+clear"></a>
|
487 |
|
488 | #### perspectiveViewer.clear()
|
489 | Clears the rows in the current [table](table).
|
490 |
|
491 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
492 |
|
493 | * * *
|
494 |
|
495 | <a name="module_perspective-viewer..PerspectiveViewer+replace"></a>
|
496 |
|
497 | #### perspectiveViewer.replace()
|
498 | Replaces all rows in the current [table](table).
|
499 |
|
500 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
501 |
|
502 | * * *
|
503 |
|
504 | <a name="module_perspective-viewer..PerspectiveViewer+reset"></a>
|
505 |
|
506 | #### perspectiveViewer.reset()
|
507 | Reset's this element's view state and attributes to default. Does not
|
508 | delete this element's `perspective.table` or otherwise modify the data
|
509 | state.
|
510 |
|
511 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
512 |
|
513 | * * *
|
514 |
|
515 | <a name="module_perspective-viewer..PerspectiveViewer+copy"></a>
|
516 |
|
517 | #### perspectiveViewer.copy()
|
518 | Copies this element's view data (as a CSV) to the clipboard. This method
|
519 | must be called from an event handler, subject to the browser's
|
520 | restrictions on clipboard access. See
|
521 | [https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard](https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard).
|
522 |
|
523 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
524 |
|
525 | * * *
|
526 |
|
527 | <a name="module_perspective-viewer..PerspectiveViewer+toggleConfig"></a>
|
528 |
|
529 | #### perspectiveViewer.toggleConfig()
|
530 | Opens/closes the element's config menu.
|
531 |
|
532 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
533 |
|
534 | * * *
|
535 |
|
536 | <a name="module_perspective-viewer..PerspectiveViewer+getEditPort"></a>
|
537 |
|
538 | #### perspectiveViewer.getEditPort()
|
539 | Returns a promise that resolves to the element's edit port ID, used
|
540 | internally when edits are made using Hypergrid or DataGrid.
|
541 |
|
542 | **Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
|
543 |
|
544 | * * *
|
545 |
|