Skip to content

Commit

Permalink
Fix docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JHawk committed Mar 1, 2019
1 parent 611efdd commit 61f40a8
Show file tree
Hide file tree
Showing 5 changed files with 678 additions and 415 deletions.
130 changes: 92 additions & 38 deletions docs/perspective-viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Table of Contents

- [View][1]
- [PerspectiveViewer][1]
- [sort][2]
- [columns][3]
- [computed-columns][4]
Expand All @@ -21,15 +21,20 @@
- [delete][17]
- [save][18]
- [restore][19]
- [reset][20]
- [copy][21]
- [download][22]
- [View#perspective-view-update][23]
- [View#perspective-config-update][24]
- [flush][20]
- [clear][21]
- [replace][22]
- [reset][23]
- [copy][24]
- [toggleConfig][25]
- [download][26]
- [PerspectiveViewer#perspective-view-update][27]
- [PerspectiveViewer#perspective-config-update][28]
- [PerspectiveViewer#perspective-click][29]

## View
## PerspectiveViewer

**Extends ViewPrivate**
**Extends ActionElement**

HTMLElement class for `<perspective-viewer` custom element.

Expand Down Expand Up @@ -61,7 +66,7 @@ The set of visible columns.

**Parameters**

- `columns` **[array][25]** An array of strings, the names of visible columns.
- `columns` **[array][30]** An array of strings, the names of visible columns.

**Examples**

Expand All @@ -86,7 +91,7 @@ The set of visible columns.

**Parameters**

- `computed-columns` **[array][25]** An array of computed column objects
- `computed-columns` **[array][30]** An array of computed column objects

**Examples**

Expand All @@ -111,11 +116,11 @@ The set of column aggregate configurations.
**Parameters**
- `aggregates` **[object][26]** A dictionary whose keys are column names, and
- `aggregates` **[object][31]** A dictionary whose keys are column names, and
values are valid aggregations. The `aggergates` attribute works as an
override; in lieu of a key for a column supplied by the developers, a
default will be selected and reflected to the attribute based on the
column's type. See [perspective/src/js/defaults.js][27]
column's type. See [perspective/src/js/defaults.js][32]
**Examples**
Expand Down Expand Up @@ -170,7 +175,7 @@ Sets the currently selected plugin, via its `name` field.
### view
This element's `perspective.table.view` instance. The instance itself
will change after every `View#perspective-config-update` event.
will change after every `PerspectiveViewer#perspective-config-update` event.
### column-pivots
Expand All @@ -188,7 +193,7 @@ render it hidden until the message is removed.
**Parameters**
- `msg` **[string][28]** The message. This can be HTML - it is not sanitized.
- `msg` **[string][33]** The message. This can be HTML - it is not sanitized.
**Examples**
Expand Down Expand Up @@ -253,7 +258,7 @@ const tbl = perspective.table("x,y\n1,a\n2,b");
my_viewer.load(tbl);
```
Returns **[Promise][29]&lt;void>** A promise which resolves once the data is
Returns **[Promise][34]&lt;void>** A promise which resolves once the data is
loaded and a `perspective.view` has been created.
### update
Expand Down Expand Up @@ -295,14 +300,14 @@ Deletes this element's data and clears it's internal state (but not its
user state). This (or the underlying `perspective.table`'s equivalent
method) must be called in order for its memory to be reclaimed.
Returns **[Promise][29]&lt;[boolean][30]>** Whether or not this call resulted in the
Returns **[Promise][34]&lt;[boolean][35]>** Whether or not this call resulted in the
underlying `perspective.table` actually being deleted.
### save
Serialize this element's attribute/interaction state.
Returns **[object][26]** a serialized element.
Returns **[object][31]** a serialized element.
### restore
Expand All @@ -311,11 +316,30 @@ Restore this element to a state as generated by a reciprocal call to
**Parameters**
- `x` **[object][26]** returned by `save`.
- `x` **[object][31]** returned by `save`.
Returns **[Promise][29]&lt;void>** A promise which resolves when the changes have
Returns **[Promise][34]&lt;void>** A promise which resolves when the changes have
been applied.
### flush
Flush any pending attribute modifications to this element.
Returns **[Promise][34]&lt;void>** A promise which resolves when the current
attribute state has been applied.
### clear
Clears the rows in the current [table][36].
### replace
Replaces all rows in the current [table][36].
**Parameters**
- `data`
### reset
Reset's this element's view state and attributes to default. Does not
Expand All @@ -327,32 +351,50 @@ state.
Copies this element's view data (as a CSV) to the clipboard. This method
must be called from an event handler, subject to the browser's
restrictions on clipboard access. See
[https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard][31].
[https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard][37].
**Parameters**
- `flat` (optional, default `false`)
### toggleConfig
Opens/closes the element's config menu.
### download
Download this element's data as a CSV file.
**Parameters**
- `flat` **[boolean][30]** Whether to use the element's current view
- `flat` **[boolean][35]** Whether to use the element's current view
config, or to use a default "flat" view. (optional, default `false`)
## View#perspective-view-update
## PerspectiveViewer#perspective-view-update
`perspective-view-update` is fired whenever underlying `view`'s data has
updated, including every invocation of `load` and `update`.
## View#perspective-config-update
## PerspectiveViewer#perspective-config-update
`perspective-config-update` is fired whenever an configuration attribute has
been modified, by the user or otherwise.
[1]: #view
## PerspectiveViewer#perspective-click
`perspective-click` is fired whenever underlying `view`'s grid or chart are
clicked providing a detail that includes a `config`, `column_names` and
`row`.
**Properties**
- `column_names` **[array][30]** Includes a list of column names.
- `config` **[object][31]** Contains a property `filters` that can be applied
to a `<perspective-viewer>` through the use of `restore()` updating it to
show the filtered subset of data..
- `row` **[array][30]** Includes the data row.
[1]: #perspectiveviewer
[2]: #sort
Expand All @@ -364,9 +406,9 @@ been modified, by the user or otherwise.
[6]: #filters
[7]: #view-1
[7]: #view
[8]: #view-2
[8]: #view-1
[9]: #column-pivots
Expand All @@ -390,26 +432,38 @@ been modified, by the user or otherwise.
[19]: #restore
[20]: #reset
[20]: #flush
[21]: #clear
[22]: #replace
[23]: #reset
[24]: #copy
[25]: #toggleconfig
[26]: #download
[21]: #copy
[27]: #perspectiveviewerperspective-view-update
[22]: #download
[28]: #perspectiveviewerperspective-config-update
[23]: #viewperspective-view-update
[29]: #perspectiveviewerperspective-click
[24]: #viewperspective-config-update
[30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[31]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[32]: perspective/src/js/defaults.js
[27]: perspective/src/js/defaults.js
[33]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[34]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
[29]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
[35]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[36]: table
[31]: https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard
[37]: https://www.w3.org/TR/clipboard-apis/#allow-read-clipboard
Loading

0 comments on commit 61f40a8

Please sign in to comment.