Macaw.Frame.Charts.CalendarHeatmap (macaw_frame v0.1.0)

Copy Markdown View Source

charts.calendar_heatmap (spec/13 §7.1), a second-cut chart: a cell per day, its column the day's week and its row its weekday, its color its value through a sequential or diverging scale, each month outlined. The calendar parts are macaw_data's time_parts operation (macaw_data#309, #336) over the day window field: week, weekday and month, the weeks and weekdays starting on week_start ("monday"), never the frame's arithmetic. New in the second cut.

Month outlines (decision, macaw_frame#96): a closed path around each month's cells, stepped where a month starts or ends within a week, so two months meet along the calendar's own stepped line rather than a box over whole weeks. The path is a frame concern, the month_outline spatial step over the same parts: it places the cells on the frame's own bands (the weeks in order of first appearance and the weekdays 1 to 7, neither padded) and draws under a path layer above the cells. Weeks are numbered within a year, so a calendar spans one year.

iex> Macaw.Frame.Charts.CalendarHeatmap.id()
"charts.calendar_heatmap"

Summary

Functions

What it draws, for a person and a builder's library.

Its fixtures (spec/14 §1): a quarter of daily deploys, fewer at weekends.

The fragment: time_parts under a rect per day on week and weekday bands, months outlined.

The fragment's id in the catalog store.

What the fragment is: a whole design, or layers placed in one.

Its namespace (spec/13 §2).

Its parameters (spec/13 §3, §7.1).

Its slot: data, a day (the window field) and its value.

Functions

doc()

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

What it draws, for a person and a builder's library.

fixtures()

@spec fixtures() :: [map()]

Its fixtures (spec/14 §1): a quarter of daily deploys, fewer at weekends.

fragment()

@spec fragment() :: map()

The fragment: time_parts under a rect per day on week and weekday bands, months outlined.

id()

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

The fragment's id in the catalog store.

kind()

@spec kind() :: :design | :layers

What the fragment is: a whole design, or layers placed in one.

namespace()

@spec namespace() :: :charts | :maps | :diagrams

Its namespace (spec/13 §2).

parameters()

@spec parameters() :: [{String.t(), map()}]

Its parameters (spec/13 §3, §7.1).

slots()

@spec slots() :: %{required(String.t()) => map()}

Its slot: data, a day (the window field) and its value.