# Working with KstScript

## KstScript Classes:

Arrow | Axis | AxisLabel
AxisTickLabel | BinnedMap | BorderedViewObject
Box | Collection | ColorSequence
CrossPowerSpectrum | Curve | CurveCollection
DataMatrix | DataObject | DataObjectCollection
DataSource | DataSourceCollection | DataVector
Debug | DebugLog | DebugLogEntry
Dir | Document | Ellipse
ELOG | Equation | EquationCollection
Extension | ExtensionCollection | File
Group | Histogram | HistogramCollection
Image | Kst | Label
Legend | Line | Matrix
MatrixCollection | Object | ObjectCollection
Picture | Plot | PlotCollection
PlotLabel | Plugin | PluginCollection
PluginIO | PluginIOCollection | PluginManager
PluginModule | PluginModuleCollection | Point
PowerSpectrum | PowerSpectrumCollection | Scalar
ScalarCollection | Size | Spectrogram
SpectrogramCollection | String | StringCollection
TimeInterpretation | Vector | VectorCollection
VectorView | ViewObject | ViewObjectCollection
Window | WindowCollection

## Class: Arrow

A customizable arrow graphic.

Inherits: Line

Collection class: ViewObjectCollection

### Constructors:

- Arrow ( parent )

- Arrow ( window )

### Properties:

- fromArrow

- toArrow

- fromArrowScaling

- toArrowScaling

###

#### Arrow ( ViewObject parent )

- ViewObject parent - The parent to place the new arrow in. May also be a string containing the name of an existing ViewObject.

Creates a new arrow and places it in the ViewObject parent.

#### Arrow ( Window window )

- Window window - The window to place the new arrow in. May also be a string containing the name of an existing Window.

Creates a new arrow and places it in the Window window.

#### boolean fromArrow

True if the arrow has an arrow at the start point.

#### boolean toArrow

True if the arrow has an arrow at the end point.

#### number fromArrowScaling

Scale size of the arrow at the start point.

#### number toArrowScaling

Scale size of the arrow at the end point.

## Class: Axis

A class representing a plot axis.

### Methods:

- scaleAuto ( )

- scaleAutoSpikeInsensitive ( )

- scaleExpression ( minExp, maxExp )

- scaleRange ( min, max )

### Properties:

- log

- suppressed

- oppositeSuppressed

- offsetMode

- reversed

- majorGridLines

- minorGridLines

- transformation

- innerTicks

- outerTicks

- label

- type

- majorGridColor

- minorGridColor

- minorTickCount

- majorTickDensity

- scaleMode

- interpretation

- title

- tickLabel

###

#### void scaleAuto ( )

Sets the scale mode to Auto.

#### void scaleAutoSpikeInsensitive ( )

Sets the scale mode to Auto Spike Insensitive.

#### void scaleExpression ( string minExp, string maxExp )

- string minExp - The expression for the minimum of the scale.

- string maxExp - The expression for the maximum of the scale.

Sets the scale mode to Expression.

#### void scaleRange ( number min, number max )

- number min - The value for the minimum of the scale.

- number max - The value for the maximum of the scale.

Sets the scale mode to Fixed and sets the range.

#### boolean log

True if the axis is in logarithm mode.

#### boolean suppressed

True if this axis is suppressed.

#### boolean oppositeSuppressed

True if the opposite axis is suppressed. (Right X or top Y)

#### number offsetMode

The base + offset mode. Value must be one of:

- 0 - Automatic

- 1 - On

- 2 - Off

For backwards compatibility the value can also be set as a boolean, in which case true corresponds to On and false corresponds to Automatic.

#### boolean reversed

True if this axis is reversed.

#### boolean majorGridLines

True if this axis shows major grid lines.

#### boolean minorGridLines

True if this axis shows minor grid lines.

#### string transformation

The transformation expression for this axis.

#### boolean innerTicks

True if tick marks are displayed inside the plot.

#### boolean outerTicks

True if tick marks are displayed outside the plot.

#### string label

The label for this axis.

#### string type [Read-Only]

The type of axis - X or Y presently.

#### string majorGridColor

The color for the major grid lines.

#### string minorGridColor

The color for the minor grid lines.

#### number minorTickCount

The number of minor ticks between two major ticks. The special value -1 forces Kst to determine this automatically.

#### number majorTickDensity

The density of major tick markers along this axis. Value must be one of:

- 0 - Coarse

- 1 - Default

- 2 - Fine

- 3 - Very Fine

#### number scaleMode [Read-Only]

The type of scaling done on the axis. Value is one of:

- 0 - Auto

- 1 - All Curves (By Midpoint)

- 2 - Fixed

- 3 - Auto Up (Only Scales Upward)

- 4 - Auto (Spike Insensitive)

- 5 - Auto (obsolete, same as 0)

- 6 - Expression Based

#### TimeInterpretation interpretation [Read-Only]

The method with which the axis is interpreted and times are displayed.

#### AxisLabel title

The label for this axis.

#### AxisTickLabel tickLabel

The tick label for this axis.

## Class: AxisLabel

A class representing a plot axis label.

### Properties:

- text

- font

- fontSize

- type

###

#### string text

Contains the text contents of the label. This may include scalar references of the form [scalar_name] and some basic LaTeX.

#### string font

Used to set or get the current font used for the label.

#### number fontSize

Contains the size of the font used to draw the label.

#### string type [Read-Only]

The type of axis - X or Y presently.

## Class: AxisTickLabel

A class representing a plot axis tick label.

### Properties:

- font

- fontSize

- rotation

- type

###

#### string font

Used to set or get the current font used for the label.

#### number fontSize

Contains the size of the font used to draw the label.

#### number rotation

Contains the rotation angle of the label. Rotation is clockwise from normal and is stored in degrees.

#### string type [Read-Only]

The type of axis - X or Y presently.

## Class: BinnedMap

This class represents a binned map object in Kst.

Inherits: DataObject

### Constructors:

- BinnedMap ( )

### Methods:

- validate ( )

### Properties:

- x

- y

- z

- binnedMap

- hitsMap

- xFrom

- xTo

- yFrom

- yTo

- nX

- nY

- autobin

- valid

###

#### BinnedMap ( )

Main constructor for the BinnedMap class.

#### void validate ( )

Validates the plugin.

#### Vector x

Contains the x vector.

#### Vector y

Contains the y vector.

#### Vector z

Contains the z vector.

#### string binnedMap

Contains the name of binned map matrix.

#### string hitsMap

Contains the name of the hits map matrix.

#### Scalar xFrom

Contains the from value of the x vector.

#### Scalar xTo

Contains the to value of the x vector.

#### Scalar yFrom

Contains the from value of the y vector.

#### Scalar yTo

Contains the to value of the y vector.

#### Scalar nX

Contains the number of x bins.

#### Scalar nY

Contains the number of y bins.

#### Scalar autobin

Contains the autobin setting. Zero for no auto-binning and non-zero for auto-binning.

#### boolean valid [Read-Only]

Returns true if all the inputs and outputs of the binned map have been set.

## Class: BorderedViewObject

Represents some objects in a Kst window. This is an abstract object and may not be instantiated directly. It has several properties not in regular ViewObjects including margins, padding, and a border.

Inherits: ViewObject

Collection class: ViewObjectCollection

### Properties:

- padding

- margin

- borderWidth

- borderColor

###

#### number padding

The number of pixels between the border and the contents.

#### number margin

The number of pixels between the edge of the object and the border.

#### number borderWidth

The width in pixels of the border.

#### string borderColor

The border color for this object.

## Class: Box

A customizable box graphic.

Inherits: ViewObject

Collection class: ViewObjectCollection

### Constructors:

- Box ( parent )

- Box ( window )

### Properties:

- xRound

- yRound

- borderWidth

- borderColor

###

#### Box ( ViewObject parent )

- ViewObject parent - The parent to place the new box in. May also be a string containing the name of an existing ViewObject.

Creates a new box and places it in the ViewObject parent.

#### Box ( Window window )

- Window window - The window to place the new box in. May also be a string containing the name of an existing Window.

Creates a new box and places it in the Window window.

#### number xRound

The roundness of the corners in the X dimension. Must be an integer between 0 and 99.

#### number yRound

The roundness of the corners in the Y dimension. Must be an integer between 0 and 99.

#### number borderWidth

The width in pixels of the border.

#### string borderColor

The border color for this object.

## Class: Collection

This is the generic collection class used by Kst to store lists of objects. It behaves mostly like an array in JavaScript. At this time indices are read-only. In addition, if a collection is read-only, mutator methods will throw exceptions.

Iteration looks something like this:

                    for (i = 0; i < collection.length; ++i) {
                      // do something with collection[i]
                    }

### Methods:

- append ( newObj )

- prepend ( newObj )

- remove ( n )

- remove ( obj )

- clear ( )

### Properties:

- length

- readOnly

###

#### void append ( Object newObj )

