Global display settings for the projects Gantt/Timeline chart.
Stored as plain PhoenixKit.Settings key/values and read back as the attr map
PhoenixLiveGantt.gantt/1 takes (bar labels, what to show, bar sizing, and
dependency-arrow routing). Configured on /admin/settings/projects (with a
live demo) and consumed by PhoenixKitProjects.Web.ProjectGanttLive.
All settings are presentation-only and validated on the way in (enums against an allowed set, ratios/ints clamped to range), so a malformed or unconfigured install always resolves to safe defaults that match the behavior that shipped before this was configurable.
Summary
Functions
Upper bound (px) for the min_bar_px setting; used to clamp the slider.
Allowed string values for each enum field (used to build the settings form).
Persist one setting from its string form. The field name matches read/0's
keys ("label_position", "label_fit_ratio", …). Enums must be in the allowed
set and ratios are clamped to 0.0..1.0; anything else is ignored (returns
:ignore) so a stray form field can't write garbage.
Persist one boolean display toggle ("show_progress", "show_connectors",
"show_today", "tiny_markers", "avoid_collisions"). Anything else is ignored.
All label settings as the attr map PhoenixLiveGantt.gantt/1 takes
(label_position etc., as atoms/floats).
Restore every Gantt display setting to its default.
Functions
@spec attach_modes() :: [String.t()]
@spec min_bar_max() :: pos_integer()
Upper bound (px) for the min_bar_px setting; used to clamp the slider.
@spec overflows() :: [String.t()]
@spec positions() :: [String.t()]
Allowed string values for each enum field (used to build the settings form).
Persist one setting from its string form. The field name matches read/0's
keys ("label_position", "label_fit_ratio", …). Enums must be in the allowed
set and ratios are clamped to 0.0..1.0; anything else is ignored (returns
:ignore) so a stray form field can't write garbage.
Persist one boolean display toggle ("show_progress", "show_connectors",
"show_today", "tiny_markers", "avoid_collisions"). Anything else is ignored.
@spec read() :: %{ label_position: atom(), label_side: atom(), label_overflow: atom(), label_fit_ratio: float(), label_watermark_opacity: float(), show_progress: boolean(), show_connectors: boolean(), show_today: boolean(), tiny_markers: boolean(), tiny_bar_px: non_neg_integer(), min_bar_px: non_neg_integer(), row_height_choice: atom(), row_height: String.t(), avoid_collisions: boolean(), bus_attach_mode: atom() }
All label settings as the attr map PhoenixLiveGantt.gantt/1 takes
(label_position etc., as atoms/floats).
@spec reset() :: :ok
Restore every Gantt display setting to its default.
@spec row_heights() :: [String.t()]
@spec sides() :: [String.t()]