Struct vega_lite::Transform

source ·
pub struct Transform {
Show 15 fields pub filter: Box<Option<Box<PurpleLogicalOperandPredicate>>>, pub transform_as: Option<Style>, pub calculate: Option<String>, pub transform_default: Option<String>, pub from: Option<LookupData>, pub lookup: Option<String>, pub bin: Option<Bin>, pub field: Option<String>, pub time_unit: Option<TimeUnit>, pub aggregate: Option<Vec<AggregatedFieldDef>>, pub groupby: Option<Vec<String>>, pub frame: Option<Vec<Option<f64>>>, pub ignore_peers: Option<bool>, pub sort: Option<Vec<SortField>>, pub window: Option<Vec<WindowFieldDef>>,
}

Fields§

§filter: Box<Option<Box<PurpleLogicalOperandPredicate>>>

The filter property must be one of the predicate definitions:

  1. an expression string, where datum can be used to refer to the current data object

  2. one of the field predicates: equal, lt, lte, gt, gte, range, or oneOf.

  3. a selection predicate

  4. a logical operand that combines (1), (2), or (3).

§transform_as: Option<Style>

The field for storing the computed formula value.

The field or fields for storing the computed formula value. If from.fields is specified, the transform will use the same names for as. If from.fields is not specified, as has to be a string and we put the whole object into the data under the specified name.

The output fields at which to write the start and end bin values.

The output field to write the timeUnit value.

§calculate: Option<String>

A expression string. Use the variable datum to refer to the current data object.

§transform_default: Option<String>

The default value to use if lookup fails.

Default value: null

§from: Option<LookupData>

Secondary data reference.

§lookup: Option<String>

Key in primary data source.

§bin: Option<Bin>

An object indicating bin properties, or simply true for using default bin parameters.

§field: Option<String>

The data field to bin.

The data field to apply time unit.

§time_unit: Option<TimeUnit>

The timeUnit.

§aggregate: Option<Vec<AggregatedFieldDef>>

Array of objects that define fields to aggregate.

§groupby: Option<Vec<String>>

The data fields to group by. If not specified, a single group containing all data objects will be used.

The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single group.

§frame: Option<Vec<Option<f64>>>

A frame specification as a two-element array indicating how the sliding window should proceed. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. The default value is [null, 0], indicating that the sliding window includes the current object and all preceding objects. The value [-5, 5] indicates that the window should include five objects preceding and five objects following the current object. Finally, [null, null] indicates that the window frame should always include all data objects. The only operators affected are the aggregation operations and the first_value, last_value, and nth_value window operations. The other window operations are not affected by this.

Default value:: [null, 0] (includes the current object and all preceding objects)

§ignore_peers: Option<bool>

Indicates if the sliding window frame should ignore peer values. (Peer values are those considered identical by the sort criteria). The default is false, causing the window frame to expand to include all peer values. If set to true, the window frame will be defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.

Default value: false

§sort: Option<Vec<SortField>>

A sort field definition for sorting data objects within a window. If two data objects are considered equal by the comparator, they are considered “peer” values of equal rank. If sort is not specified, the order is undefined: data objects are processed in the order they are observed and none are considered peers (the ignorePeers parameter is ignored and treated as if set to true).

§window: Option<Vec<WindowFieldDef>>

The definition of the fields in the window, and what calculations to use.

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.