- Object newObj - The new object to append to the collection.

Appends a new object to the end of the collection.

#### void prepend ( Object newObj )

- Object newObj - The new object to prepend to the collection.

Prepends a new object to the start of the collection.

#### void remove ( number n )

- number n - The index of the entry to remove.

Removes an entry from the collection.

#### void remove ( Object obj )

- Object obj - The object to remove.

Removes an object from the collection.

#### void clear ( )

Clears the collection, removing all entries.

#### number length [Read-Only]

The number of items in the collection. Items are ordered 0..(length - 1) so it is easy to iterate.

#### boolean readOnly [Read-Only]

True if this is a read-only collection.

## Class: ColorSequence

Provides access to the Kst color sequence used for coloring curves.

### Methods:

- next ( [previous] )

- tooClose ( firstColor, secondColor )

###

#### string next ( [string previous] )

- string previous - The previous color in the color sequence you are following. Not necessary.

  [OPTIONAL]

Returns the next color in the color sequence.

#### boolean tooClose ( string firstColor, string secondColor )

- string firstColor - The first of two colors to compare.

- string secondColor - The second of two colors to compare.

Returns true if colors are too close.

## Class: CrossPowerSpectrum

This class represents a cross power spectrum object in Kst.

Inherits: DataObject

### Methods:

- validate ( )

### Properties:

- v1

- v2

- length

- sample

- real

- imaginary

- frequency

- valid

###

#### void validate ( )

Validates the plugin.

#### Vector v1

Contains the first vector.

#### Vector v2

Contains the second vector.

#### Scalar length

Contains the base 2 logarithm of the length of the cross power spectrum. Should be an integer >= 2.

#### Scalar sample

Contains the sample rate.

#### string real

Contains the name of the output vector holding the real part of the cross power spectrum.

#### string imaginary

Contains the name of the output vector holding the imaginary part of the cross power spectrum.

#### string frequency

Contains the name of the output vector holding the frequencies of the cross power spectrum.

#### boolean valid [Read-Only]

Returns true if all the inputs and outputs of the cross power spectrum have been set.

## Class: Curve

Represents a curve formed from an X and a Y vector.

Inherits: DataObject

Collection class: CurveCollection

### Constructors:

- Curve ( x, y [, xError [, yError [, xMinusError [, yMinusError]]]] )

- Curve ( hs )

### Methods:

- point ( index )

- xErrorPoint ( index )

- yErrorPoint ( index )

- xMinusErrorPoint ( index )

- yMinusErrorPoint ( index )

### Properties:

- color

- xVector

- yVector

- xErrorVector

- yErrorVector

- xMinusErrorVector

- xMinusErrorVector

- yVectorOffset

- samplesPerFrame

- ignoreAutoScale

- hasPoints

- hasLines

- hasBars

- lineWidth

- pointStyle

- lineStyle

- barStyle

- pointDensity

- topLabel

- xLabel

- yLabel

- legendText

###

#### Curve ( Vector x, Vector y [, Vector xError [, Vector yError [, Vector xMinusError [, Vector yMinusError]]]] )

- Vector x - The X vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

- Vector y - The Y vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

- Vector xError - The X error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

  [OPTIONAL]

- Vector yError - The Y error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

  [OPTIONAL]

- Vector xMinusError - The X minus error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

  [OPTIONAL]

- Vector yMinusError - The Y minus error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object.

  [OPTIONAL]

Main constructor for Curve class. Constructing a new curve automatically adds it to the data collection of Kst.

#### Curve ( Histogram hs )

- Histogram hs - Creates a curve from a histogram.

Constructor for Curve class. Allows a curve to be simply created from a Histogram class.

#### Point point ( number index )

- number index - The index of the point to retrieve the coordinates for. Starts at 0.

Retrieve the coordinates for a given point in the curve. Returns an invalid point if that index does not exist.

#### number xErrorPoint ( number index )

- number index - The index of the point to retrieve the coordinates for. Starts at 0.

Retrieve the value for a given point in the X error bars. Returns an invalid point if that index does not exist.

#### number yErrorPoint ( number index )

- number index - The index of the point to retrieve the coordinates for. Starts at 0.

Retrieve the value for a given point in the Y error bars. Returns an invalid point if that index does not exist.

#### number xMinusErrorPoint ( number index )

- number index - The index of the point to retrieve the coordinates for. Starts at 0.

Retrieve the value for a given point in the X minus error bars. Returns an invalid point if that index does not exist.

#### number yMinusErrorPoint ( number index )

- number index - The index of the point to retrieve the coordinates for. Starts at 0.

Retrieve the value for a given point in the Y minus error bars. Returns an invalid point if that index does not exist.

#### string color

The color of the curve. Stored in the form "#RRGGBB" as hex values. This property can also be set with English strings such as "blue".

#### Vector xVector

The X axis vector for the curve.

#### Vector yVector

The Y axis vector for the curve.

#### Vector xErrorVector

The X axis error vector for the curve.

#### Vector yErrorVector

The Y axis error vector for the curve.

#### Vector xMinusErrorVector

The X axis negative error vector for the curve.

#### Vector xMinusErrorVector

The X axis negative error vector for the curve.

#### Scalar yVectorOffset

The offset to be applied to the y-axis vector.

#### number samplesPerFrame [Read-Only]

The number of samples per frame for the curve.

#### boolean ignoreAutoScale

If true, this curve ignores auto scale.

#### boolean hasPoints

If true, points are plotted for this curve.

#### boolean hasLines

If true, lines are drawn for this curve.

#### boolean hasBars

If true, bars are drawn for this curve.

#### number lineWidth

Sets the line width for this curve when lines are drawn.

#### number pointStyle

Sets the point style for this curve when points are drawn.

- 0 - Cross

- 1 - Hollow box

- 2 - Hollow circle

- 3 - Filled circle

- 4 - Inverted hollow triangle

- 5 - Hollow triangle

- 6 - Filled box

- 7 - Plus

- 8 - Asterisk

- 9 - Inverted filled triangle

- 10 - Filled triangle

- 11 - Hollow diamond

- 12 - Filled diamond

- 13 - Point

#### number lineStyle

Sets the line style for this curve when lines are drawn.

- 0 - Solid

- 1 - Dash

- 2 - Dot

- 3 - Dash Dot

- 4 - Dash Dot Dot

#### number barStyle

Sets the bar style for this curve when bars are drawn.

- 0 - Lines

- 1 - Solid

#### number pointDensity

Sets the point density for this curve when points are plotted.

- 0 - Draw all points

- 1 - High density

- 2 - Medium density

- 3 - Low density

#### string topLabel [Read-Only]

The top label suggestion for this curve.

#### string xLabel [Read-Only]

The X-axis label suggestion for this curve.

#### string yLabel [Read-Only]

The Y-axis label suggestion for this curve.

#### string legendText

The legend text associated with a curve.

## Class: CurveCollection

An array of curves.

Inherits: Collection

###

## Class: DataMatrix

A matrix object loaded from a data source.

Inherits: Matrix

### Constructors:

- DataMatrix ( source, field [, xStart, yStart, xN, yN [, skip [, ave]]] )

### Methods:

- reload ( )

- changeFile ( source )

- change ( xStart, yStart, xCount, yCount [, skip [, ave]] )

### Properties:

- valid

- skip

- boxcar

- xReadToEnd

- yReadToEnd

- xCountFromEnd

- yCountFromEnd

- skipLength

- field

- dataSource

###

#### DataMatrix ( DataSource source, string field [, number xStart, number yStart, number xN, number yN [, number skip [, boolean ave]]] )

- DataSource source - The DataSource to load data from. This may be a string containing the url of the DataSource to load. If so, it will attempt to reuse an existing DataSource instance, or fall back to a new DataSource object. It may also be specified as a DataSource object.

- string field - The field to load from the source.

- number xStart - The x frame to start reading from.

  [OPTIONAL]

- number yStart - The y frame to start reading from.

- number xN - The number of x frames to read.

- number yN - The number of y frames to read.

- number skip - The number of samples to skip by.

  [OPTIONAL]

- boolean ave - Set to true to do boxcar filtering.

  [OPTIONAL]

#### void reload ( )

#### void changeFile ( DataSource source )

- DataSource source - The DataSource to switch to.

Switches this DataMatrix to a different DataSource.

#### void change ( number xStart, number yStart, number xCount, number yCount [, number skip [, boolean ave]] )

- number xStart - The x starting frame.

- number yStart - The y starting frame.

- number xCount - The number of x frames to read.

- number yCount - The number of y frames to read.

- number skip - The number of frames to skip by.

  [OPTIONAL]

- boolean ave - True to boxcar filter.

  [OPTIONAL]

Changes the sequence of data that is read in by this matrix.

#### boolean valid [Read-Only]

True if the data matrix is valid.

#### boolean skip [Read-Only]

True if the matrix should skip by skipLength samples while reading from the data source.

