FluidPlotter:
Filter:
FluCoMa/Classes (extension) | Libraries > FluidCorpusManipulation

FluidPlotter
ExtensionExtension

A view for plotting data

Description

FluidPlotter is a viewer for plotting data.

Holding option/alt and clicking and dragging over a section of the plotter will zoom into that space. Hold control and click to return to the original x and y ranges.

Class Methods

.new

Creates a new instance of FluidPlotter

Arguments:

parent

A parent view to embed the FluidPlotter in. If no parent is passed, FluidPlotter will create a window for itself at the given bounds. To create a view without parent and bounds (e.g. for GUIs with Layout Management), see the standalone argument below.

bounds

Where to show the FluidPlotter, either within the parent or on the screen (if no parent is passed).

dict

A Dictionary from a FluidDataSet dump method (or a similarly formatted Dictionary) that contains the data to be plotted.

mouseMoveAction

A function to execute on mouse down or mouse drag. This funtion is passed the view (itself), x position (scaled according to the xmin and xmax arguments of FluidPlotter), y position (scaled according to the ymin and ymax arguments of FluidPlotter), modifiers, button number, and click count. The last two arguments are only useful on mouse down, not on mouse drag.

xmin

Minimum of the X range to display. Default is 0.

xmax

Maximum of the X range to display. Default is 1.

ymin

Minimum of the Y range to display. Default is 0.

ymax

Maximum of the Y range to display. Default is 1.

standalone

If false, creates a View without parent or bounds, so that it can be used as part of a larger GUI, e.g. with Layout Management.

Returns:

An instance of FluidPlotter

Instance Methods

.background

Set the background Color.

.pointSize

Set the size of a specific point.

Arguments:

identifier

Which point to set the size of.

size

What size the point should be. This is a multiplier applied to the default point size which is 6 pixels. A point size of "2" will render a point with a diameter of 12 pixels. A point size of "0.5" will render a point with a diameter of 3 pixels.

.refresh

Refresh the UserView inside the FluidPlotter.

.xmin

Set xmin property and refresh the plotter.

.xmax

Set xmax property and refresh the plotter.

.ymin

Set ymin property and refresh the plotter.

.ymax

Set ymax property and refresh the plotter.

.zoomxmin

Get the x lower bound of the current zoom.

.zoomxmax

Get the x upper bound of the current zoom.

.zoomymin

Get the y lower bound of the current zoom.

.zoomymax

Get the y upper bound of the current zoom.

.addPoint

Manually add a single point to the FluidPlotter. Similar to the addPoint method of FluidDataSet, addPoint_ will not overwrite a point that already exists at the given identifier. Instead, a warning will be thrown.

Arguments:

identifier

The identifier associated with this point.

x

X position of the point.

y

Y position of the point.

color

What Color to make the point. If nothing is provided the point will default to Color.black.

size

What size to make the point. This is a multiplier that modifies the default point size of 6 pixels. The default is 1. See pointSize method above.

.setPoint

Similar to the setPoint method of FluidDataSet, setPoint_ will add a new point to the FluidPlotter. If a point already exists at the given identifier, it will be overwritten.

Arguments:

identifier

The identifier associated with this point.

x

X position of the point.

y

Y position of the point.

color

What Color to make the point. If nothing is provided the point will default to Color.black.

size

What size to make the point. This is a multiplier that modifies the default point size of 6 pixels. The default is 1. See pointSize method above.

.highlight

Increase the size of points to make them more salient.

Arguments:

identifier

The identifier of the point to make salient. An array of identifiers will highlight them all. If nil is passed, current highlighted points will be return to normal.

.dict

Set a new Dictionary of points. Overwrites all previous points and Dictionaries.

Arguments:

d

.shape

Change the shape of the points, the options are \circle or \square. The default is \circle.

Arguments:

sh

(describe argument here)

.pointSizeScale

Scale all the points by a multiplier. See pointSize_ method above. The default is 1.

Arguments:

ps

(describe argument here)

.close

Close the plotter and/or its parent.

.pointColor

Change the Color of a point.

Arguments:

identifier

Identifier of the point to change the color of.

color

The Color to change the point to.

.parent

Returns:

The parent View of the FluidPlotter

.categories

Set categories to display as colors.

Arguments:

labelSetDict

This must be a Dictionary from a FluidLabelSet dump method, or a similarly formatted Dictionary.

Examples