SimplePlot class

This class allows you to display one or several arrays as polylines (curves) inside the browser, along with coordinate axes and a a coordinate grid, an some title text. It is recommended to use this class if a plot needs to be generated with a few lines of code, rather than exploitimg the full capabilities of the classes Polyline, Axis, Legend for more complex layouts.

Constructors

SimplePlot(List<Float64List> arrays, DivElement plotDiv, List<Map<PyA, String>> plotAttr, Map<AxA, String> xaxisAttr, Map<AxA, String> yaxisAttr, Map<LegA, String> legendAttr, List<String> poly_colors)
Plots arrays as polylines (curves), along with coordinate axes, a coordinate grid and legend text. plotDiv - the html DivElement that will contain the plot. plotAttr - plot attributes controlling the appearance and layout of the polylines. If null, internal defaults are used. xaxisAttr - x axis attributes controlling the appearance and layout of the x (horizontal) coordinate axis. If null, internal defaults are used. yaxisAttr - y axis attributes controlling the appearance and layout of the y (vertical) coordinate axis. If null, internal defaults are used. legendAttr - attributes controlling the appearance and layout of the text legend. If null, internal defaults are used. poly_colors - these are the color in which arrays get displayed. This list may be bigger than the list a arrays, but not smaller. If null, internal default colors are used. See the example provided with this package how simple is it is to generate the plot. NOTE 1: Displaying more than a single array only makes sense if the value ranges in the different arrays are commensurable, otherwise a simultaneous plot is not meaningful. NOTE 2: The sizes of the arrays may be different. The width of the plot is computed from plotDiv.

Properties

arrays ↔ List<Float64List>
The arrays to be plotted
read / write
dataArea ↔ SvgSvgElement
All graphics is drawn using SVG Scalable Vector Graphics. plotArea is added to plotDiv and contains the entire plot. dataArea is added to plotArea and contains the polylines and the legend. The axes are drawn outside the dataArea but within the plotArea.
read / write
dataAreaBorder ↔ RectElement
A frame around the 'dataArea'.
read / write
dataAreaRect ↔ Rectangle<int>
The coordinates with respect to their container
read / write
dataInsets ↔ Rectangle<int>
The coordinates with respect to their container
read / write
legend Legend
read / write
legendAttr ↔ Map<LegA, String>
read / write
plotArea ↔ SvgSvgElement
All graphics is drawn using SVG Scalable Vector Graphics. plotArea is added to plotDiv and contains the entire plot. dataArea is added to plotArea and contains the polylines and the legend. The axes are drawn outside the dataArea but within the plotArea.
read / write
plotAreaRect ↔ Rectangle<int>
The coordinates with respect to their container
read / write
plotAttr ↔ List<Map<PyA, String>>
read / write
plotDiv ↔ DivElement
plotDiv will contain the graphics, it's size must be as wished by the user.
read / write
POLY_COLORS → List<String>
final
poly_colors ↔ List<String>
read / write
polylines ↔ List<Polyline>
read / write
xaxis Axis
The axes
read / write
xaxisAttr ↔ Map<AxA, String>
read / write
xaxisRect ↔ Rectangle<int>
The coordinates with respect to their container
read / write
yaxis Axis
The axes
read / write
yaxisAttr ↔ Map<AxA, String>
read / write
yaxisRect ↔ Rectangle<int>
The coordinates with respect to their container
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

computeLayout() → void
Computes the plot layout: Sets up the graphics containers and their relative coordinates and sizes.
createAxes(Polyline polyline) → void
Create an x and a y axis for polyline.
createPolylines() → dynamic
Creates a polyline for each element of arrays
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Methods

createLegend(Map<LegA, String> legendAttr, List<String> poly_colors) Legend
Creates a legend from legendAttr. poly_colors, if not null, draws colored subtitle rectangles if there are subtitles specified in legendAttr.