UNPKG

23.2 kBMarkdownView Raw
1<a name="module_perspective-viewer"></a>
2
3## perspective-viewer
4Module for the `<perspective-viewer>` custom element.
5
6This module has no exports, but importing it has a side
7effect: the [module:perspective_viewer~PerspectiveViewer](module:perspective_viewer~PerspectiveViewer) class is
8registered as a custom element, after which it can be used as a standard DOM
9element.
10
11The documentation in this module defines the instance structure of a
12`<perspective-viewer>` DOM object instantiated typically, through HTML or any
13relevent 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>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
21 * [.columns](#module_perspective-viewer..PerspectiveViewer+columns) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
22 * [.computed-columns](#module_perspective-viewer..PerspectiveViewer+computed-columns) : <code>[ &#x27;Array&#x27; ].&lt;Object&gt;</code>
23 * [.aggregates](#module_perspective-viewer..PerspectiveViewer+aggregates) : <code>Object</code>
24 * [.filters](#module_perspective-viewer..PerspectiveViewer+filters) : <code>[ &#x27;Array&#x27; ].&lt;Array&gt;</code>
25 * [.plugin](#module_perspective-viewer..PerspectiveViewer+plugin) : <code>String</code>
26 * [.column-pivots](#module_perspective-viewer..PerspectiveViewer+column-pivots) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
27 * [.row-pivots](#module_perspective-viewer..PerspectiveViewer+row-pivots) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</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>[ &#x27;Promise&#x27; ].&lt;void&gt;</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>[ &#x27;Promise&#x27; ].&lt;Boolean&gt;</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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code>
41 * [.flush()](#module_perspective-viewer..PerspectiveViewer+flush) ⇒ <code>[ &#x27;Promise&#x27; ].&lt;void&gt;</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>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
61 * [.columns](#module_perspective-viewer..PerspectiveViewer+columns) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
62 * [.computed-columns](#module_perspective-viewer..PerspectiveViewer+computed-columns) : <code>[ &#x27;Array&#x27; ].&lt;Object&gt;</code>
63 * [.aggregates](#module_perspective-viewer..PerspectiveViewer+aggregates) : <code>Object</code>
64 * [.filters](#module_perspective-viewer..PerspectiveViewer+filters) : <code>[ &#x27;Array&#x27; ].&lt;Array&gt;</code>
65 * [.plugin](#module_perspective-viewer..PerspectiveViewer+plugin) : <code>String</code>
66 * [.column-pivots](#module_perspective-viewer..PerspectiveViewer+column-pivots) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
67 * [.row-pivots](#module_perspective-viewer..PerspectiveViewer+row-pivots) : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</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>[ &#x27;Promise&#x27; ].&lt;void&gt;</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>[ &#x27;Promise&#x27; ].&lt;Boolean&gt;</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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code>
81 * [.flush()](#module_perspective-viewer..PerspectiveViewer+flush) ⇒ <code>[ &#x27;Promise&#x27; ].&lt;void&gt;</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()
95The HTMLElement class for `<perspective-viewer>` custom element.
96
97This class is not exported, so this constructor cannot be invoked in the
98typical manner; instead, instances of the class are created through the
99Custom Elements DOM API.
100
101Properties of an instance of this class, such as
102[module:perspective_viewer~PerspectiveViewer#columns](module:perspective_viewer~PerspectiveViewer#columns), are reflected on
103the 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>`
109const elem = document.createElement("perspective-viewer");
110elem.setAttribute("columns", JSON.stringify(["a", "b"]));
111document.body.appendChild(elem);
112```
113
114* * *
115
116<a name="module_perspective-viewer..PerspectiveViewer+sort"></a>
117
118#### perspectiveViewer.sort : <code>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
119Sets this `perspective.table.view`'s `sort` property, an Array of column
120names.
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
126let elem = document.getElementById('my_viewer');
127elem.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>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
139The 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
149let elem = document.getElementById('my_viewer');
150elem.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>[ &#x27;Array&#x27; ].&lt;Object&gt;</code>
162Sets 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>[ &#x27;Array&#x27; ].&lt;Object&gt;</code> - An Array of computed column objects,
169which have three properties: `column`, a column name for the new column,
170`computed_function_name`, a String representing the computed function to
171apply, and `inputs`, an Array of String column names to be used as
172inputs to the computation.
173
174**Example** *(via Javascript DOM)*
175```js
176let elem = document.getElementById('my_viewer');
177elem.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>
189The 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
196values are valid aggregations. The `aggregates` attribute works as an
197override; in lieu of a key for a column supplied by the developers, a
198default will be selected and reflected to the attribute based on the
199column's type. See [perspective/src/js/defaults.js](perspective/src/js/defaults.js)
200
201**Example** *(via Javascript DOM)*
202```js
203let elem = document.getElementById('my_viewer');
204elem.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>[ &#x27;Array&#x27; ].&lt;Array&gt;</code>
217The 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
223let filters = [
224 ["x", "<", 3],
225 ["y", "contains", "abc"]
226];
227let elem = document.getElementById('my_viewer');
228elem.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>
241Sets the currently selected plugin, via its `name` field, and removes
242any 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>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
252Sets 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>[ &#x27;Array&#x27; ].&lt;String&gt;</code>
262Sets 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>
272Determines whether this viewer is editable or not (though it is
273ultimately 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>
283Determines the render throttling behavior. Can be an integer, for
284millisecond window to throttle render event; or, if `undefined`,
285will try to determine the optimal throttle time from this component's
286render 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
300This element's `perspective` worker instance. This property is not
301reflected as an HTML attribute, and is readonly; it can be effectively
302set however by calling the `load() method with a `perspective.table`
303instance 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
309let elem = document.getElementById('my_viewer');
310let table = elem.worker.table([{x:1, y:2}]);
311elem.load(table);
312```
313
314* * *
315
316<a name="module_perspective-viewer..PerspectiveViewer+table"></a>
317
318#### perspectiveViewer.table
319This 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
329This element's `perspective.table.view` instance. The instance itself
330will change after every `PerspectiveViewer#perspective-config-update`
331event.
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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code>
341Load data. If `load` or `update` have already been called on this
342element, its internal `perspective.table` will also be deleted.
343
344**Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
345**Returns**: <code>[ &#x27;Promise&#x27; ].&lt;void&gt;</code> - A promise which resolves once the data is loaded
346and a `perspective.view` has been created.
347**Emits**: <code>module:perspective\_viewer~PerspectiveViewer#perspective-click
348PerspectiveViewer#perspective-view-update
349]);event:</code>
350**Params**
351
352- data <code>any</code> - The data to load. Works with the same input types
353supported by `perspective.table`.
354
355**Example** *(Load CSV)*
356```js
357const my_viewer = document.getElementById('#my_viewer');
358my_viewer.load("x,y\n1,a\n2,b");
359```
360**Example** *(Load perspective.table)*
361```js
362const my_viewer = document.getElementById('#my_viewer');
363const tbl = perspective.table("x,y\n1,a\n2,b");
364my_viewer.load(tbl);
365```
366**Example** *(Load Promise&lt;perspective.table&gt;)*
367```js
368const my_viewer = document.getElementById('#my_viewer');
369const tbl = async () => perspective.table("x,y\n1,a\n2,b");
370my_viewer.load(tbl);
371```
372
373* * *
374
375<a name="module_perspective-viewer..PerspectiveViewer+update"></a>
376
377#### perspectiveViewer.update(data)
378Updates 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
385supported by `perspective.table.update`.
386
387**Example**
388```js
389const my_viewer = document.getElementById('#my_viewer');
390my_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()
401Determine 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)
410Duplicate an existing `<perspective-element>`, including data and view
411settings. The underlying `perspective.table` will be shared between both
412elements
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>[ &#x27;Promise&#x27; ].&lt;Boolean&gt;</code>
425Deletes this element's data and clears it's internal state (but not its
426user state). This (or the underlying `perspective.table`'s equivalent
427method) 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>[ &#x27;Promise&#x27; ].&lt;Boolean&gt;</code> - Whether or not this call resulted in the
431underlying `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
435underlying `table()`.
436
437
438* * *
439
440<a name="module_perspective-viewer..PerspectiveViewer+restyleElement"></a>
441
442#### perspectiveViewer.restyleElement()
443Restyles 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>
452Serialize 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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code>
462Restore 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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code> - A promise which resolves when the changes have
467been 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>[ &#x27;Promise&#x27; ].&lt;void&gt;</code>
478Flush any pending attribute modifications to this element.
479
480**Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
481**Returns**: <code>[ &#x27;Promise&#x27; ].&lt;void&gt;</code> - A promise which resolves when the current
482attribute state has been applied.
483
484* * *
485
486<a name="module_perspective-viewer..PerspectiveViewer+clear"></a>
487
488#### perspectiveViewer.clear()
489Clears 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()
498Replaces 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()
507Reset's this element's view state and attributes to default. Does not
508delete this element's `perspective.table` or otherwise modify the data
509state.
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()
518Copies this element's view data (as a CSV) to the clipboard. This method
519must be called from an event handler, subject to the browser's
520restrictions 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()
530Opens/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()
539Returns a promise that resolves to the element's edit port ID, used
540internally when edits are made using Hypergrid or DataGrid.
541
542**Kind**: instance method of [<code>PerspectiveViewer</code>](#module_perspective-viewer..PerspectiveViewer)
543
544* * *
545