#### boolean boxcar [Read-Only]

True if the matrix should be boxcar filtered.

#### boolean xReadToEnd [Read-Only]

If true, the matrix is read to the end of the source in the x dimension.

#### boolean yReadToEnd [Read-Only]

If true, the matrix is read to the end of the source in the y dimension.

#### boolean xCountFromEnd [Read-Only]

If true, the matrix reads only a maximum number of samples from the end of the source in the x dimension.

#### boolean yCountFromEnd [Read-Only]

If true, the matrix reads only a maximum number of samples from the end of the source in the y dimension.

#### number skipLength [Read-Only]

The number of samples to skip by.

#### string field [Read-Only]

The field being read from the data source to create this matrix.

#### DataSource dataSource [Read-Only]

The data source object used by this DataMatrix.

## Class: DataObject

The abstract base class for all Kst data objects.

Inherits: Object

Collection class: DataObjectCollection

### Methods:

- convertTo ( type )

### Properties:

- type

###

#### DataObject convertTo ( string type )

- string type - The type to attempt to convert this object to.

Attempts to convert this DataObject to a different type. The object must be derived from this type at some level. Null is returned if it is not possible to convert to the requested type.

#### string type [Read-Only]

The type of data object this is.

## Class: DataObjectCollection

An array of DataObjects.

Inherits: Collection

###

## Class: DataSource

An object that represents a data file that is understood by Kst.

Inherits: Object

Collection class: DataSourceCollection

### Constructors:

- DataSource ( url [, type] )

### Methods:

- isValidField ( field )

- fieldList ( )

- reset ( )

- matrixList ( )

- samplesPerFrame ( field )

- frameCount ( [field] )

- setConfiguration ( setting, setting )

- configuration ( setting )

- units ( field )

### Properties:

- valid

- empty

- completeFieldList

- fileName

- fileType

- source

- metaData

###

#### DataSource ( string url [, string type] )

- string url - The filename or URL to load.

- string type - The name of the data source plugin to use.

  [OPTIONAL]

Creates a new DataSource object. If the url cannot be opened and read, isValid will be false.

#### boolean isValidField ( string field )

- string field - A field name to check for.

Returns if the field is valid or not.

#### StringArray fieldList ( )

Generates a list of the fields available from this source.

#### void reset ( )

Resets the data source.

#### StringArray matrixList ( )

Generates a list of the matrices available from this source.

#### number samplesPerFrame ( string field )

- string field - A field name to get the number of samples per frame for. This is the same for every field in some sources, but different in others.

The number of samples per frame for this field or source.

#### number frameCount ( [string field] )

- string field - An optional field name to get the number of frames for. This is the same for every field in some sources, but different in others.

  [OPTIONAL]

Gets the number of frames for the source, or the given field if it is specified.

#### boolean setConfiguration ( string setting, string setting )

- string setting - Gives the setting name to set the value of.

- string setting - Gives the value of the setting.

Sets a configuration setting of the data source.

#### string configuration ( string setting )

- string setting - Gives the setting name to retrive the value of.

Gets a configuration setting of the data source.

#### string units ( string field )

- string field - Gives the field name to retrieve the units of.

Gets the units associated with a field of the data source.

#### boolean valid [Read-Only]

True if the data source is valid.

#### boolean empty [Read-Only]

True if the data source is empty.

#### boolean completeFieldList [Read-Only]

True if the field list is complete.

#### string fileName [Read-Only]

Name of the file.

#### string fileType [Read-Only]

The type (format) of the file, such as ASCII.

#### string source [Read-Only]

The name of the data source.

#### StringArray metaData [Read-Only]

Any metadata associated with the data source. This is an associative array of form metaData["key"] = "value".

## Class: DataSourceCollection

An array of DataSources.

Inherits: Collection

###

## Class: DataVector

A vector object loaded from a data source.

Inherits: Vector

### Constructors:

- DataVector ( source, field [, start [, n [, skip [, ave]]]] )

- DataVector ( source, field, typeStart, start, typeCount, count [, skip [, ave]] )

### Methods:

- reload ( )

- changeFile ( source )

- changeFrames ( start, count [, skip [, ave]] )

- changeFramesByTime ( typeStart, start, typeCount, count [, skip [, ave]] )

### Properties:

- valid

- skip

- boxcar

- readToEnd

- countFromEnd

- skipLength

- startFrame

- startFrameRequested

- frames

- framesRequested

- samplesPerFrame

- field

- dataSource

###

#### DataVector ( DataSource source, string field [, number start [, number n [, number skip [, boolean ave]]]] )

- DataSource source - The DataSource to load data from. This may be a string containing the url of the DataSource to load. If so, it will attempt to reuse an existing DataSource instance, or fall back to a new DataSource object. It may also be specified as a DataSource object.

- string field - The field to load from the source.

- number start - The frame to start reading from.

  [OPTIONAL]

- number n - The number of frames to read.

  [OPTIONAL]

- number skip - The number of samples to skip by.

  [OPTIONAL]

- boolean ave - Set to true to do boxcar filtering.

  [OPTIONAL]

#### DataVector ( DataSource source, string field, string typeStart, number start, string typeCount, number count [, number skip [, boolean ave]] )

- DataSource source - The DataSource to load data from. This may be a string containing the url of the DataSource to load. If so, it will attempt to reuse an existing DataSource instance, or fall back to a new DataSource object. It may also be specified as a DataSource object.

- string field - The field to load from the source.

- string typeStart - The type of the value specifying the start position. The permissible values are as follows:

  - frames

  - date

  - ms (milliseconds)

  - s (seconds)

  - m (minutes)

  - h (hours)

  - days

  - weeks

  - months

  - years

  The date entry uses the format yyyy:mm:dd:hh:mm.ss (e.g. 2009:2:13:13:10.12). If any of the leading elements are omitted then the current year, month, day, etc. are assumed. If the year is less than 0, then it is assumed to be given relative to 1970 (e.g. -10 becomes 1980), else if the year is less than 100 it is assumed to be relative to 2000 (e.g. 9 becomes 2009), else the year is taken as given.

- number start - The starting frame, date (a string argument), or time offset.

- string typeCount - The type of the value specifying the count

- number count - The number of frames or time duration to read. The permissible values are as follows:

  - frames

  - ms (milliseconds)

  - s (seconds)

  - m (minutes)

  - h (hours)

  - days

  - weeks

  - months

  - years

- number skip - The number of samples to skip by.

  [OPTIONAL]

- boolean ave - Set to true to do boxcar filtering.

  [OPTIONAL]

#### void reload ( )

#### void changeFile ( DataSource source )

- DataSource source - The DataSource to switch to.

Switches this DataVector to a different DataSource.

#### void changeFrames ( number start, number count [, number skip [, boolean ave]] )

- number start - The starting frame.

- number count - The number of frames to read.

- number skip - The number of frames to skip by.

  [OPTIONAL]

- boolean ave - True to boxcar filter.

  [OPTIONAL]

Changes the sequence of data that is read in by this vector.

#### void changeFramesByTime ( string typeStart, number start, string typeCount, number count [, number skip [, boolean ave]] )

- string typeStart - The type of the value specifying the start position. The permissible values are as follows:

  - frames

  - date

  - ms (milliseconds)

  - s (seconds)

  - m (minutes)

  - h (hours)

  - days

  - weeks

  - months

  - years

  The date entry uses the format yyyy:mm:dd:hh:mm.ss (e.g. 2009:2:13:13:10.12). If any of the leading elements are omitted then the current year, month, day, etc. are assumed. If the year is less than 0, then it is assumed to be given relative to 1970 (e.g. -10 becomes 1980), else if the year is less than 100 it is assumed to be relative to 2000 (e.g. 9 becomes 2009), else the year is taken as given.

- number start - The starting frame, date (a string argument), or time offset.

- string typeCount - The type of the value specifying the count

- number count - The number of frames or time duration to read. The permissible values are as follows:

  - frames

  - ms (milliseconds)

  - s (seconds)

  - m (minutes)

  - h (hours)

  - days

  - weeks

  - months

  - years

- number skip - The number of frames to skip by.

  [OPTIONAL]

- boolean ave - True to boxcar filter.

  [OPTIONAL]

Changes the sequence of data that is read in by this vector.

#### boolean valid [Read-Only]

True if the data vector is valid.

#### boolean skip [Read-Only]

True if the vector should skip by skipLength samples while reading from the data source.

#### boolean boxcar [Read-Only]

True if the vector should be boxcar filtered.

#### boolean readToEnd [Read-Only]

If true, the vector is read to the end of the source.

#### boolean countFromEnd [Read-Only]

If true, the vector reads only a maximum number of samples from the end of the source.

#### number skipLength [Read-Only]

The number of samples to skip by.

#### number startFrame [Read-Only]

The starting frame number.

#### number startFrameRequested [Read-Only]

The requested starting frame number. May not be the actual startFrame.

