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