Bland.Strokes (Elixir Technical Drawing v0.4.0)

Copy Markdown View Source

Line-style vocabulary for monochrome plots.

Rather than relying on color to distinguish series, BLAND leans on stroke dash patterns and weights — the legibility conventions of ink-on-vellum drafting.

Presets

  • :solid — continuous line
  • :dashed — long dashes
  • :dotted — short dots
  • :dash_dot — classic centerline / phantom line
  • :long_dash— extra-long dashes for emphasis
  • :fine — alternating fine dashes, hairline stroke

Presets cycle in preset_cycle/0 order when no explicit stroke: is set on a series.

Summary

Functions

Returns preset at cyclic index, skipping any in exclude.

Returns the SVG stroke-dasharray value for a preset. :solid returns nil so callers can omit the attribute.

Stroke presets in recommended cycling order.

Functions

cycle(index, exclude \\ [])

@spec cycle(non_neg_integer(), [atom()]) :: atom()

Returns preset at cyclic index, skipping any in exclude.

dasharray(custom)

@spec dasharray(atom()) :: String.t() | nil

Returns the SVG stroke-dasharray value for a preset. :solid returns nil so callers can omit the attribute.

preset_cycle()

@spec preset_cycle() :: [atom()]

Stroke presets in recommended cycling order.