Expand description
The API for the @perspective-dev/viewer
JavaScript library.
Modules§
- components
componentscontains all YewComponenttypes, but only exports the 4 necessary for public Custom Elements. The rest are internal components of these 4.- config
- A collection of (de-)serializable structs which capture the application state, suitable for persistence, history, etc. features.
- custom_
elements - Each file in
custom_elementsexports a single struct which will be the publicwasm_bindgenAPI to a JavaScript Custom Element. - exprtk
- Data processing functions for the Perspective/ExprTK language.
- utils
- A catch all for project-wide macros and general-purpose functions that are not directly related to Perspective.
Macros§
- Perspective
Properties - css
- define_
web_ components - Defining the web components needs an extern struct to reference the
generated JavaSript glue. This is parameterized by an attribute macro which
needs to be determined by the top-level compiled module - the JavaScript
glue code emitted by
wasm-bindgen-cli. - maybe
- An implementaiton of
try_blocksfeature in a non-nightly macro. - maybe_
log - As
maybe!, but returns()and just logs errors. - maybe_
log_ or_ default - maybe_
or_ default
Functions§
- bootstrap_
web_ components - Register Web Components with the global registry, given a Perspective module.
- js_init
- Register this crate’s Custom Elements in the browser’s current session.
- register
Plugin - Register a plugin globally.