#### number frames [Read-Only]

The number of frames read from the source.

#### number framesRequested [Read-Only]

The number of frames requested to be read from the source. May not be the actual frames.

#### number samplesPerFrame [Read-Only]

The number of samples per frame for the associated data source.

#### string field [Read-Only]

The field being read from the data source to create this vector.

#### DataSource dataSource [Read-Only]

The data source object used by this DataVector.

## Class: Debug

A reference to the debug and logging subsystem of Kst.

### Methods:

- warning ( message )

- error ( message )

- notice ( message )

- debug ( message )

- clear ( )

- clearNewError ( )

### Properties:

- log

- newError

- version

- revision

###

#### void warning ( string message )

- string message -

Logs a warning message to the Kst log.

#### void error ( string message )

- string message -

Logs an error message to the Kst log.

#### void notice ( string message )

- string message -

Logs a notice to the Kst log.

#### void debug ( string message )

- string message -

Logs a debug message to the Kst log.

#### void clear ( )

Clears the Kst log.

#### void clearNewError ( )

Clears the new error flag.

#### DebugLog log [Read-Only]

Provides access to the Kst log contents.

#### boolean newError [Read-Only]

Return the value of the new error flag.

#### string version [Read-Only]

Return the version of Kst.

#### string revision [Read-Only]

Return the revision of Kst.

## Class: DebugLog

A reference to the Kst debug log. This object is an array of the entries in the debug log. It cannot be modified. The length of the array is the number of entries, and each entry is a DebugLogEntry object.

### Properties:

- length

- text

- lengthNotices

- textNotices

- lengthWarnings

- textWarnings

- lengthErrors

- textErrors

- lengthDebugs

- textDebugs

###

#### number length [Read-Only]

The number of entries in the log.

#### string text [Read-Only]

The text contents of the log as a single large string with carriage returns between entries.

#### number lengthNotices [Read-Only]

The number of notices in the log.

#### string textNotices [Read-Only]

The text contents of the log notices as a single large string with carriage returns between entries.

#### number lengthWarnings [Read-Only]

The number of warnings in the log.

#### string textWarnings [Read-Only]

The text contents of the log warnings as a single large string with carriage returns between entries.

#### number lengthErrors [Read-Only]

The number of errors in the log.

#### string textErrors [Read-Only]

The text contents of the log errors as a single large string with carriage returns between entries.

#### number lengthDebugs [Read-Only]

The number of debug messages in the log.

#### string textDebugs [Read-Only]

The text contents of the log debug messages as a single large string with carriage returns between entries.

## Class: DebugLogEntry

An entry in the Kst debug log.

### Properties:

- text

- date

- level

###

#### string text [Read-Only]

Contains the text of this entry.

#### date date [Read-Only]

Contains the timestamp of this entry.

#### string level [Read-Only]

Contains the log level for this entry.

- N - Notice

- D - Debug

- W - Warning

- E - Error

- A single space ' ' indicates an unknown entry type.

## Class: Dir

An object that represents a directory.

### Constructors:

- Dir ( name )

### Methods:

- fileList ( nameFilters )

- dirList ( nameFilters )

### Properties:

- path

###

#### Dir ( string name )

- string name - Name of the directory.

Constructs a dir in the given directory.

#### StringArray fileList ( string nameFilters )

- string nameFilters - Specifies the name filters.

Returns a list of files in the directory that match the given name filters.

#### StringArray dirList ( string nameFilters )

- string nameFilters - Specifies the name filters.

Returns a list of sub-directories in the directory that match the given name filters.

#### string path

The path of the folder.

## Class: Document

A pointer to a Kst document. Typically accessed via the global Kst object via Kst.document.

### Methods:

- save ( [filename] )

- clear ( )

- load ( filename )

### Properties:

- text

- name

- modified

###

#### void save ( [string filename] )

- string filename - An optional filename to save to. If not provided, it will be saved to the current filename or the user will be prompted.

  [OPTIONAL]

Saves the current Kst session to disk.

#### void clear ( )

Clears the current Kst session and starts a new one.

#### boolean load ( string filename )

- string filename - The filename for a Kst file to load.

Loads a new Kst file into Kst.

#### string text [Read-Only]

The XML text of the current session in Kst-file form.

#### string name

The filename for the current Kst session.

#### boolean modified

True if the document has been modified but not saved.

## Class: Ellipse

A customizable ellipse graphic.

Inherits: ViewObject

Collection class: ViewObjectCollection

### Constructors:

- Ellipse ( parent )

- Ellipse ( window )

### Properties:

- borderWidth

- borderColor

###

#### Ellipse ( ViewObject parent )

- ViewObject parent - The parent to place the new ellipse in. May also be a string containing the name of an existing ViewObject.

Creates a new ellipse and places it in the ViewObject parent.

#### Ellipse ( Window window )

- Window window - The window to place the new ellipse in. May also be a string containing the name of an existing Window.

Creates a new ellipse and places it in the Window window.

#### number borderWidth

The width of the border of the ellipse.

#### string borderColor

The color of the border of the ellipse.

## Class: ELOG

An object that represents the interface to an ELOG server.

### Constructors:

- ELOG ( )

### Methods:

- submit ( )

- addAttachment ( attachment )

- clearAttachments ( )

- addAttribute ( attribute, attributeValue )

- removeAttribute ( attribute )

- clearAttributes ( )

### Properties:

- hostname

- port

- logbook

- username

- password

- writePassword

- text

- encodedHTML

- suppressEmailNotification

- includeCapture

- captureWidth

- captureHeight

- includeConfiguration

- includeDebugInfo

###

#### ELOG ( )

Interface to an ELOG server.

#### void submit ( )

Submits the ELOG entry.

#### void addAttachment ( string attachment )

- string attachment - The name of the attachment.

Adds an attachment to the ELOG entry.

#### void clearAttachments ( )

Clears the list of attachments in the ELOG entry.

#### void addAttribute ( string attribute, string attributeValue )

- string attribute - The name of the attribute to be added to the ELOG entry.

- string attributeValue - The value of the attribute to be added to the ELOG entry.

Adds an attribute to the ELOG entry.

#### void removeAttribute ( string attribute )

- string attribute - The name of the attribute to be removed from the ELOG entry.

Removes an attribute from the ELOG entry.

#### void clearAttributes ( )

Clears the list of attributes in the ELOG entry.

#### string hostname

The hostname of the ELOG server.

#### number port

The port number of the ELOG server.

#### string logbook

A weblog made available by the ELOG server.

#### string username

Username.

#### string password

Password.

#### string writePassword

The write password.

#### string text

Text.

#### boolean encodedHTML

The message is HTML encoded.

#### boolean suppressEmailNotification

If true email notification is suppressed.

#### boolean includeCapture

If true an image capture of the Kst session is included in the ELOG entry.

#### number captureWidth

The width of the image capture to be included in the ELOG entry.

#### number captureHeight

The height of the image capture to be included in the ELOG entry.

#### boolean includeConfiguration

If true a capture of the Kst session is included in the ELOG entry.

#### boolean includeDebugInfo

If true a capture of the Kst debug information is included in the ELOG entry.

## Class: Equation

This object represents an equation object in Kst. It is interpreted using Kst's internal equation interpreter, and not the JavaScript interpreter. It should be considerably faster than the JavaScript interpreter.

Inherits: DataObject

Collection class: EquationCollection

### Constructors:

- Equation ( equation, xVector [, interpolate] )

- Equation ( equation, x0, x1, n )

### Properties:

- equation

- valid

- xVector

- yVector

###

#### Equation ( string equation, Vector xVector [, boolean interpolate] )

- string equation - The text of the equation to interpret.

- Vector xVector - The X axis (input) vector to use. The symbolic variable x; represents the value at the current index in this vector. A text string representing the name of an existing vector may also be used here.

- boolean interpolate - If true, the equation interpreter will interoplate to the highest resolution vector. This is the default behavior.

  [OPTIONAL]

The default constructor to create an equation object.

#### Equation ( string equation, number x0, number x1, number n )

- string equation - The text of the equation to interpret.

- number x0 - The first value of the generated X (input) vector.

- number x1 - The last value of the generate X (input) vector.

- number n - The number of values in the generated input vector.

A utility constructor which generates an X vector implicitly.

#### string equation

The text of the equation. See the Kst documentation for more information on what the internal equation interpreter supports.

#### boolean valid [Read-Only]

True if the equation object is valid. If false, any values obtained from the yVector should be considered meaningless.

#### Vector xVector [Read-Only]

The X vector (input vector) for the equation.

#### Vector yVector [Read-Only]

The Y vector (output vector) for the equation.

## Class: EquationCollection

An array of Equations.

Inherits: Collection

###

## Class: Extension

A class representing an extension in Kst.

Collection class: ExtensionCollection

### Methods:

- load ( )

- unload ( )

### Properties:

- name

- loaded

###

#### boolean load ( )

Loads this extension into Kst.

