new Plot(element, options) → {sigplot.Plot}
Construct and render a plot.
Parameters:
Name | Type | Argument | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
a 'div' DOM elements |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
<optional> |
alters the behavior of the plot. Properties
|
- Source:
Returns:
- Type
- sigplot.Plot
Example
plot = new sigplot.Plot(document.getElementById('plot'), {});
Methods
-
add_plugin(plugin, zorder)
-
Add a plugin to the plot
Parameters:
Name Type Description plugin
the plugin object
zorder
the zorder for the plugin to render, all plugins render as overlays on top of the plot
- Source:
-
addListener(what, callback)
-
Adds a listener to plot events.
Parameters:
Name Type Description what
the event to listen to mtag = a mouse 'tag' event has occurred, mmove = a mouse move event has occurred, mdown = a mouse down event has occurred, mup = a mouse up event has occurred, showmenu = showmenu even has occurred, sigplotexit = an exit plot event has occurred, reread = a reread event has occurred, file_deoverlayed = a file has been deoverlayed, file_overlayed = a file has been overlayed,
callback
- Source:
-
change_settings(settings)
-
Change one or more plot settings. For boolean types, passing null will toggle the setting.
Parameters:
Name Type Description settings
the settings to change.
Properties
Name Type Description grid
Boolean change grid visibility
index
Boolean change index setting
all
Boolean change the plot to show all data
show_x_axis
Boolean show_y_axis
Boolean show_readout
Boolean specs
Boolean xcnt
String "leftmouse", "continuous", "disable", "enable"
legend
Boolean pan
Boolean cross
Boolean rubberbox_action
String rubberbox_mode
String wheelscroll_mode_natural
String cmode
String phunits
String - Source:
-
cleanup()
-
Placeholder for cleanup logic.
- Source:
-
deoverlay(index)
-
Remove layers.
Parameters:
Name Type Argument Description index
<optional>
the layer to remove, if not provided all layers are removed. Negative indices can be used to remove layers from the back of the layer stack.
- Source:
-
load_files(a)
-
Load one or more files.
Parameters:
Name Type Description a
File[] list of files to plot
- Source:
-
mimic(other, mask)
-
Register this plot to mimic zoom/unzoom of other plot
Parameters:
Name Type Description other
the other plot to mimic
mask
the set of event to respond to
Properties
Name Type Description zoom
if true, respond to zoom events
xzoom
if true, respond to zoom events on for the x-axis only
yzoom
if true, respond to zoom events on for the y-axis only
unzoom
if true, respond to unzoom events
- Source:
-
overlay_array(filname, data, overrides, layerType)
-
Create a plot layer backed by an array
Parameters:
Name Type Description filname
data
Number[] data to plot
overrides
optional bluefile header overrides
layerType
- Source:
-
overlay_bluefile(hcb)
-
Create a plot layer backed by a bluefile header
Parameters:
Name Type Description hcb
BlueHeader an opened BlueHeader file
- Source:
Returns:
the index of the new layer
-
overlay_href(href, onload)
-
Create a plot layer from an HREF that points to a BLUEFILE
Parameters:
Name Type Argument Description href
String the url to the bluefile
onload
<optional>
callback to be called when the file has been loaded
- Source:
-
pixel_zoom()
-
Zoom onto a given pixel range.
- Source:
-
push(n, data, hdrmod, sync)
-
Push data into a layer that was created with overlay_pipe
Parameters:
Name Type Argument Default Description n
Number the layer to push data into
data
Number[] data to push
hdrmod
Object optional changes to the file header
sync
boolean <optional>
false optional dispatch onpipewrite syncronously
- Source:
-
redraw()
-
Like refresh, but doesn't rerender data
- Source:
-
refresh()
-
Refresh the entire plot
- Source:
-
reload(n, data, hdrmod)
-
Reload data without adjusting other aspects about a plot
Parameters:
Name Type Description n
Number the layer to push data into
data
Number[] data to push
hdrmod
Object optional changes to the file header
- Source:
-
remove_layer(index)
-
Remove a layer.
Parameters:
Name Type Description index
the layer to remove
- Source:
-
remove_plugin(plugin)
-
Removes a plugin from the plot
Parameters:
Name Type Description plugin
the plugin object
- Source:
-
removeListener(what, callback)
-
Removes a listener to plot events.
Parameters:
Name Type Description what
the event that was listned to
callback
- Source:
-
reread()
-
Reread all files and refresh the plot.
- Source:
-
unzoom(levels)
-
Unzoom one or more levels.
Parameters:
Name Type Argument Description levels
<optional>
the number of levels to unzoom, if not provided unzoom all.
- Source:
-
zoom(ul, lr, lr, lr, continuous)
-
Zoom onto a given region.
Parameters:
Name Type Description ul
the uppler left corner
Properties
Name Type Description x
Number the upper left x pos in real plot value
y
Number the upper left y pos in real plot values
lr
the lower right corner
lr
Number the lower right x pos in real plot value
lr
Number the lower right y pos in real plot values
continuous
enter continuous zoom mode. This will create a new if you are on level 0, but stay on the same level otherwise
- Source: