Purpose

The module Diagram2D displays 2D curves, such as time series, gray scale profiles, histograms, etc.

Usage

The Diagram2D module reads the input data from its inCurveList field, accepting objects of type ml::CurveData or ml::CurveList.

These curve data objects specify the X- and Y-data to plot, the curve types and optionally a style index to be used in conjunction with a StylePalette module.

Also, if a LUT is attached to the module's LUT input and the min/max values of the diagram and the LUT are synchronized, the curve can be colored according to the attached LUT. The example network features an attached LUT.

All curves are drawn in a common coordinate system.

Details

The following features are available:

  • Plot multiple curves in a single diagram
  • Automatic selection of axis ranges and tick labels
  • Arbitrary axis directions
  • Support for line, scatter, area and error bar plots
  • Various line styles and marker types
  • Optional usage of a style palette for automatic selection of colors, line styles and marker types
  • Handling of mouse events in the diagram area, detection of curve or point hit by mouse event

Input Fields

inStylePalette

name: inStylePalette, type: MLBase, deprecated name: inputStylePalette

Connect an optional StylePalette module.

inCurveList

name: inCurveList, type: MLBase, deprecated name: inputCurves

Accepts a CurveData or a CurveList object.

inLUT

name: inLUT, type: MLBase

Output Fields

outNode

name: outNode, type: SoNode, deprecated name: outputDiagram

Insert the Diagram2D module into an Open Inventor scene.

Parameter Fields

Field Index

alt: Enum Labels (drawLabelsX): Bool Shift: Enum
Auto (autoRangeX): Bool Labels (drawLabelsY): Bool Ticks (drawTicksX): Bool
Auto (autoRangeY): Bool Line Style: Enum Ticks (drawTicksY): Bool
Auto (autoBorderH): Bool Line Width: Integer Title (drawAxisTitleX): Bool
Auto (autoBorderV): Bool LUT Along Axis: Enum Title (drawAxisTitleY): Bool
Axis (drawAxisX): Bool Marker Size: Integer Tolerance: Integer
Axis (drawAxisY): Bool Marker Type: Enum Use: Bool
Axis Color: Color Mask Valid: Bool Use anti-aliasing: Bool
Border: Hor.: Integer Maximum (maxX): Float Valid: Bool
Button 1: Enum Maximum (maxY): Float Vert.: Integer
Button 2: Enum Object: Enum X-Title: String
Button 3: Enum Opacity: Float X: Minimum: Float
Ctrl: Enum Point: Integer Y: Float
Curve: Integer Pos. X: Float Y-Title: String
Curve Color: Color Released: Trigger Y: Minimum: Float
Diagram Title: String Rotation: Enum  
Index: Integer Series: Integer  

Visible Fields

X: Minimum

name: minX, type: Float, default: 0, deprecated name: XMin

Sets the lower bound of the diagram's X-range.

Maximum (maxX)

name: maxX, type: Float, default: 1, deprecated name: XMax

Sets the upper bound of the diagram's X-range.

Auto (autoRangeX)

name: autoRangeX, type: Bool, default: TRUE, deprecated name: AutoXRange

If checked, the X-range is determined automatically from the curve data, and the range values are updated in the minimum and maximum fields.

Y: Minimum

name: minY, type: Float, default: 0, deprecated name: YMin

Sets the lower bound of the diagram's Y-range.

Maximum (maxY)

name: maxY, type: Float, default: 1, deprecated name: YMax

Sets the upper bound of the diagram's Y-range.

Auto (autoRangeY)

name: autoRangeY, type: Bool, default: TRUE, deprecated name: AutoYRange

If checked, the Y-range is determined automatically from the curve data, and the range values are updated in the minimum and maximum fields.

Axis Color

name: axisColor, type: Color, default: 1 1 1

Sets the color of the axes.

Rotation

name: axisRotation, type: Enum, default: LeftBottom

Defines the orientation of the X- and Y-axes.

The entries in the Rotation enum correspond to the position of the coordinate system's origin and the direction of the X- and Y-axis, respectively.

Values:

Title Name
Left-Bottom LeftBottom
Right-Bottom RightBottom
Left-Top LeftTop
Right-Top RightTop
Bottom-Left BottomLeft
Bottom-Right BottomRight
Top-Left TopLeft
Top-Right TopRight

Use

name: drawDiagramTitle, type: Bool, default: FALSE

If checked, the Diagram Title is drawn.

Diagram Title

name: diagramTitleString, type: String

Sets a title string for the diagram.

Border: Hor.

name: borderH, type: Integer, default: 0

Sets the size of the horizontal border.

Auto (autoBorderH)

name: autoBorderH, type: Bool, default: TRUE

If checked, the horizontal border size is determined automatically.

Vert.

name: borderV, type: Integer, default: 0

Sets the size of the vertical border.

Auto (autoBorderV)

name: autoBorderV, type: Bool, default: TRUE

If checked, the vertical border size is determined automatically.

Axis (drawAxisX)

name: drawAxisX, type: Bool, default: TRUE

If checked, the X-axis is drawn.