#### void unload ( )

Unloads this extension if it is loaded.

#### string name [Read-Only]

The name of this extension.

#### boolean loaded [Read-Only]

True if this extension is presently loaded.

## Class: ExtensionCollection

An array of Kst Extension objects.

Inherits: Collection

###

## Class: File

An object that represents a file.

### Constructors:

- File ( name )

### Methods:

- open ( )

- close ( )

- readLine ( [length] )

### Properties:

- name

- size

- exists

###

#### File ( string name )

- string name - Name of the file to be opened.

Constructs a file with the given name.

#### void open ( )

Opens the file.

#### void close ( )

Closes the file.

#### string readLine ( [number length] )

- number length - Maximum length of string to return

  [OPTIONAL]

Reads a line from the file.

#### string name

The name of the file.

#### number size

The size of the file.

#### boolean exists

True if the underlying file exists.

## Class: Group

A customizable group object.

Inherits: ViewObject

Collection class: ViewObjectCollection

### Constructors:

- Group ( parent )

- Group ( window )

### Methods:

- append ( newObj )

- prepend ( newObj )

- ungroup ( )

###

#### Group ( ViewObject parent )

- ViewObject parent - The parent to place the new arrow in. May also be a string containing the name of an existing ViewObject.

Creates a new arrow and places it in the ViewObject parent.

#### Group ( Window window )

- Window window - The window to place the new arrow in. May also be a string containing the name of an existing Window.

Creates a new arrow and places it in the Window window.

#### void append ( Object newObj )

- Object newObj - The new object to append to the collection.

Appends a new object to the end of the collection.

#### void prepend ( Object newObj )

- Object newObj - The new object to prepend to the collection.

Prepends a new object to the start of the collection.

#### void ungroup ( )

Removes all objects from the collection.

## Class: Histogram

A class representing a histogram object in Kst.

Inherits: DataObject

Collection class: HistogramCollection

### Constructors:

- Histogram ( vector [, xMin [, xMax [, bins]]] )

### Methods:

- setVector ( vector )

- setRange ( from, to )

### Properties:

- realTimeAutoBin

- normalization

- bins

- xMin

- xMax

- xVector

- yVector

###

#### Histogram ( Vector vector [, number xMin [, number xMax [, number bins]]] )

- Vector vector - The input vector for the histogram. May also be specified by the tagName for an existing vector.

- number xMin - The minimum X value. Default is -10.

  [OPTIONAL]

- number xMax - The maximum X value. Default is 10.

  [OPTIONAL]

- number bins - The number of bins to use. Default is 60.

  [OPTIONAL]

Creates a new histogram with the defined properties.

#### void setVector ( Vector vector )

- Vector vector - The vector for the histogram to operate on.

Sets the input vector for the histogram.

#### void setRange ( number from, number to )

- number from - The starting X value.

- number to - The ending X value.

Sets the X range for the histogram.

#### boolean realTimeAutoBin

If true, the histogram automatically bins in real-time.

#### number normalization

Set the y-axis normalization.

- 0 - Number in bin

- 1 - Percent in bin

- 2 - Fraction in bin

- 3 - Peak bin = 1.0

#### number bins

The number of bins for the histogram.

#### number xMin [Read-Only]

The minimum X value for the histogram.

#### number xMax [Read-Only]

The maximum X value for the histogram.

#### Vector xVector [Read-Only]

The X-axis vector generated by the histogram.

#### Vector yVector [Read-Only]

The Y-axis vector generated by the histogram.

## Class: HistogramCollection

An array of Histograms.

Inherits: Collection

###

## Class: Image

An image object created from a matrix.

Inherits: DataObject

### Constructors:

- Image ( matrix )

### Methods:

- minMaxThreshold ( )

- smartThreshold ( )

### Properties:

- matrix

- map

- palette

- lowerThreshold

- upperThreshold

- autoThreshold

- numContours

- contourWeight

- color

###

#### Image ( Matrix matrix )

- Matrix matrix - The matrix for the image. Can be specified as a string containing the tag name of an existing matrix, or as a matrix object.

Main constructor for Image class. Constructing a new image automatically adds it to the data collection of Kst.

#### void minMaxThreshold ( )

Set the thresholding to the current minimum and maximum of the associated matrix.

#### void smartThreshold ( )

Set the thresholding to automatically calculated smart values based on the current values of the the associated matrix.

#### Matrix matrix

The matrix associated with the image.

#### number map

The map type of the image.

- 0 - Color map

- 1 - Contour map

- 2 - Color map and contour map

#### string palette

The name of the palette associated with the image color map.

#### number lowerThreshold

The lower threshold associated with the map.

#### number upperThreshold

The upper threshold associated with the map.

#### boolean autoThreshold

If true, automatic thresholding is enabled.

#### number numContours

The number of contour levels if the contour map is enabled.

#### number contourWeight

The weight of the lines used to draw the contour map, if the contour map is enabled. A value of -1 can be used for a variable contour weight.

#### string color

The color of the contours. Stored in the form "#RRGGBB" as hex values. This property can also be set with English strings such as "blue".

## Class: Kst

The global Kst object. Accessed as Kst, this cannot be reinstantiated.

### Methods:

- loadScript ( fileName )

- resetInterpreter ( )

- waitForUpdate ( )

- purge ( )

- advance ( )

- back ( )

- writeHistory ( filename )

- clearHistory ( )

- addToOutput ( output )

- autoWriteHistory ( filename [, append] )

- forceRepaint ( )

### Properties:

- dataSources

- scalars

- strings

- vectors

- matrices

- windows

- objects

- colors

- extensions

- document

- pluginManager

- gui

- repaintEnabled

###

#### boolean loadScript ( string fileName )

- string fileName - The file to load the script from.

Loads a script file from disk and runs it.

#### void resetInterpreter ( )

Resets the KstScript interpreter. All variables will be lost.

#### void waitForUpdate ( )

Waits for the next update loop to complete.

#### void purge ( )

Purges unused objects in Kst. The has the same behavior as the purge button in the data manager.

#### void advance ( )

Advance one screen.

#### void back ( )

Back one screen.

#### void writeHistory ( string filename )

- string filename - The name of the file to save the command history to.

Saves the command history to a file.

#### void clearHistory ( )

Clears the command history.

#### void addToOutput ( string output )

- string output - String to add to the output.

Adds to the output generated from a function call.

#### void autoWriteHistory ( string filename [, boolean append] )

- string filename - The name of the file to save commands to automatically. Entering a blank filename will stop the saving of commands.

- boolean append - If true and the file already exists then commands will be appended to the existing file.

  [OPTIONAL]

Saves commands automatically to a file.

#### void forceRepaint ( )

Forces a repaint regardless of the value of repaintEnabled.

#### DataSourceCollection dataSources [Read-Only]

The list of all loaded data sources.

#### ScalarCollection scalars [Read-Only]

The list of all scalars in Kst.

#### StringCollection strings [Read-Only]

The list of all strings in Kst.

#### VectorCollection vectors [Read-Only]

The list of all vectors in Kst.

#### MatrixCollection matrices [Read-Only]

The list of all matrices in Kst.

#### WindowCollection windows [Read-Only]

The list of all Kst windows in this process.

#### DataObjectCollection objects [Read-Only]

The list of all data objects in Kst.

#### ColorSequence colors [Read-Only]

A reference to the Kst color sequence in its current state.

#### ExtensionCollection extensions [Read-Only]

The list of all extensions Kst can find installed on the system.

#### Document document [Read-Only]

An object that provides access to the current Kst document along with various utility functions.

#### PluginManager pluginManager [Read-Only]

A reference to the plugin management subsystem of Kst.

#### QWidget gui [Read-Only]

A reference to the Kst GUI. This is implemented using KJSEmbed. The GUI is dynamic and may change between releases or even while Kst is running.

#### boolean repaintEnabled

Determines whether or not manipulation of the Kst interface through scripting will trigger a repaint. Setting this to false before issuing a long series of commands (that each triggers a repaint), and then setting it back to true can greatly enhance the response time of Kst.

## Class: Label

A text label.

Inherits: BorderedViewObject

Collection class: ViewObjectCollection

### Constructors:

- Label ( parent )

- Label ( window )

### Methods:

- adjustSizeForText ( )

### Properties:

- text

- font

- fontSize

- rotation

- dataPrecision

- interpreted

- scalarReplacement

- autoResize [Obsolete]

###

#### Label ( ViewObject parent )

- ViewObject parent - The parent to place the new label in. May also be a string containing the name of an existing ViewObject.

Creates a new label and places it in the ViewObject parent.

#### Label ( Window window )

- Window window - The window to place the new label in. May also be a string containing the name of an existing Window.

Creates a new label and places it in the Window window.

#### void adjustSizeForText ( )

Adjusts the size of the label to fit the text.

#### string text

Contains the text contents of the label. This may include carriage returns (\n), scalar references of the form [scalar_name], and some basic LaTeX.

