Extract data-space geometry from resolved draft layers and stat results. Produces layer descriptor maps — plain Clojure maps with mark type, style, and groups of data-space coordinates.
Extract data-space geometry from resolved draft layers and stat results. Produces layer descriptor maps — plain Clojure maps with mark type, style, and groups of data-space coordinates.
Named stroke-dash presets, resolved to a [dash gap] pixel pattern.
:solid means no dash (returns nil).
Named stroke-dash presets, resolved to a `[dash gap]` pixel pattern. `:solid` means no dash (returns nil).
Extract data-space geometry from a resolved draft layer and its stat result. Returns a layer descriptor map.
Extract data-space geometry from a resolved draft layer and its stat result. Returns a layer descriptor map.
(fill-domain stat spec scale-type)The [lo hi] a fill scale is read against -- by the marks, in this
namespace, and by the legend, in plan/build-fill-legend. One
function because they are one question, and answering it twice let
the bar describe a scale the tiles were not drawn through.
A stat reports its range floored at zero: [0 max-count] for a
two-dimensional bin, [0 max-density] for a density grid. That is
what a linear count legend should span -- a count starts at none.
A log scale has no reading for zero, and the floor is a convention rather than a value any tile carries: an empty bin is not drawn at all, so the smallest tile a count heatmap draws is one. So on a log scale the low end is read from the tiles instead. Read from the floor, the generator offered every decade from 1e-300 and the legend carried three hundred labels printed over each other.
A :domain written on the scale still wins, through
scale/numeric-color-domain, and is checked the same way.
The `[lo hi]` a fill scale is read against -- by the marks, in this namespace, and by the legend, in `plan/build-fill-legend`. One function because they are one question, and answering it twice let the bar describe a scale the tiles were not drawn through. A stat reports its range floored at zero: `[0 max-count]` for a two-dimensional bin, `[0 max-density]` for a density grid. That is what a linear count legend should span -- a count starts at none. A log scale has no reading for zero, and the floor is a convention rather than a value any tile carries: an empty bin is not drawn at all, so the smallest tile a count heatmap draws is one. So on a log scale the low end is read from the tiles instead. Read from the floor, the generator offered every decade from 1e-300 and the legend carried three hundred labels printed over each other. A `:domain` written on the scale still wins, through `scale/numeric-color-domain`, and is checked the same way.
(fill-setting k draft-layer cfg)A scale setting for a mark drawn in a fill: what a :fill scale spec
says, and failing that a :color one, the :fill plot option, and
the :color plot option, in that order.
A scale setting for a mark drawn in a fill: what a `:fill` scale spec says, and failing that a `:color` one, the `:fill` plot option, and the `:color` plot option, in that order.
(fill-setting-from-spec? k draft-layer cfg)True when fill-setting answers k from a scale spec rather than
from a plot option. Render-time configuration is the outermost scope
of a colour range, so it repaints a legend built from an option and
leaves one built from a spec alone; this is how the legend knows
which it has.
True when `fill-setting` answers `k` from a scale spec rather than from a plot option. Render-time configuration is the outermost scope of a colour range, so it repaints a legend built from an option and leaves one built from a spec alone; this is how the legend knows which it has.
(fill-spec draft-layer)The scale spec a mark drawn in a fill reads: the :fill spec over
the :color one, key by key.
A tile reads :color as a synonym for :fill, so a gradient, a
domain or a midpoint written either way has to reach it, and a
:fill spec naming only one of them leaves the rest to :color.
A key neither spec names is answered by the plot options, through
fill-setting.
The scale spec a mark drawn in a fill reads: the `:fill` spec over the `:color` one, key by key. A tile reads `:color` as a synonym for `:fill`, so a gradient, a domain or a midpoint written either way has to reach it, and a `:fill` spec naming only one of them leaves the rest to `:color`. A key neither spec names is answered by the plot options, through `fill-setting`.
(resolve-color all-colors color-val draft-layer cfg)Resolve a color value to [r g b a]. Handles column values, fixed colors, and defaults.
A fixed color wins over a group's palette color. The two cannot
conflict: :color is one key, so a literal there means there is no
color column, and any group color present came from :group instead.
Grouping by one column while drawing every group in one color is a
common case: many pale lines behind a few named ones. It needs the
fixed color to survive the grouping.
Takes the resolved draft layer rather than its :fixed-color,
because the layer answers a second question too: whether its color
column is drawn as it stands. resolve/resolve-aesthetics decides
that once for the column, so what arrives here is a group value that
already is a color and needs no palette.
Resolve a color value to [r g b a]. Handles column values, fixed colors, and defaults. A fixed color wins over a group's palette color. The two cannot conflict: `:color` is one key, so a literal there means there is no color column, and any group color present came from `:group` instead. Grouping by one column while drawing every group in one color is a common case: many pale lines behind a few named ones. It needs the fixed color to survive the grouping. Takes the resolved draft layer rather than its `:fixed-color`, because the layer answers a second question too: whether its color column is drawn as it stands. `resolve/resolve-aesthetics` decides that once for the column, so what arrives here is a group value that already *is* a color and needs no palette.
(resolve-dash stroke-dash)Resolve a :stroke-dash value to a [dash gap ...] vector or nil.
Accepts a named preset (:solid/:dashed/:dotted), a raw
[dash gap ...] vector (passed through), or nil (no dash).
Resolve a `:stroke-dash` value to a `[dash gap ...]` vector or nil. Accepts a named preset (`:solid`/`:dashed`/`:dotted`), a raw `[dash gap ...]` vector (passed through), or nil (no dash).
(smallest-drawn-fill stat)The smallest fill value the tiles of stat actually carry, or nil
where it has none.
The smallest fill value the tiles of `stat` actually carry, or nil where it has none.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |