Skip to contents

The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.

Usage

setup_GanttConfig(
  label = "label",
  start = "start",
  end = "end",
  group = NULL,
  tooltip = NULL,
  border = NULL,
  axis_type = "value",
  zoom = TRUE,
  guides = TRUE,
  bar_height = 0.6,
  bar_radius = 0,
  border_color = "#E53935",
  border_width = 1.5,
  palette = NULL,
  xlab = NULL,
  title = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL,
  legend_position = "top",
  legend_placement = "outside"
)

Arguments

label

Character: Column naming each task.

start

Character: Column holding each task's start.

end

Character: Column holding each task's end.

group

Optional Character: Column to color bars by.

tooltip

Optional Character: Column holding per-bar tooltip text.

border

Optional Character: Logical column; TRUE outlines the bar.

axis_type

Character {"value", "time"}: How the time axis is scaled.

zoom

Logical: Enable the zoom control.

guides

Logical: Show guide lines.

bar_height

Numeric [0, 1]: Bar height as a fraction of the row.

bar_radius

Numeric [0, Inf): Bar corner radius in pixels.

border_color

Character: Outline color for bordered bars.

border_width

Numeric [0, Inf): Outline width in pixels.

palette

Optional Character: Bar colors, overriding the theme palette for this chart. NULL uses the theme's.

xlab

Optional Character: Time axis label.

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance.

writer

Optional Named character: Which interface wrote the config.

legend_position

Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.

legend_placement

Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.

Value

GanttConfig object.

Author

EDG

Examples

tasks <- data.frame(
  label = c("s1", "s2"),
  start = c(0, 5),
  end = c(5, 9),
  kind = c("a", "b")
)
draw(setup_GanttConfig(group = "kind"), data = tasks)