#### string font

Used to set or get the current font used for the label.

#### number fontSize

Contains the size of the font used to draw the label.

#### number rotation

Contains the rotation angle of the label. Rotation is clockwise from normal and is stored in degrees.

#### number dataPrecision

Contains the number of digits of precision to display data values in the label. Restricted to a value between 0 and 16 inclusive.

#### boolean interpreted

Determines if the contents of the label should be interpreted in order to substitute LaTeX-like constructs. Default is true.

#### boolean scalarReplacement

Determines if the contents of the label should be interpreted in order to substitute variable reference constructs. Default is true.

#### boolean autoResize [Obsolete]

Automatically resizes the label to fit the text exactly. May trigger a slight move of the label. It will not automatically resize if the user resizes it manually via the size property or layout mode.

## Class: Legend

A plot legend.

Inherits: BorderedViewObject

Collection class: ViewObjectCollection

### Constructors:

- Legend ( parent )

- Legend ( window )

### Methods:

- addCurve ( curve )

- removeCurve ( curve )

### Properties:

- font

- fontSize

- textColor

- vertical

- curves

- title

- scaleLineWidth

###

#### Legend ( ViewObject parent )

- ViewObject parent - The parent to place the new legend in. May also be a string containing the name of an existing ViewObject.

Creates a new legend and places it in the ViewObject parent.

#### Legend ( Window window )

- Window window - The window to place the new legend in. May also be a string containing the name of an existing Window.

Creates a new legend and places it in the Window window.

#### void addCurve ( string curve )

- string curve - The curve to be added. This can be either the name of the curve or a reference to the curve.

Adds the curve to the legend.

- Throws: TypeError - Throws this exception if the curve could not be found.

#### void removeCurve ( string curve )

- string curve - The curve to be removed. This can be either the name of the curve or a reference to the curve.

Removes the curve from the legend.

- Throws: TypeError - Throws this exception if the curve could not be found.

#### string font

Used to set or get the current font used for the legend.

#### number fontSize

Contains the size of the font used to draw the legend.

#### string textColor

Contains the color of the text used to draw the legend.

#### boolean vertical

True if the legend entries are stacked vertically.

#### CurveCollection curves [Read-Only]

The list of curves shown in the legend.

#### string title

The title of the legend.

#### number scaleLineWidth

Contains the scale factor for the width of the lines in the legend, relative to the width of the lines in the actual plot.

## Class: Line

A customizable line graphic.

Inherits: ViewObject

Collection class: ViewObjectCollection

### Constructors:

- Line ( parent )

- Line ( window )

### Properties:

- from

- to

- width

- capStyle

- lineStyle

###

#### Line ( ViewObject parent )

- ViewObject parent - The parent to place the new line in. May also be a string containing the name of an existing ViewObject.

Creates a new line and places it in the ViewObject parent.

#### Line ( Window window )

- Window window - The window to place the new line in. May also be a string containing the name of an existing Window.

Creates a new line and places it in the Window window.

#### Point from

The starting point of the line.

#### Point to

The ending point of the line.

#### number width

The width of the line.

#### number capStyle

The cap style for the line.

- 0 - Flat - may not cover the line ends (default)

- 1 - Box - may extend past line ends

- 2 - Rounded

#### number lineStyle

The style for the line.

- 0 - Solid line(default)

- 1 - Dashed line

- 2 - Dotted line

- 3 - Dash - dot line

- 4 - Dash - dot - dot line

## Class: Matrix

Represents a matrix of any type in Kst. Some matrices are editable, while others are not.

Inherits: Object

Collection class: MatrixCollection

### Constructors:

- Matrix ( )

### Methods:

- resize ( columns, rows )

- zero ( )

- value ( column, row )

- setValue ( column, row, value )

- update ( )

### Properties:

- editable

- min

- max

- mean

- numNew

- rows

- columns

###

#### Matrix ( )

Default constructor creates an empty matrix.

#### void resize ( number columns, number rows )

- number columns - The new number of rows in the matrix. Should be >= 1.

- number rows - The new number of columns in the matrix. Should be >= 1.

Resizes the matrix.

- Throws: GeneralError - Throws this exception if the matrix is not editable.

#### void zero ( )

Sets all values in the matrix to zero.

- Throws: GeneralError - Throws this exception if the matrix is not editable.

#### number value ( number column, number row )

- number column - The column index of the matrix position to be read.

- number row - The row index of the matrix position to be read.

Gets the value of a matrix at the given column and row indices.

- Throws: GeneralError - Throws this exception if the indices are out of range.

#### void setValue ( number column, number row, number value )

- number column - The column index of the matrix position to be set.

- number row - The row index of the matrix position to be set.

- number value - The value to set the specified matrix position to.

Sets the value of a matrix at the given column and row indices.

- Throws: GeneralError - Throws this exception if the matrix is not editable or the indices are out of range.

#### void update ( )

Updates the statistical values associated with a matrix.

- Throws: GeneralError - Throws this exception if the matrix is not editable.

#### number editable [Read-Only]

True if the matrix is editable by the user. This should be checked before attempting to modify a matrix in any way.

#### number min [Read-Only]

The value of the smallest sample in the matrix.

#### number max [Read-Only]

The value of the largest sample in the matrix.

#### number mean [Read-Only]

The mean value of all samples in the matrix.

#### number numNew [Read-Only]

The number of new samples.

#### number rows [Read-Only]

The number of rows in the matrix.

#### number columns [Read-Only]

The number of coluns in the matrix.

## Class: MatrixCollection

An array of Matrices.

Inherits: Collection

###

## Class: Object

Represents any object in Kst. This is an abstract object and may not be instantiated directly.

Collection class: ObjectCollection

### Properties:

- tagName

- fullTagName

###

#### string tagName

A unique identifier for this data object.

#### string fullTagName [Read-Only]

The unique contextual identifier for this data object, contained with [...].

## Class: ObjectCollection

An array of Objects. This could contain any objects that inherit from Object, but they are only immediately accessible in their pure base class form.

Inherits: Collection

###

## Class: Picture

A customizable picture object.

Inherits: BorderedViewObject

Collection class: ViewObjectCollection

### Constructors:

- Picture ( parent )

- Picture ( window )

### Methods:

- load ( url )

### Properties:

- image

- url

- refreshTimer

###

#### Picture ( ViewObject parent )

- ViewObject parent - The parent to place the new picture in. May also be a string containing the name of an existing ViewObject.

Creates a new picture and places it in the ViewObject parent.

#### Picture ( Window window )

- Window window - The window to place the new picture in. May also be a string containing the name of an existing Window.

Creates a new picture and places it in the Window window.

#### boolean load ( string url )

- string url - The URL to retrieve the image from.

Load an image from a give url. Returns true on success.

#### Image image

The raw image that is being displayed. You can take a copy of this, manipulate it, then set it back to change the image.

#### string url [Read-Only]

The URL of the image if it was loaded from a file and has not been modified.

#### number refreshTimer

A timer to automatically refresh the picture. Value of 0 means the timer is disabled. Units are in seconds.

## Class: Plot

This class represents a plot in Kst.

Inherits: BorderedViewObject

Collection class: PlotCollection

### Constructors:

- Plot ( window )

### Methods:

- createLegend ( )

### Properties:

- curves

- legend

- topLabel

- xAxis

- yAxis

- title

- tied

###

#### Plot ( Window window )

- Window window - The window to place the new plot in. May also be a string containing the name of an existing Window.

Creates a new plot and places it in the Window window.

#### Legend createLegend ( )

Creates a Legend for this plot. If a legend already exists then that one is returned.

#### CurveCollection curves [Read-Only]

A list of all the Curves used by the plot.

#### Legend legend [Read-Only]

The Legend for this plot. May be null.

#### string topLabel

The top label for this plot.

#### Axis xAxis [Read-Only]

The X-axis for this plot.

#### Axis yAxis [Read-Only]

The Y-axis for this plot.

#### PlotLabel title [Read-Only]

The title for this plot.

#### boolean tied

True if the plot zoom state is tied.

## Class: PlotCollection

An array of Plots.

Inherits: Collection

###

## Class: PlotLabel

A class representing a plot label.

### Properties:

- text

- font

- fontSize

- justification

- dataPrecision

###

#### string text

Contains the text contents of the label. This may include carriage returns (\n), scalar references of the form [scalar_name], and some basic LaTeX.

#### string font

Used to set or get the current font used for the label.

#### number fontSize

Contains the size of the font used to draw the label.

#### number justification

The horizontal justification for the label. This is a bit field. The values are as follows:

- 0 - Justify None

- 1 - Justify Left / Top

- 2 - Justify Right / Bottom

- 3 - Justify Center

#### number dataPrecision

Contains the number of digits of precision to display data values in the label. Restricted to a value between 0 and 16 inclusive.

## Class: Plugin

