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,
target
is 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, settarget
to marker.color to filter about the marker color array. If an array,target
is 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 inside
value[0]to
value[1]excluding
value[0]but including
value[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 inside
value[0]to
value[1]excluding
value[0]but including
value[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
. Whenoperation
is set to one of the comparison values (=,!=,<,>=,>,<=)value
is expected to be a number or a string. Whenoperation
is set to one of the interval values ([],(),[),(],],)(,[)value
is 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 ({},}{)value
is 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
connectgaps
set to false.Declaration
Swift
public var preserveGaps: Bool?
-
Creates
Filter
object with specified properties.Declaration
Parameters
enabled
Determines whether this filter transform is enabled or disabled.
target
Sets the filter target by which the filter is applied.
operation
Sets the filter operation.
value
Sets the value or values by which to filter.
preserveGaps
Determines whether or not gaps in data arrays produced by the filter operation are preserved.
valueCalendar
Sets the calendar system to use for
value
, if it is a date.targetCalendar
Sets the calendar system to use for
target
, if it is an array of dates.