Macaw.Frame.Transforms.Gantt (macaw_frame v0.1.0)

Copy Markdown View Source

The gantt step (spec/04 §5.2, §7.2): tasks as bars against a time axis, in rows grouped by section, laid out by Macaw.Draw.Layout.Gantt (macaw_draw spec/08 §14) across the plot (needs: [:frame]), for the node, edge, lane and grid kinds of a Gantt chart or a timeline.

Its input is the tasks, one a row, read by the options naming their columns: id (a row without one is "t<row>"), label, section, from (a Date, a DateTime or a number), to, duration ("3d", "2w", "4h", "30m", "10s", read when there is no to), after (the ids it waits on, a list or a space-separated text) and state (a text of words; milestone among them, or milestone: true for every row, makes the task a milestone). A task's start is its from, else the latest end of its after, else the previous task's end (macaw_draw spec/08 §14.1). The time scale spans the tasks' starts and ends across the plot's width from left (0, the room a section's header takes), its ticks the grid, one each 80 pixels of it; every row is moved down by top (24), the grid's header. row_height (24) and row_pad (4) reach the layout.

Outputs, one table each:

  • "bars": the task rows that are no milestone, with x, y (the center), width, height, x0, y0, x1, y1: what a node draws; and start and end, the task's start and end as the layout resolved them, what a summary says;
  • "milestones": the milestone rows with x, y, width, height and shape diamond, and start and end, both its date;
  • "dependencies": source, target and the routed path, one per after edge, with its ends' places and bearings: what an edge draws;
  • "grid": one row per tick, x0 the tick, x1 the next tick (the plot's right edge for the last), label the tick written by the scale's format, y0, y1: what a grid draws;
  • "sections": one row per section, label ("" for the unnamed), y0, y1: what a horizontal lane draws.

A task with no start is {"from", :required}; an after naming no task {"after", {:unknown_task, id}}; a cycle {"after", {:cycle, ids}}; an end before its start {"to", :before_start}.

Summary

Functions

What the frame is called when a data layer's rows are laid out by this step (spec/11 §2.2).

What the frame is called by this step's node (spec/13 §7.3): a "timeline" when every task is a milestone, else a "Gantt chart".

Functions

phrase()

@spec phrase() :: String.t()

What the frame is called when a data layer's rows are laid out by this step (spec/11 §2.2).

phrase(arg1)

@spec phrase(map()) :: String.t()

What the frame is called by this step's node (spec/13 §7.3): a "timeline" when every task is a milestone, else a "Gantt chart".