Class: Plot

sigplot. Plot

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
Name Type Description
cmode String

the plot rendering mode "IN" = Index, "AB" = Abscissa, "MA" = Magnitude, "PH" = Phase, "RE" = Real, "IM" = Imaginary, "LO" or "D1" = 10log, "L2" or "D2" = 20log, "RI" or "IR" = Real vs. Imaginary

phunits String

the phase units "D" = Degrees, "R" = Radians, "C" = Cycles

cross Boolean

display cross hairs on the plot

nogrid Boolean

hide the background grid

legend Boolean

hide the legned

nopan Boolean

disable panning on the plot

nomenu Boolean

disable the middle-click menu

nospec Boolean

hide all plot specification displays

noxaxis Boolean

hide the x-axis

noyaxis Boolean

hide the y-axis

noreadout Boolean

hide the plot readout area

nodragdrop Boolean

prevent file drag drop

scroll_time_interval Number
index Boolean

use the data-index in the X axis

autox Number

auto-scaling settings for X axis

xmin Number

the minimum range to display on the X axis

xmax Number

the maximum range to display on the X axis

xlab Number

the units that X-axis uses (see m.UNITS)

xdiv Number

the number of divisions on the X axis

xcnt Number

configure the mtag mouse controls 0 = Off, 1 (default) = LM Click, 2 = Continuous

rubberbox_mode String

controls the behavior of the rubberbox "zoom" (default) = zoom to the selected area "box" = trigger an mtag action on the selected area

line Number

the line type to draw 0 = None, 1 = Verticals, 2 = Horizontals, 3 (default) = Connecting

autoy Number

auto-scaling settings for Y axis

ylab Number

the units that Y-axis uses (see m.UNITS)

ymin Number

the minimum range to display on the Y axis

ymax Number

the maximum range to display on the Y axis

ydiv Number

the number of divisions on the Y axis

yinv Boolean

invert the y-axis

colors.fg String

the foreground color as a CSS color

colors.bg String

the background color as a CSS color

xi Boolean

invert the foreground/background colors

forcelab Boolean
all Boolean

show all of the data on the plot instead of just one buffer

expand Boolean

auto-scale the plot based on all the data (when combined with the all option)

origin Number

1 = x1:xmin, x2:xmax, y1:ymax, y2:ymin (default), 2 = x1:xmax, x2:xmin, y1:ymax, y2:ymin (x inverted), 3 = x1:xmax, x2:xmin, y1:ymin, y2:ymax (x & y inverted), 4 = x1:xmin, x2:xmax, y1:ymin, y2:ymax (y inverted)

bufmax Number

the buffer size to use

nokeypress Boolean

disable key press actions

anno_type

(Not implemented)

pmt

(Not implemented)

xfmt

(Not implemented)

yfmt

(Not implemented)

nsec

the number of sections to split the plot into (Not implemented)

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 for the x-axis only

yzoom

if true, respond to zoom events for the y-axis only

unzoom

if true, respond to unzoom events

pan

if true, respond to pan events

xpan

if true, respond to pan events for the x-axis only

ypan

if true, respond to pan events for the y-axis only

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:
DocStrap Copyright © 2012-2013 The contributors to the JSDoc3 and DocStrap projects.
Documentation generated by JSDoc 3.2.2 on Wed Mar 11 2015 20:53:18 GMT-0000 (GMT) using the DocStrap template.