Ticks (drawTicksX)

name: drawTicksX, type: Bool, default: TRUE

If checked, the ticks along the X-axis are drawn.

Labels (drawLabelsX)

name: drawLabelsX, type: Bool, default: TRUE

If checked, the labels along the X-axis are drawn.

Title (drawAxisTitleX)

name: drawAxisTitleX, type: Bool, default: FALSE

If checked, the title of the X-axis is drawn.

X-Title

name: axisTitleStringX, type: String, default: X [dn]

Sets the title string of the X-axis.

Axis (drawAxisY)

name: drawAxisY, type: Bool, default: TRUE

If checked, the Y-axis is drawn.

Ticks (drawTicksY)

name: drawTicksY, type: Bool, default: TRUE

If checked, the ticks along the Y-axis are drawn.

Labels (drawLabelsY)

name: drawLabelsY, type: Bool, default: TRUE

If checked, the labels along the Y-axis are drawn.

Title (drawAxisTitleY)

name: drawAxisTitleY, type: Bool, default: FALSE

If checked, the title of the Y-axis is drawn.

Y-Title

name: axisTitleStringY, type: String, default: Y [dn]

Sets the title string of the Y-axis.

Curve Color

name: curveColor, type: Color, default: 1 1 1

Sets the color of the curves.

Line Style

name: lineStyle, type: Enum, default: Solid

Defines the line style of the curves.

Values:

Title Name
None None
Solid Solid
Dashed Dashed
Dotted Dotted

Marker Type

name: markerType, type: Enum, default: None

Sets the type of the curve markers.

Values:

Title Name
None None
Dot Dot
Asterisk Asterisk
Circle Circle
Square Square
Triangle Triangle
Plus Plus
Cross Cross

Marker Size

name: markerSize, type: Integer, default: 10

Sets the size of the curve markers.

Opacity

name: areaOpacity, type: Float, default: 0.5, minimum: 0, maximum: 1

Sets the opacity of the areas under the curves.

Line Width

name: lineWidth, type: Integer, default: 1, minimum: 0

Sets the line widths of the curves.

Use anti-aliasing

name: antiAlias, type: Bool, default: FALSE

If checked, the curves are rendered with anti-aliasing.

Button 1

name: button1, type: Enum, default: IGNORED

Defines which state of the first mouse button triggers an interaction.

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED

Button 2

name: button2, type: Enum, default: IGNORED

Defines which state of the second mouse button triggers an interaction.

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED

Button 3

name: button3, type: Enum, default: IGNORED

Defines which state of the third mouse button triggers an interaction.

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED

Shift

name: shift, type: Enum, default: IGNORED

Defines which state of the SHIFT key triggers an interaction.

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED

Ctrl

name: ctrl, type: Enum, default: IGNORED

Defines which state of the CTRL key triggers an interaction.

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED

Pos. X

name: mousePosX, type: Float, default: 0

Shows the X-position in curve coordinates of the mouse cursor while the last valid interacion took place.

Y

name: mousePosY, type: Float, default: 0

Shows the Y-position in curve coordinates of the mouse cursor while the last valid interacion took place.

Valid

name: mousePosValid, type: Bool, default: FALSE

Shows whether the fields Pos. X and Y contain valid values.

Object

name: curveSelection, type: Enum, default: Diagram

Defines whether all events in the diagram area should be recognized (selection Diagram), or only events that coincide with a data curve or point (selection Curve or Point, resp.).

If Object is set to Curve or Point, the fields Curve, Series and Point (if Object is set to Point) identify the curve and the data series and point within that curve where the event has appeared.

The value -1 in any of these fields indicates that no curve or point has been hit.

Values:

Title Name
Diagram Diagram
Curve Curve
Point Point

Tolerance

name: selectionTolerance, type: Integer, default: 5

Sets the the pixel tolerance used for curve and point selection.

Curve

name: selectedCurve, type: Integer, default: -1

Shows the id of the selected curve or -1 if no curve was selected.

Series

name: selectedSeries, type: Integer, default: -1

Shows the id of the selected series or -1 if no curve was selected.

Index

name: selectedSeriesGlobal, type: Integer, default: -1

Shows the series index of the selected data series taken over all series and curves.

Point

name: selectedPoint, type: Integer, default: -1

Shows the id of the selected point or -1 if no curve was selected.

Mask Valid

name: maskValid, type: Bool, default: FALSE

Shows whether the conditions defined in the Buttons section are currently fulfilled.

Released

name: released, type: Trigger

This field is touched if the Mask Valid state changes from checked to unchecked.

Hence, the Released field can be connected to other fields in a network in order to initiate some action if a mouse position is set.

LUT Along Axis

name: colorAlongWhichAxis, type: Enum, default: LUTColorYAxis

Defines along which axis the optionally attached LUT colors the graph.

Values:

Title Name
XAxis LUTColorXAxis
YAxis LUTColorYAxis

Hidden Fields

alt

name: alt, type: Enum, default: IGNORED

Values:

Title Name
Pressed PRESSED
Released RELEASED
Ignored IGNORED