Skip to contents

Add sort by field parameters to an encoding

Usage

vl_sort_angle_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_color_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_fill_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_fillOpacity_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_opacity_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_order_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_radius_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_shape_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_size_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_stroke_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_strokeDash_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_strokeOpacity_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_strokeWidth_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_theta_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_x_by_field(spec, field = NULL, op = NULL, order = NULL, .object = NULL)

vl_sort_xOffset_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_y_by_field(spec, field = NULL, op = NULL, order = NULL, .object = NULL)

vl_sort_yOffset_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_facet_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_row_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

vl_sort_column_by_field(
  spec,
  field = NULL,
  op = NULL,
  order = NULL,
  .object = NULL
)

Arguments

spec

An input vega-lite spec

field

The data field to sort by.

Default value: If unspecified, defaults to the field specified in the outer data reference.

op

An aggregate operation to perform on the field prior to sorting (e.g., "count", "mean" and "median"). An aggregation is required when there are multiple values of the sort field for each encoded data field. The input data objects will be aggregated, grouped by the encoded data field.

For a full list of operations, please see the documentation for aggregate.

Default value: "sum" for stacked plots. Otherwise, "min".

order

The sort order. One of "ascending" (default), "descending", or null (no not sort).

.object

Directly input an object, rather than creating one via the other arguments. Should not be used in conjunction with the other arguments other than spec. Objects can be of type: EncodingSortField

Value

A modified Vega-Lite Spec