Type Definitions
eventCallback(eventData)
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
eventData |
object | A description of the event Properties
|
- Source:
externalDataCallback(new_data)
A user-defined callback function that can receive (and potentially act on) new plot data.
Parameters:
Name | Type | Description |
---|---|---|
new_data |
Object | The body resulting from a data request. This represents the same information that would be passed to a data layer making an equivalent request. |
- Source:
externalErrorCallback(err)
A user-defined callback function that can respond to errors received during a previous operation
Parameters:
Name | Type | Description |
---|---|---|
err |
A representation of the error that occurred |
- Source:
Events
any_lz_event
Fields common to every event emitted by LocusZoom. This is not an actual event that should ever be used directly; see list below.
Note: plot-level listeners can be defined for this event, but you should almost never do this. Use the most specific event name to describe the thing you are interested in.
Listening to 'any_lz_event' is only for advanced usages, such as proxying (repeating) LZ behavior to a piece of wrapper code. One example is converting all LocusZoom events to vue.js events.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
sourceID |
string | The fully qualified ID of the entity that originated the event, eg |
target |
Plot | Panel | A reference to the plot or panel instance that originated the event. |
data |
object | null | Additional data provided. (see event-specific documentation) |
- Source:
data_rendered
A request for new data has completed, and all data has been rendered in the plot.
- Source:
- See:
Listeners of This Event:
data_requested
A request for new or cached data was initiated. This can be used for, eg, showing data loading indicators.
- Source:
- See:
Listeners of This Event:
element_clicked
Indicates whether an element was clicked. (regardless of the behavior associated with clicking)
- Source:
- See:
-
- event:element_selection for a more specific and more frequently useful event
- event:any_lz_event
element_selection
Indicate whether the element was selected (or unselected)
Properties:
Name | Type | Description |
---|---|---|
data |
object | An object with keys { element, active }, representing the datum bound to the element and the selection status (boolean) |
- Source:
- See:
-
- event:element_clicked if you are interested in tracking clicks that result in other behaviors, like links
- event:any_lz_event
layout_changed
An action occurred that changed, or could change, the layout. Many rerendering operations can fire this event and it is somewhat generic: it includes resize, highlight, and rerender on new data. Caution: Direct layout mutations might not be captured by this event. It is deprecated due to its limited utility.
- Deprecated:
- Yes
- Source:
- See:
match_requested
Indicate whether a match was requested from within a data layer.
Properties:
Name | Type | Description |
---|---|---|
data |
object | An object of |
- Source:
- See:
Listeners of This Event:
panel_removed
A panel was removed from the plot. Commonly initiated by the "remove panel" toolbar widget.
Properties:
Name | Type | Description |
---|---|---|
data |
string | The id of the panel that was removed (eg 'genes') |
- Source:
- See:
region_changed
The plot region has changed. Reports the actual coordinates of the plot after the zoom event. If plot.applyState is called with an invalid region (eg zooming in or out too far), this reports the actual final coordinates, not what was requested. The actual coordinates are subject to region min/max, etc.
Properties:
Name | Type | Description |
---|---|---|
data |
object | The {chr, start, end} coordinates of the requested region. |
- Source:
- See:
set_ldrefvar
A new LD reference variant has been selected (usually by clicking within a GWAS scatter plot) This event only fires for manually selected variants. It does not fire if the LD reference variant is automatically selected (eg by choosing the most significant hit in the region)
Properties:
Name | Type | Description |
---|---|---|
data |
object | { ldrefvar } The variant identifier of the LD reference variant |
- Source:
- See:
state_changed
The user has requested any state changes, eg via plot.applyState
. This reports the original requested values even
if they are overridden by plot logic. Only triggered when a state change causes a re-render.
Properties:
Name | Type | Description |
---|---|---|
data |
object | The set of all state changes requested |
- Source:
- See:
-
- event:any_lz_event
- event:region_changed for a related event that provides more accurate information in some cases