Filter
public struct Filter : Transform
Specification of filter operation on trace data.
-
Determines whether this filter transform is enabled or disabled.
Declaration
Swift
public var enabled: Bool? -
Sets the filter target by which the filter is applied.
If a string,
targetis assumed to be a reference to a data array in the parent trace object. To filter about nested variables, use . to access them. For example, settargetto marker.color to filter about the marker color array. If an array,targetis then the data array by which the filter is applied.Declaration
Swift
public var target: Data<String>? -
Sets the filter operation.
= keeps items equal to
See morevalue!= keeps items not equal tovalue< keeps items less thanvalue<= keeps items less than or equal tovalue> keeps items greater thanvalue>= keeps items greater than or equal tovalue[] keeps items insidevalue[0]tovalue[1]including both bounds () keeps items insidevalue[0]tovalue[1]excluding both bounds [) keeps items insidevalue[0]tovalue[1]includingvalue[0]but excludingvalue[1] *(]* keeps items insidevalue[0]tovalue[1]excludingvalue[0]but includingvalue[1] ][ keeps items outsidevalue[0]tovalue[1]and equal to both bounds )( keeps items outsidevalue[0]tovalue[1]]( keeps items outsidevalue[0]tovalue[1]and equal tovalue[0])[ keeps items outsidevalue[0]tovalue[1]and equal tovalue[1]{} keeps items present in a set of values }{ keeps items not present in a set of valuesDeclaration
Swift
public enum Operation : String, Encodable -
Sets the filter operation.
= keeps items equal to
value!= keeps items not equal tovalue< keeps items less thanvalue<= keeps items less than or equal tovalue> keeps items greater thanvalue>= keeps items greater than or equal tovalue[] keeps items insidevalue[0]tovalue[1]including both bounds () keeps items insidevalue[0]tovalue[1]excluding both bounds [) keeps items insidevalue[0]tovalue[1]includingvalue[0]but excludingvalue[1] *(]* keeps items insidevalue[0]tovalue[1]excludingvalue[0]but includingvalue[1] ][ keeps items outsidevalue[0]tovalue[1]and equal to both bounds )( keeps items outsidevalue[0]tovalue[1]]( keeps items outsidevalue[0]tovalue[1]and equal tovalue[0])[ keeps items outsidevalue[0]tovalue[1]and equal tovalue[1]{} keeps items present in a set of values }{ keeps items not present in a set of valuesDeclaration
Swift
public var operation: Operation? -
Sets the value or values by which to filter.
Values are expected to be in the same type as the data linked to
target. Whenoperationis set to one of the comparison values (=,!=,<,>=,>,<=)valueis expected to be a number or a string. Whenoperationis set to one of the interval values ([],(),[),(],],)(,[)valueis expected to be 2-item array where the first item is the lower bound and the second item is the upper bound. Whenoperation, is set to one of the set values ({},}{)valueis expected to be an array with as many items as the desired set elements.Declaration
Swift
public var value: Anything? -
Determines whether or not gaps in data arrays produced by the filter operation are preserved.
Setting this to true might be useful when plotting a line chart with
connectgapsset to false.Declaration
Swift
public var preserveGaps: Bool? -
Creates
Filterobject with specified properties.Declaration
Parameters
enabledDetermines whether this filter transform is enabled or disabled.
targetSets the filter target by which the filter is applied.
operationSets the filter operation.
valueSets the value or values by which to filter.
preserveGapsDetermines whether or not gaps in data arrays produced by the filter operation are preserved.
valueCalendarSets the calendar system to use for
value, if it is a date.targetCalendarSets the calendar system to use for
target, if it is an array of dates.
View on GitHub
Install in Dash
Filter Structure Reference