Skip to main content
Version: V3 (Ignition 8.3)

OEE Swimlane

Overview​

The OEE Swimlane component draws OEE state and mode records as colored ribbons on a shared timeline, one lane per location, with a shared zoom slider and a crosshair tooltip that reports every lane at the cursor's time. It is the chart behind the States Swimlane line dashboard.

Each lane can also carry an overlay: a line drawn across its States ribbon, either the built-in production and expected production counts or a custom series such as a tag's history. The two production lines share one axis and can be drawn together, and so can custom series that share an axis group (see Overlay Series).

The gear button in the top-right corner lets the session user switch rows and overlays on and off without the view changing anything. The showStates, showModes, showPerformance and showExpectedProduction props, and each overlay's enabled flag, set what the chart starts with. Changing showStates or showModes later resets the States and Modes rows to their props. Changing showPerformance or showExpectedProduction resets the production lines and the overlays to the props, since those decide which overlays can be drawn. Changing an overlay's enabled flag from off to on later checks that overlay the way the user would in the gear menu (see Overlay Series), and from on to off unchecks it. Any other change to overlaySeries (new samples, lanes added or removed) leaves the user's choices alone.

Props​

The OEE Swimlane component has the following props:

Prop NameTypeDescriptionInput/Output
locationPathsarray[string]The paths of the locations to draw, one lane each, from top to bottom.Input
startDatenumberThe start of the time window, in epoch milliseconds.Input
endDatenumberThe end of the time window, in epoch milliseconds.Input
showStatesbooleanDraws the States ribbon. Defaults to true.Input
showModesbooleanDraws the Modes ribbon. Defaults to false.Input
showPerformancebooleanDraws the Production line, the production count. Defaults to false.Input
showExpectedProductionbooleanDraws the Expected Production line, a dashed grey line on the Production line's axis. Defaults to false.Input
showLocationLabelbooleanShows each lane's location name on the left. Defaults to true.Input
showRowLabelsbooleanShows the row label (States, Modes, or the overlay's name) when a lane has a single row. Lanes with more than one row always show labels.Input
statesLabelstringRenames the States row, its gear-menu entry and its tooltip prefix. Empty uses the built-in label.Input
modesLabelstringRenames the Modes row, its gear-menu entry and its tooltip prefix. Empty uses the built-in label.Input
productionLabelstringRenames the Production line, its gear-menu entry, its shared-axis heading and its tooltip prefix. Empty uses the built-in label.Input
expectedProductionLabelstringRenames the Expected Production line, its gear-menu entry and its tooltip prefix. Empty uses the built-in label.Input
productionNumberFormatstringThe number format of the Production and Expected Production counts. Defaults to 0,0.00. See Number Format.Input
overlaySeriesarray[object]Custom overlay lines. See Overlay Series.Input
rowHeightnumber or nullHeight in px of every row (States, Modes or an overlay row) of every lane. Leave empty (null) to let the rows share the component's height. When set, every row is exactly this tall, the lanes and the zoom slider stack from the top, unused height stays empty and lanes that do not fit are cut off. See Size and Layout. Defaults to empty.Input

Events​

The OEE Swimlane component emits the following events:

Event NameDescriptionPayload
onClickEmitted when a state or mode ribbon is clicked.{ id: string, type: string }, where id is the clicked record's ID and type is states or modes.
onRightClickEmitted when a state ribbon is right-clicked.{ state: object, production: object }, the state record and the production record active at the state's start time. production is null when that lane is drawing neither the Production nor the Expected Production line, or no production record covers that time.

Overlay Series​

An overlay is a line drawn across a lane's States ribbon, on a value axis at the right-hand edge. The tooltip shows the overlay's value at the cursor. When the States row is hidden, the overlay moves onto the Modes ribbon instead; only when both are hidden is it drawn on a row of its own, labelled with the overlay's name.

Production and Expected Production​

Two overlays are built in, drawn from the OEE production records the chart already loads, so they need no binding:

  • Production (showPerformance) is a solid blue step line of each production record's count.
  • Expected Production (showExpectedProduction) is a dashed grey step line of each record's expected production count, so the gap between the two lines shows where production fell behind.

The two share one value axis, anchored at 0, and can be on at the same time. While Production is drawn, the tooltip reads Production: 1,200.00 / 1,500.00 pcs (80%), the count, the expected count and their ratio. While only Expected Production is drawn, it reads Expected Production: 1,500.00 pcs. With both the States and Modes rows hidden, the lane's overlay row is labelled Production, or Expected Production while that is the only one checked. productionLabel and expectedProductionLabel rename them, and productionNumberFormat sets how both counts are written (see Number Format).

One Value Axis Per Location​

Each lane has a single value axis, so a line speed is never squeezed onto the same scale as a temperature or a count. A lane shows one overlay at a time, unless the overlays share an axis group:

  • Overlays with the same axisGroup can be on together in a lane, drawn as several lines on one axis. Use this for values that belong on one scale, such as a line speed and its setpoint.
  • An overlay with an empty axisGroup (the default) shares its lane with no other overlay.
  • Production and Expected Production share one axis with each other, and with no other overlay.

Two overlays only share an axis when they name the same group. Matching units is not enough, since two values in the same units can sit on very different ranges.

Overlays checked togetherShare a lane?Result
Speed and Speed Setpoint, both axisGroup SpeedYesBoth drawn, on one axis
Speed (Speed) and Ambient Temp (empty axisGroup)YesOnly the one checked last is drawn
Speed (Speed) and Oven Temp (Temperature)YesOnly the one checked last is drawn
Speed on Line1 and Oven Temp on Line2NoBoth drawn, each on its own lane's axis
Production and Expected ProductionYesBoth drawn, on one axis
Production or Expected Production, and any other overlayYesOnly the one checked last is drawn

In the gear menu, Production, Expected Production and every overlay name are listed under Overlay. Production and Expected Production sit under a Shared axis: Production heading, and overlays that share an axis group are gathered under a Shared axis: <group> heading. Everything under one heading can be on at the same time. Checking an entry unchecks any other overlay that would share a lane with it on a different axis. So two overlays for different locations can always be on together, and two for the same location only when they share an axis group.

If the props switch on two overlays that share a lane on different axes, the first one wins, in gear-menu order: Production and Expected Production first, then the overlaySeries entries in order. The other starts unchecked.

Later on, changing an overlay's enabled flag from off to on works like checking it in the gear menu: the overlay is drawn, and any overlay that would share a lane with it on a different axis is unchecked, wherever it is in the list. Production and Expected Production are unchecked too. This is the view's latest word, so it wins over what the user checked earlier. Each overlay that is left out is logged to the browser console, and so is one that is hidden when the chart loads.

Overlay Properties​

Each overlaySeries entry has the following properties:

PropertyTypeDescription
namestringThe gear-menu entry, the row label and the tooltip prefix. Entries with the same name are switched on and off together, as one overlay. Empty uses Series N, N being the entry's position in the list.
locationPathstringThe location whose lane the series is drawn in, written as in locationPaths, or as the location's path or ID. Case, a leading or trailing slash and repeated slashes are ignored. Empty draws it in every lane. A location that matches no lane is logged to the browser console and never drawn.
enabledbooleanWhether the series is drawn when the chart loads. Defaults to true. Entries sharing a name share one switch, which starts on when any of them is enabled.
colorcolorThe line color. Defaults to #10b981.
lineTypestringline joins the samples directly, step holds each value until the next sample. Defaults to line.
unitsstringAppended to the value in the tooltip.
numberFormatstringThe number format of the value in the tooltip and on the value axis. Defaults to 0,0.00. A shared axis is labelled in its first line's format. See Number Format.
axisGroupstringOverlays with the same axisGroup can be on together in a lane, on one value axis. Empty (the default) shares the axis with no other overlay. Entries sharing a name must share an axisGroup, or the overlay shares with nothing. See Share a Value Axis.
minnumber or nullThe bottom of the value axis. Null scales the axis to the data. On a shared axis the lowest min wins, and the axis stretches to fit the data if any line on it leaves min null.
maxnumber or nullThe top of the value axis. Null scales the axis to the data. On a shared axis the highest max wins, and the axis stretches to fit the data if any line on it leaves max null.
dataarray or datasetThe samples to draw. See Data Formats.

Data Formats​

data accepts any of the following:

  • A list of [timestamp, value] pairs, for example [[1760620800000, 41.5], [1760620810000, 42.0]].
  • A list of objects, each with a t_stamp key and one value key. This is what a Tag History binding returns with its Value Format set to Document, keyed by the tag's alias. (t, time and timestamp are also recognized as the timestamp key, and a key named value is preferred as the value.)
  • A dataset with a t_stamp column and a value column, which is what a Tag History binding returns with its Value Format set to Dataset.

Timestamps can be epoch milliseconds or dates. A null value is drawn as a gap in the line, and the tooltip shows no value there. The samples do not need to be sorted.

Number Format​

Overlay values and production counts are written with a numeral-style pattern, the same style Perspective's Table columns and Numeric Entry Field use. Each overlaySeries entry has its own numberFormat, and productionNumberFormat covers both production lines. The format applies to the tooltip and to the labels on the value axis.

Pattern1234.521.567Meaning
0,0.001,234.5021.57Thousands grouped, two decimals always shown. The default.
0,0.[00]1,234.521.57Up to two decimals, shown only when nonzero.
0,0.##1,234.521.57The same as 0,0.[00], in Perspective's spelling.
0,0.0[0]1,234.521.57One decimal always shown, a second when nonzero.
0,01,23522Thousands grouped, rounded to a whole number.
0.01234.521.6No grouping, one decimal.
  • A comma in 0,0 groups thousands, each 0 after the point is a decimal that is always shown, and 0s in brackets, or trailing #s, are decimals shown only when they are nonzero.
  • The separators are always , for thousands and . for decimals, whatever the browser's locale.
  • Other numeral features, such as currency, percent or abbreviations ($0,0, 0%, 0.0a), are not supported. An unsupported pattern uses 0,0.00 and logs a warning in the browser console. An empty one uses 0,0.00 too.
  • The production efficiency in the tooltip, (80%), is always a whole percent.

Example: Overlay a Tag's History​

This example draws the history of a line-speed tag across a line's States ribbon. Both bindings below use the component's own startDate and endDate as the query window, so the series always covers the window the chart is showing and follows it when it changes.

First, add an entry to overlaySeries:

{
"name": "Line Speed",
"locationPath": "Enterprise/Site/Packaging/Line1",
"enabled": true,
"color": "#10b981",
"lineType": "line",
"units": "ppm",
"min": null,
"max": null,
"data": []
}

Then bind that entry's data property (overlaySeries[0].data) using one of the two options below.

Option 1: Tag History Binding​

The simplest option, with no scripting. Add a Tag History binding on data with these settings:

SettingValue
Tag PathsAlias Speed, path [default]Packaging/Line1/Speed
Time RangeHistorical
Start DatetoDate({this.props.startDate})
End DatetoDate({this.props.endDate})
Return FormatWide
Aggregation ModeAverage
Return SizeFixed, 500
Value FormatDocument (Dataset also works)

toDate() turns the component's epoch-millisecond window into the dates the binding expects. No transform is needed: the component reads the t_stamp column and the Speed column itself.

Option 2: Expression Structure Binding with a Script Transform​

Use this option when the tag path comes from a view parameter or another property, or when the values need processing before they are drawn. Add an Expression Structure binding on data, with Wait on all checked and these keys:

KeyExpression
tagPath{view.params.speedTagPath}
start{this.props.startDate}
end{this.props.endDate}

Then add a Script transform:

def transform(self, value, quality, timestamp):
tagPath, start, end = value['tagPath'], value['start'], value['end']
if not tagPath or not start or not end or start >= end:
return []
history = system.tag.queryTagHistory(
paths=[tagPath],
startDate=system.date.fromMillis(long(start)),
endDate=system.date.fromMillis(long(end)),
returnSize=500,
aggregationMode='Average',
returnFormat='Wide',
)
# A list of [timestamp in epoch milliseconds, value] pairs. A None value is drawn as a gap.
return [[history.getValueAt(row, 0).getTime(), history.getValueAt(row, 1)] for row in range(history.rowCount)]

Example: Build Every Overlay in One Binding​

Instead of a binding per entry, a single binding on overlaySeries itself can return the whole list. This suits a chart whose locations change at runtime, since each location gets its overlay without editing the view, and it fetches every tag's history in one query.

This example gives each location its own speed tag, found from the location's name, plus a plant-wide ambient temperature that the user can switch to from the gear menu. Add an Expression Structure binding on overlaySeries, with Wait on all checked and these keys:

KeyExpression
locations{this.props.locationPaths}
start{this.props.startDate}
end{this.props.endDate}

Then add a Script transform:

def transform(self, value, quality, timestamp):
locations, start, end = value['locations'], value['start'], value['end']
if not locations or not start or not end or start >= end:
return []

# One speed tag per location, named after the location's last path segment
# (.../Line1/Filler reads [default]Lines/Filler/Speed), plus one ambient temperature for every lane.
speedTags = ['[default]Lines/%s/Speed' % path.rstrip('/').split('/')[-1] for path in locations]
ambientTag = '[default]Plant/AmbientTemp'

# One query for every tag. In the Wide format, column 0 is the timestamp and each tag gets the
# next column, in the order of paths.
history = system.tag.queryTagHistory(
paths=speedTags + [ambientTag],
startDate=system.date.fromMillis(long(start)),
endDate=system.date.fromMillis(long(end)),
returnSize=500,
aggregationMode='Average',
returnFormat='Wide',
)
times = [history.getValueAt(row, 0).getTime() for row in range(history.rowCount)]

def samples(column):
return [[times[row], history.getValueAt(row, column)] for row in range(history.rowCount)]

overlays = []
for index, path in enumerate(locations):
overlays.append({
'name': 'Speed',
'locationPath': path,
'color': '#7c3aed',
'units': 'bpm',
'min': 0,
'data': samples(index + 1),
})
overlays.append({
'name': 'Ambient Temp',
'locationPath': '',
'enabled': False,
'color': '#0f766e',
'units': 'C',
'data': samples(len(locations) + 1),
})
return overlays
  • An entry only needs the properties it changes. Anything left out takes its default: enabled is true, lineType is line, and min and max scale to the data.
  • The binding runs again whenever the window or the locations change. The gear menu keeps the user's choices across those refreshes, including when lanes are added or removed: only an overlay that is new, or whose enabled flag the binding changed, switches to match its flag.
  • Do not combine this with per-entry bindings such as overlaySeries[0].data: the binding on the whole list replaces the entries they would write into.

Example: Share a Value Axis​

This example draws a line's speed and its speed setpoint as two lines on one axis, so the gap between them reads directly. Give both entries the same axisGroup:

[
{
"name": "Speed",
"locationPath": "Enterprise/Site/Packaging/Line1",
"axisGroup": "Speed",
"color": "#7c3aed",
"units": "bpm",
"min": 0,
"data": []
},
{
"name": "Speed Setpoint",
"locationPath": "Enterprise/Site/Packaging/Line1",
"axisGroup": "Speed",
"color": "#f59e0b",
"lineType": "step",
"units": "bpm",
"data": []
}
]

Bind each entry's data as in Overlay a Tag's History. The gear menu then reads:

Overlay
Shared axis: Production
[ ] Production
[ ] Expected Production
Shared axis: Speed
[x] Speed # Speed and Speed Setpoint share the "Speed" axis group,
[x] Speed Setpoint # so they are listed together and can both stay checked
  • Both are listed under the group's heading in the gear menu and can be checked together. Checking Production or Expected Production, or an overlay on another axis that also draws in Line1's lane, unchecks both.
  • The axis starts at 0, from Speed's min, and its top scales to whichever line runs higher.
  • The tooltip lists both values, each with a dot in its line's color.
  • With both the States and Modes rows hidden, the lane's overlay row is labelled Speed, the axis group. While only one of the two is checked, it is labelled with that overlay's name.

For Every Location in One Binding​

The same pair can be built for every lane by the single binding from Build Every Overlay in One Binding: query each location's setpoint tag alongside its speed tag, and give both entries the same axisGroup. The ambient temperature keeps an empty axisGroup, so checking it still swaps out the speed lines rather than squeezing a temperature onto their scale.

def transform(self, value, quality, timestamp):
locations, start, end = value['locations'], value['start'], value['end']
if not locations or not start or not end or start >= end:
return []

# Per location, a speed and a setpoint tag named after the location's last path segment
# (.../Line1/Filler reads [default]Lines/Filler/Speed and .../SpeedSetpoint).
names = [path.rstrip('/').split('/')[-1] for path in locations]
speedTags = ['[default]Lines/%s/Speed' % name for name in names]
setpointTags = ['[default]Lines/%s/SpeedSetpoint' % name for name in names]
ambientTag = '[default]Plant/AmbientTemp'

# Wide format: column 0 is the timestamp, then one column per tag in the order of paths, so
# location i's speed is column i + 1, its setpoint column n + i + 1, and the ambient column 2n + 1.
history = system.tag.queryTagHistory(
paths=speedTags + setpointTags + [ambientTag],
startDate=system.date.fromMillis(long(start)),
endDate=system.date.fromMillis(long(end)),
returnSize=500,
aggregationMode='Average',
returnFormat='Wide',
)
times = [history.getValueAt(row, 0).getTime() for row in range(history.rowCount)]

def samples(column):
return [[times[row], history.getValueAt(row, column)] for row in range(history.rowCount)]

n = len(locations)
overlays = []
for index, path in enumerate(locations):
overlays.append({
'name': 'Speed',
'locationPath': path,
'axisGroup': 'Speed',
'color': '#7c3aed',
'units': 'bpm',
'min': 0,
'data': samples(index + 1),
})
overlays.append({
'name': 'Speed Setpoint',
'locationPath': path,
'axisGroup': 'Speed',
'color': '#f59e0b',
'lineType': 'step',
'units': 'bpm',
'data': samples(n + index + 1),
})
overlays.append({
'name': 'Ambient Temp',
'locationPath': '',
'enabled': False,
'color': '#0f766e',
'units': 'C',
'data': samples(2 * n + 1),
})
return overlays
  • Every Speed entry names the same axisGroup, and so does every Speed Setpoint entry. Entries that share a name but disagree on axisGroup share with nothing, and the browser console logs a warning.
  • Both overlays start checked, since enabled defaults to true and they share an axis group.

Tips​

  • Return size: 500 samples is plenty for a dashboard-width chart, and the chart thins out a larger series before drawing it. History is queried once for the whole window, so zooming in with the slider does not fetch finer data.
  • A different tag per location: add one overlaySeries entry per location, all with the same name, each with its own locationPath and its own binding, or build them all in one binding as shown above. They appear as a single entry in the gear menu.
  • Several overlays to choose from: add one entry per overlay with enabled set to false on all but the default. The session user can then switch between them from the gear menu.
  • Several lines on one axis: give each a distinct color, since lines left on the default color can't be told apart. The line band is a little under two thirds of the row's height, so two or three lines per lane is about as many as stay readable.

Size and Layout​

Container Size​

  • The chart follows the size of its container. It redraws as the container changes, for example when a sidebar or dock opens, a split pane divider is dragged, a dashboard widget is resized, or a hidden container is shown. No window resize is needed, and the zoom range and the overlays drawn are kept.
  • It also stays sharp when the browser zoom level changes or the window moves to a screen with a different pixel density.

Vertical Layout​

The height of the component is divided as follows:

  • 12 px at the top.
  • 22 px for each lane, above its rows, reserved for time labels (the band between two lanes holds the time labels of the lane above).
  • 60 px at the bottom, for the last lane's time labels and the zoom slider.
  • The rest is shared equally by the rows of all lanes when rowHeight is empty. A lane has one row for each of States and Modes that is switched on. An overlay is drawn across the States ribbon, or the Modes ribbon while States is hidden, and only gets a row of its own when both are hidden.

When rowHeight is empty (the default), the rows always fill the component height, so the chart needs no scrollbar and a taller component gives taller rows. A very small component, shorter than 72 px plus 22 px per lane, has no room left for the rows: the rows shrink to nothing and the lanes that do not fit are cut off.

Fixed Row Height​

When rowHeight is set, every row is exactly that many px tall. The lanes and the zoom slider stack from the top of the component, any spare height below the slider stays empty, and lanes that do not fit in the component are cut off at its bottom edge. The mouse wheel and drag zoom still work. A value that is not a number greater than 0 is treated as empty.

To show every lane, size the component to:

72 + lanes x (22 + rows per lane x rowHeight) px

For example, 5 lanes with one row each at a rowHeight of 45 need 72 + 5 x (22 + 45) = 407 px.

Many Lanes​

  • Every lane adds work each time the chart is resized, so a component with many lanes can take longer than one frame to redraw while its container is changing size, for example while a split pane divider is being dragged. The chart always draws the latest size, and the final size is applied shortly after the container stops changing, but the motion can look less smooth the more lanes there are.
  • Keep the number of lanes in one component moderate, and see Browser Limits below for the cap on the total component height.

Browser Limits​

  • Browsers cap the size of the canvas the chart is drawn on. On iPad Safari the cap is 67,108,864 device pixels in total (older versions may differ), which is about 4,660 px of component height at 1,600 px wide on a 3x screen and about 12,000 px at 1,366 px wide on a 2x screen. A fixed rowHeight with many lanes can pass this, so keep the total component height well under it on tablets.