Library: Timeplot
Overview
Timeplot
- desc: Timeplot
Constructors
This is the implementation of the Timeplot object.
parameters
elmt | ||
plotInfos |
methods
Functions
Create a timeplot attached to the given element and using the configuration from the given array of PlotInfos
parameters
elmt | ||
plotInfos |
Create a PlotInfo configuration from the given map of params
parameters
params |
Timeplot._Impl.getElement()
Returns the main container div this timeplot is operating on.
Timeplot._Impl.getDocument()
Returns document this timeplot belongs to.
Add a painter to the timeplot
parameters
layerName | ||
painter |
Remove a painter from the timeplot
parameters
layerName | ||
painter |
Timeplot._Impl.getWidth()
Get the width in pixels of the area occupied by the entire timeplot in the page
Timeplot._Impl.getHeight()
Get the height in pixels of the area occupied by the entire timeplot in the page
Timeplot._Impl.getCanvas()
Get the drawing canvas associated with this timeplot
Load the data from the given url into the given eventSource, using the given separator to parse the columns and preprocess it before parsing thru the optional filter function. The filter is useful for when the data is row-oriented but the format is not compatible with the one that Timeplot expects.
Here is an example of a filter that changes dates in the form 'yyyy/mm/dd' in the required 'yyyy-mm-dd' format:
var dataFilter = function(data) { for (var i = 0; i < data.length; i++) { var row = data[i]; row[0] = row[0].replace(/\//g,"-"); } return data; };
parameters
url | ||
separator | ||
eventSource | ||
filter |
Load event data from the given url into the given eventSource, using
the Timeline XML event format.
parameters
url | ||
eventSource |
Overlay a 'div' element filled with the given text and styles to this timeplot
This is used to implement labels since canvas does not support drawing text.
parameters
id | ||
text | ||
clazz | ||
styles |
Overlay a 'div' element, with the given class and the given styles to this timeplot.
This is used for labels and horizontal and vertical grids.
parameters
id | ||
clazz | ||
styles |
Associate the given map of styles to the given element.
In case such styles indicate position (left,right,top,bottom) correct them
with the padding information so that they align to the 'internal' area
of the timeplot.
parameters
div | ||
styles |
return a {x,y} map with the location of the given element relative to the 'internal' area of the timeplot
(that is, without the container padding)
parameters
div |
Timeplot._Impl.update()
Forces timeplot to re-evaluate the various value and time geometries
associated with its plot layers and repaint accordingly. This should
be invoked after the data in any of the data sources has been
modified.
Timeplot._Impl.repaint()
Forces timeplot to re-evaluate its own geometry, clear itself and paint.
This should be used instead of paint() when you're not sure if the
geometry of the page has changed or not.
Timeplot._Impl.paint()
Calls all the painters that were registered to this timeplot and makes them
paint the timeplot. This should be used only when you're sure that the geometry
of the page hasn't changed.
NOTE: painting is performed by a different thread and it's safe to call this
function in bursts (as in mousemove or during window resizing
Objects