This class represents a data plugin in Kst. It can be instantiated to create a new instance of a plugin in the Kst data collection.

Inherits: DataObject

Collection class: PluginCollection

### Constructors:

- Plugin ( [module] )

### Methods:

- setInput ( index, input )

- validate ( )

### Properties:

- inputs

- outputs

- module

- lastError

- valid

###

#### Plugin ( [PluginModule module] )

- PluginModule module - The plugin module to use for this plugin.

  [OPTIONAL]

Main constructor for the Plugin class. New plugins are typically invalid until various properties have been set.

#### void setInput ( number index, Object input )

- number index - or name of the input argument to be set.

- Object input - argument.

Sets the input argument at the specified index or name.

#### void validate ( )

Validates the plugin.

#### ObjectCollection inputs

The list of inputs to the plugin.

#### ObjectCollection outputs

The list of outputs to the plugin.

#### PluginModule module

The library or module that is used for data processing by this plugin object.

#### string lastError [Read-Only]

A string containing details of the last error that occurred while running the plugin.

#### boolean valid [Read-Only]

True if this plugin object is valid. If false, there is probably an invalid setting somewhere that needs to be corrected before it can be used. Some errors include invalid inputs or outputs, or an invalid or missing PluginModule.

## Class: PluginCollection

An array of Plugins.

Inherits: Collection

###

## Class: PluginIO

An object representing an input or output for a given plugin module.

Collection class: PluginIOCollection

### Properties:

- name

- type

- subType

- typeObject

- description

- defaultValue

###

#### string name [Read-Only]

The name of the input or output.

#### string type [Read-Only]

The data type of the input or output.

#### string subType [Read-Only]

The sub-type of the input or output, if needed. For instance, a table may have a subtype of float.

#### string typeObject [Read-Only]

The object type of the input or output. The result will be one of:

- Vector

- Scalar

- String

- Unknown - error condition

#### string description [Read-Only]

A description of the meaning of the input or output.

#### string defaultValue [Read-Only]

The default value for this input or output, if specified by the plugin.

## Class: PluginIOCollection

An array of Plugin inputs or outputs.

Inherits: Collection

###

## Class: PluginManager

A reference to Kst's plugin manager subsystem.

### Constructors:

- PluginManager ( )

### Properties:

- modules

###

#### PluginManager ( )

Creates a new PluginManager referring to the Kst plugin manager.

#### PluginModuleCollection modules [Read-Only]

A list of all PluginModules available.

## Class: PluginModule

Represents a plugin module in Kst. This is not an instance of a plugin, but a reference to the actual plugin itself. It is typically used to instantiate a plugin object.

Collection class: PluginModuleCollection

### Properties:

- usesLocalData

- isFit

- isFilter

- name

- readableName

- author

- description

- version

- inputs

- outputs

###

#### boolean usesLocalData [Read-Only]

If true, the plugin makes use of persistant local storage.

#### boolean isFit [Read-Only]

If true, this plugin is a fit for a curve.

#### boolean isFilter [Read-Only]

If true, this plugin is a filter for a vector.

#### string name [Read-Only]

Represents the short name of the plugin.

#### string readableName [Read-Only]

Contains a long name for the plugin suitable for display in a user interface.

#### string author [Read-Only]

Contains the name of the author of the plugin.

#### string description [Read-Only]

Contains a text description of what the plugin is and/or does.

#### string version [Read-Only]

Contains the version number or string of the plugin.

#### PluginIOCollection inputs [Read-Only]

A list of all the inputs for the plugin.

#### PluginIOCollection outputs [Read-Only]

A list of all the outputs of the plugin.

## Class: PluginModuleCollection

An array of PluginModules.

Inherits: Collection

###

## Class: Point

Represents a cartesian co-ordinate of the form (x,y).

### Constructors:

- Point ( )

- Point ( x, y )

### Properties:

- x

- y

###

#### Point ( )

Creates a new point object with value (0.0, 0.0).

#### Point ( number x, number y )

- number x - The X value.

- number y - The Y value.

Creates a new point object with value (x, y).

#### number x

The value of the x co-ordinate.

#### number y

The value of the y co-ordinate.

## Class: PowerSpectrum

This class represents a power spectrum (PSD) object in Kst.

Inherits: DataObject

Collection class: PowerSpectrumCollection

### Constructors:

- PowerSpectrum ( vector, freq [, average [, len [, apodize [, removeMean]]]] )

### Properties:

- vector

- length

- output

- removeMean

- average

- apodize

- apodizeFn

- frequency

- xVector

- yVector

- vUnits

- rUnits

- interpolateHoles

###

#### PowerSpectrum ( Vector vector, number freq [, boolean average [, number len [, boolean apodize [, boolean removeMean]]]] )

- Vector vector - The vector to use as input to the power spectrum.

- number freq - The frequency for the power spectrum.

- boolean average -

  [OPTIONAL]

- number len - The base 2 logarithm of the length of the power spectrum. Should be an integer >= 4.

  [OPTIONAL]

- boolean apodize - If true, sharp discontinuities are removed.

  [OPTIONAL]

- boolean removeMean - True if the mean should be removed before performing the transform.

  [OPTIONAL]

Creates a new power spectrum (PSD) object in Kst. Units are V and Hz by default.

#### Vector vector

The input vector for the power spectrum.

#### number length

Contains the base 2 logarithm of the length to be used for interleaved averaging. Should be an integer >= 4.

#### number output

the normalization for the transform:

- 0 - amplitude spectral density

- 1 - power spectral density

- 2 - amplitude spectrum

- 3 - power spectrum

#### boolean removeMean

True if the mean should be removed before performing the transform.

#### boolean average

True if the power spectrum should be calculated using an interleaved average.

#### boolean apodize

If true, sharp discontinuities are removed.

#### number apodizeFn

The apodization function to be used in the case that apodize is true:

- 0 - default

- 1 - bartlett

- 2 - blackman

- 3 - connes

- 4 - cosine

- 5 - gaussian

- 6 - hamming

- 7 - hann

- 8 - welch

- 9 - uniform

#### number frequency

Contains the sampling rate of the power spectrum.

#### Vector xVector [Read-Only]

The X-axis vector for the power spectrum.

#### Vector yVector [Read-Only]

The Y-axi vector for the power spectrum.

#### string vUnits

A string containing the units for the vector.

#### string rUnits

A string containing the units for the rate.

#### boolean interpolateHoles

True if the transform should automatically interpolate over missing data values.

## Class: PowerSpectrumCollection

An array of PowerSpectrums.

Inherits: Collection

###

## Class: Scalar

Represents a scalar value (a number) in Kst.

Inherits: Object

Collection class: ScalarCollection

### Constructors:

- Scalar ( )

- Scalar ( value )

### Properties:

- value

###

#### Scalar ( )

Default constructor. Creates a new scalar with value 0.0.

#### Scalar ( number value )

- number value -

Creates a new scalar with the specified value.

#### number value

Used to access or modify the value of a scalar.

## Class: ScalarCollection

An array of Scalars.

Inherits: Collection

###

## Class: Size

Represents a two-dimensional size of the form (w, h).

### Constructors:

- Size ( )

- Size ( w, h )

### Properties:

- w

- h

###

#### Size ( )

Creates a new size object with value (0.0, 0.0).

#### Size ( number w, number h )

- number w - The width.

- number h - The height.

Creates a new size object with value (w, h).

#### number w

The width.

#### number h

The height.

## Class: Spectrogram

This class represents a spectrogram (CSD) object in Kst.

Inherits: DataObject

Collection class: SpectrogramCollection

### Constructors:

- Spectrogram ( vector, freq [, average [, len [, apodize [, removeMean]]]] )

### Properties:

- vector

- length

- output

- removeMean

- average

- apodize

- apodizeFn

- frequency

- matrix

- vUnits

- rUnits

- windowSize

- interpolateHoles

###

#### Spectrogram ( Vector vector, number freq [, boolean average [, number len [, boolean apodize [, boolean removeMean]]]] )

- Vector vector - The vector to use as input to the spectrogram.

- number freq - The frequency for the spectrogram.

- boolean average -

  [OPTIONAL]

- number len - The base 2 logarithm of the length of the power spectrum. Should be an integer >= 4.

  [OPTIONAL]

- boolean apodize - If true, sharp discontinuities are removed.

  [OPTIONAL]

- boolean removeMean - True if the mean should be removed before performing the transform.

  [OPTIONAL]

Creates a new power spectrum (PSD) object in Kst. Units are V and Hz by default.

#### Vector vector

The input vector for the spectrogram.

#### number length

Contains the base 2 logarithm of the length of the spectrogram. Should be an integer >= 4.

#### number output

the normalization for the transform:

- 0 - amplitude spectral density

- 1 - power spectral density

- 2 - amplitude spectrum

- 3 - power spectrum

#### boolean removeMean

True if the mean should be removed before performing the transform.

#### number average

#### boolean apodize

