Skip to contents

Trips Layer

Usage

add_trips_layer(
  rdeck,
  ...,
  id = uuid::UUIDgenerate(),
  name = "TripsLayer",
  group_name = NULL,
  data = NULL,
  visible = TRUE,
  pickable = FALSE,
  opacity = 1,
  wrap_longitude = FALSE,
  position_format = "XY",
  color_format = "RGBA",
  auto_highlight = FALSE,
  highlight_color = "#00008080",
  width_units = "meters",
  width_scale = 1,
  width_min_pixels = 0,
  width_max_pixels = 9007199254740991,
  joint_rounded = FALSE,
  cap_rounded = FALSE,
  miter_limit = 4,
  billboard = FALSE,
  get_path = path,
  get_color = "#000000ff",
  get_width = 1,
  fade_trail = TRUE,
  trail_length = 120,
  get_timestamps = timestamps,
  blending_mode = "normal",
  visibility_toggle = TRUE,
  tooltip = NULL,
  loop_length = 1800,
  animation_speed = 30
)

update_trips_layer(
  rdeck,
  ...,
  id,
  name = cur_value(),
  group_name = cur_value(),
  data = cur_value(),
  visible = cur_value(),
  pickable = cur_value(),
  opacity = cur_value(),
  wrap_longitude = cur_value(),
  position_format = cur_value(),
  color_format = cur_value(),
  auto_highlight = cur_value(),
  highlight_color = cur_value(),
  width_units = cur_value(),
  width_scale = cur_value(),
  width_min_pixels = cur_value(),
  width_max_pixels = cur_value(),
  joint_rounded = cur_value(),
  cap_rounded = cur_value(),
  miter_limit = cur_value(),
  billboard = cur_value(),
  get_path = cur_value(),
  get_color = cur_value(),
  get_width = cur_value(),
  fade_trail = cur_value(),
  trail_length = cur_value(),
  get_timestamps = cur_value(),
  blending_mode = cur_value(),
  visibility_toggle = cur_value(),
  tooltip = cur_value(),
  loop_length = cur_value(),
  animation_speed = cur_value()
)

Arguments

rdeck

<rdeck | rdeck_proxy> An rdeck map instance.

...

Additional parameters that will be forwarded to deck.gl javascript without validation nor processing. All dots must be named and will be camelCased when serialised. A warning is raised when dots are used, warning class rdeck_dots_nonempty.

id

<string> The layer's identifier must be unique for among all layers of the same type for a map. Defaults to uuid::UUIDgenerate(), but should be explicitly defined for updatable layers in a shiny application.

name

<string> Identifies the layer on tooltips and legends. It does not need to be unique, but should be brief. Defaults to the deck.gl class name for the layer.

group_name

<string> Defines the group that this layer belongs to. Currently only effective on the layer selector, if visibility_toggle = TRUE.

data

<data.frame | sf | string> The layer's data. Data frames and sf objects will contain all columns that are referenced by the layer's accessors. Strings will be interpreted as a URL and data will be retrieved dynamically in the browser.

visible

<boolean> Determines whether the layer is visible or not; also determines whether any legend elements for the layer will be displayed.

pickable

<boolean> Determines if the layer responds to pointer / touch events.

opacity

<number> Determines the layer's opacity.

wrap_longitude

<boolean> Normalises geometry longitudes.

position_format

<"XY" | "XYZ"> Determines whether each coordinate has two (XY) or three (XYZ) elements.

color_format

<"RGB" | "RGBA"> Determines whether the alpha channel of the colours will be ignored by accessors, making all colours opaque.

auto_highlight

<boolean> When TRUE, the current object hovered by the cursor is highlighted by highlight_color.

highlight_color

<accessor | scale | color> When auto_highlight and pickable are enabled, highlight_color determines the colour of the currently highlighted object. If a single colour value is supplied, that colour will be used to highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, or a tidy-eval column of colours.

width_units

<"pixels" | "common" | "meters"> The units of the line_width.

width_scale

<number> The scaling multiplier for the width of each line.

width_min_pixels

<number> The minimum line width in pixels.

width_max_pixels

<number> The maximum line width in pixels.

joint_rounded

<boolean> If TRUE, draw round joints; else draw square joints.

cap_rounded

<boolean> If TRUE, draw round caps; else draw square caps.

miter_limit

<number> The maximum extent of a joint in ratio to the stroke width. Only applicable if rounded == FALSE.

billboard

<boolean> If TRUE, extrude the path in screen space (width always faces) the camera; if FALSE, the width always faces up (z).

get_path

<accessor> The feature paths. A <linestring/multilinestring> wk-geometry column with CRS EPSG:4326. Supports tidy-eval.

get_color

<accessor | scale | color> The colour of each object. Accepts a single colour value, a colour scale, or a tidy-eval column of colours.

get_width

<accessor | scale | number> The width of each object, in units specified by width_scale. Accepts a single numeric value, a numeric scale, or a tidy-eval column of numbers.

fade_trail

<boolean> Whether or not the path fades out.

trail_length

<number> The number of seconds for a path to completely fade out.

get_timestamps

<accessor> The timestamps for each trip. For each trip, each timestamp corresponds to a position in the linestring returned by get_path, representing the time at which that position was visited.

Accepts a tidy-eval list column of numbers.

blending_mode

<"normal" | "additive" | "subtractive"> Sets the blending mode. Blending modes:

  • normal: Normal blending doesn't alter colours of overlapping objects.

  • additive: Additive blending adds colours of overlapping objects. Useful for highlighting dot density on dark maps.

  • subtractive: Subtractive blending darkens overlapping objects. Useful for highlighting dot density on light maps.

visibility_toggle

<boolean> Whether this layer will appear in the layer selector.

tooltip

<tooltip> Defines the columns (and their order) that will be displayed in the layer tooltip, if pickable == TRUE. Supports tidy-select if a data is a data.frame. Geometry columns are always removed.

loop_length

<number> The number of seconds to complete an animation loop.

animation_speed

<number> The animation speed multiplier.