Drawing-space geometry of a plan: where each panel's frames sit on the canvas, and how a data position maps into them and back.
A frame is a rectangle measured in drawing units. Three are named:
:canvas -- the whole output image:panel-box -- one panel including its axis margin:drawing-area -- the panel background inside that margin, where
data marks are clippedThe renderer builds the same panel origins and the same scales from
the same plan values. That computation lives here so the public
mapping (pj/frames) and the drawn output cannot drift apart:
render/membrane.clj calls panel-origin, and render/panel.clj
builds its scales the way panel-scales does.
Drawing-space geometry of a plan: where each panel's frames sit on the canvas, and how a data position maps into them and back. A frame is a rectangle measured in drawing units. Three are named: - `:canvas` -- the whole output image - `:panel-box` -- one panel including its axis margin - `:drawing-area` -- the panel background inside that margin, where data marks are clipped The renderer builds the same panel origins and the same scales from the same plan values. That computation lives here so the public mapping (`pj/frames`) and the drawn output cannot drift apart: `render/membrane.clj` calls `panel-origin`, and `render/panel.clj` builds its scales the way `panel-scales` does.
(panel-frames plan panel [ox oy])The two frames a panel owns, each [x y width height] in canvas
coordinates. offset shifts them, for a panel that belongs to a
composite cell rather than to the canvas directly.
The canvas is the third frame and is not among them: it belongs to the plot, not to a panel, and every panel would repeat it. It was reported here once, and was wrong for a composite -- built from the cell's own dimensions, so a 700-wide image with two cells told every panel its canvas was 350 wide.
The two frames a panel owns, each `[x y width height]` in canvas coordinates. `offset` shifts them, for a panel that belongs to a composite cell rather than to the canvas directly. The canvas is the third frame and is not among them: it belongs to the plot, not to a panel, and every panel would repeat it. It was reported here once, and was wrong for a composite -- built from the cell's own dimensions, so a 700-wide image with two cells told every panel its canvas was 350 wide.
(panel-geometry plan panel offset)One panel's entry: its frames and everything needed to map into and out
of them. Plain data -- the mappings are to-drawing and to-data
below, which read this rather than being stored inside it.
One panel's entry: its frames and everything needed to map into and out of them. Plain data -- the mappings are `to-drawing` and `to-data` below, which read this rather than being stored inside it.
(panel-origin plan panel)Top-left corner of panel's panel box, relative to the plan's own
canvas. layout pads push the grid right and down; :row and :col
step through it.
Top-left corner of `panel`'s panel box, relative to the plan's own canvas. `layout` pads push the grid right and down; `:row` and `:col` step through it.
(panel-scales plan panel)The wadogo scales panel is drawn with, built from the plan's domains
and pixel dimensions exactly as render/panel.clj builds them.
The wadogo scales `panel` is drawn with, built from the plan's domains and pixel dimensions exactly as `render/panel.clj` builds them.
(plan-frames plan offset)Geometry for every panel of plan, with offset added to each panel
origin. A composite plan carries its cells in :sub-plots, each a leaf
plan and the rectangle it is drawn into, so the cells recur with their
own origin as the offset -- a composite is one coordinate system, not a
nest of them.
Geometry for every panel of `plan`, with `offset` added to each panel origin. A composite plan carries its cells in `:sub-plots`, each a leaf plan and the rectangle it is drawn into, so the cells recur with their own origin as the offset -- a composite is one coordinate system, not a nest of them.
(to-data panel data)(to-data panel cx cy)Map canvas coordinates back to data positions for panel. Two
coordinates give one point back as [x y]; a dataset of them gives a
dataset back.
Map canvas coordinates back to data positions for `panel`. Two coordinates give one point back as `[x y]`; a dataset of them gives a dataset back.
(to-drawing panel data)(to-drawing panel x y)Map data positions into canvas coordinates for panel. Two coordinates
give one point back as [x y]; a dataset of them gives a dataset back.
Map data positions into canvas coordinates for `panel`. Two coordinates give one point back as `[x y]`; a dataset of them gives a dataset back.
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 |