If true, sharp discontinuities are removed.

#### number apodizeFn

The apodization function to be used in the case that apodize is true:

- 0 - default

- 1 - bartlett

- 2 - blackman

- 3 - connes

- 4 - cosine

- 5 - gaussian

- 6 - hamming

- 7 - hann

- 8 - welch

- 9 - uniform

#### number frequency

Contains the sampling rate of the spectrogram.

#### Matrix matrix [Read-Only]

The matrix for the spectrogram.

#### string vUnits

A string containing the units for the vector.

#### string rUnits

A string containing the units for the rate.

#### number windowSize

The window size of the spectrogram.

#### boolean interpolateHoles

True if the transform should automatically interpolate over missing data values.

## Class: SpectrogramCollection

An array of Spectrograms.

Inherits: Collection

###

## Class: String

Represents a string in Kst. Note that this is not analagous to a string in JavaScript, and may not be directly interchanged as such. A Kst String is an object internal to Kst and is subject to update scheduling, sharing, and other policies of the Kst core. However the contents of a String may be manipulated with JavaScript string manipulation functions.

Inherits: Object

Collection class: StringCollection

### Constructors:

- String ( )

- String ( value )

### Properties:

- value

###

#### String ( )

Default constructor - creates an empty String.

#### String ( string value )

- string value -

Creates a new string with the specified value.

#### string value

The value of the String.

## Class: StringCollection

An array of Kst Strings.

Inherits: Collection

###

## Class: TimeInterpretation

A class representing a time interpretation. It is used to convert values from one set of units to display in another.

### Properties:

- active

- axisType

- input

- output

###

#### boolean active

True if the axis is being interpreted.

#### string axisType [Read-Only]

The type of axis this interpretation applies to.

#### number input

The format of the input to the interpretation. Must be one of:

- 0 - Standard C Time

- 1 - TAI

- 2 - JD

- 3 - MJD

- 4 - RJD

- 5 - JY

- 6 - TAI (ns)

- 7 - TAI (2^-16s)

#### number output

The format to convert the interpretation to. Must be one of:

- 0 - DD/MM/YY HH:MM:SS

- 1 - YY/MM/DD HH:MM:SS

- 2 - JD

- 3 - MJD

- 4 - RJD

- 5 - JY

- 6 - Localized Short Date

- 7 - Localized Long Date

## Class: Vector

Represents a vector of any type in Kst. Some vectors are editable, while others are not. This class behaves just as a JavaScript array, but has additional properties and methods.

Inherits: Object

Collection class: VectorCollection

### Constructors:

- Vector ( )

- Vector ( array )

### Methods:

- resize ( size )

- interpolate ( i, n )

- zero ( )

- update ( )

- valueAt ( index )

### Properties:

- length

- min

- max

- mean

- numNew

- numShifted

- editable

- numNaN

- array

###

#### Vector ( )

Default constructor creates an empty, editable vector.

#### Vector ( Array array )

- Array array - The array to be copied.

Creates a vector that is a copy of array.

#### void resize ( number size )

- number size - The new size of the vector. Should be >= 2.

Resizes the vector.

- Throws: GeneralError - Throws this exception if the vector is not editable.

#### number interpolate ( number i, number n )

- number i - The sample number to obtain the interpolated value of.

- number n - The number of samples to interpolate to.

Interpolates the vector to n samples and returns the interpolated value of sample i.

#### void zero ( )

Sets all values in the vector to zero.

- Throws: GeneralError - Throws this exception if the vector is not editable.

#### void update ( )

Updates the statistical values associated with a vector.

- Throws: GeneralError - Throws this exception if the vector is not editable.

#### void valueAt ( number index )

- number index - The sample number to obtain the value of. A negative value of -n returns the n'th sample from the end of the vector..

Returns the value at the given index.

#### number length [Read-Only]

The number of samples in the vector.

#### number min [Read-Only]

The value of the smallest sample in the vector.

#### number max [Read-Only]

The value of the largest sample in the vector.

#### number mean [Read-Only]

The mean value of all samples in the vector.

#### number numNew [Read-Only]

#### number numShifted [Read-Only]

#### number editable [Read-Only]

True if the vector is editable by the user. This should be checked before attempting to modify a vector in any way.

#### number numNaN [Read-Only]

The number of NaN values in the vector.

#### Array array [Read-Only]

The vector as an Array.

## Class: VectorCollection

An array of Vectors.

Inherits: Collection

###

## Class: VectorView

Represents a vectorView.

Inherits: DataObject

### Constructors:

- VectorView ( x, y )

### Properties:

- xVector

- yVector

- flagVector

- xMin

- xMax

- yMin

- yMax

- useXMin

- useXMax

- useYMin

- useYMax

- interpolateTo

###

#### VectorView ( Vector x, Vector y )

- Vector x - The x-vector.

- Vector y - The y-vector.

Creates a new vector view with the given x-vector and y-vector.

#### Vector xVector

the x-vector.

#### Vector yVector

the y-vector.

#### Vector flagVector

the flag-vector. Those points corresponding to non-zero values of the flag vector are removed from the output vectors.

#### Scalar xMin

the value for the minimum x-value for the view range.

#### Scalar xMax

the value for the maximum x-value for the view range.

#### Scalar yMin

the value for the minimum y-value for the view range.

#### Scalar yMax

the value for the maximum y-value for the view range.

#### boolean useXMin

If true, the minimum x-value is respected.

#### boolean useXMax

If true, the maximum x-value is respected.

#### boolean useYMin

If true, the minimum y-value is respected.

#### boolean useYMax

If true, the maximum y-value is respected.

#### number interpolateTo

the value for the maximum y-value for the view range. Must be one of:

- 0 - interpolate to the x-vector

- 1 - interpolate to the y-vector

- 2 - interpolate to the high resolution vector

- 3 - interpolate to the low resolution vector

## Class: ViewObject

Represents any object in a Kst window. This is an abstract object and may not be instantiated directly.

Inherits: Object

Collection class: ViewObjectCollection

### Methods:

- resize ( size )

- move ( pos )

- findChild ( pos )

- convertTo ( type )

- raiseToTop ( )

- lowerToBottom ( )

- raise ( )

- lower ( )

- remove ( )

### Properties:

- position

- size

- transparent

- onGrid

- columns

- color

- backgroundColor

- maximized

- minimumSize

- type

- children

###

#### ViewObject resize ( Size size )

- Size size - The new size for the object.

Resizes the object to the given size, if possible.

#### ViewObject move ( Point pos )

- Point pos - The position to move the object to.

Moves the object to a new position, if possible.

#### ViewObject findChild ( Point pos )

- Point pos - The relative position to search.

Finds the topmost child of this view object at the given point. Returns null if there is no child there.

#### ViewObject convertTo ( string type )

- string type - The type to attempt to convert this object to.

Attempts to convert this ViewObject to a different type. The object must be derived from this type at some level. Null is returned if it is not possible to convert to the requested type.

#### void raiseToTop ( )

Raises the object to the top of the z-order.

#### void lowerToBottom ( )

Lowers the object to the bottom of the z-order.

#### void raise ( )

Raises the object one place in the z-order.

#### void lower ( )

Lowers the object one place in the z-order.

#### void remove ( )

Deletes the object.

#### Point position

The location of the object relative to its parent.

#### Size size

The size of the object in pixels.

#### boolean transparent

True if this object is transparent. Not all objects support transparency.

#### boolean onGrid

True if the children of this object are on a grid.

#### number columns

The number of columns the children are organized into. If this value is modified, onGrid is set to true.

#### string color

The foreground color for this object.

#### string backgroundColor

The background color for this object.

#### boolean maximized

If true, this object is maximized relative to its parent. This is a temporary state whereby the plot uses all the space available in the parent but can be restored to normal size again.

#### Size minimumSize [Read-Only]

The minimum size of the view object.

#### string type [Read-Only]

A string containing the type of this view object.

#### ViewObjectCollection children [Read-Only]

The list of all children of this view object in z-order from the furthest back to the closest to the top. This is a reference to a collection which may be modified, but cannot be set.

## Class: ViewObjectCollection

An array of ViewObjects.

Inherits: Collection

###

## Class: Window

An object that represents a reference to a Kst window or tab.

Collection class: WindowCollection

### Constructors:

- Window ( [name] )

### Methods:

- repaint ( )

- close ( )

### Properties:

- name

- plots

- view

- columns

###

#### Window ( [string name] )

- string name - A name for the new window.

  [OPTIONAL]

Creates a new window and object to refer to it.

#### void repaint ( )

Repaints the window.

#### void close ( )

Closes the window.

#### string name

The name of the window this object refers to.

#### PlotCollection plots

The list of plots contained in this window, flattened.

#### ViewObject view

The view object for this window.

#### number columns

The number of columns the children are organized into. If this value is modified, onGrid is set to true.

## Class: WindowCollection

An array of Kst Windows.

Inherits: Collection

###