Hylograph.Flow.Render.Route
- Package
- purescript-hylograph-flow-render
- Repository
- afcondon/purescript-hylograph-flow-render
The line an edge is drawn along, as data.
In 0.2 a placed edge held an SVG path string. A string can be drawn and
nothing else: to measure an edge an earlier layout trial had to
parse the string back, and a second layout engine had to print its
routes as strings only for them to be read again. Here the route is a
value, the string is derived from it (svgPath), and so are the points
it is measured along (flatten).
THE THREE ROUTES. Route is closed, and has exactly the routes of the
three engines this renderer is built to take. None is there for an
engine nobody has.
Ribbon, the Sankey layout's: a centre line of straight and cubic pieces, and abreadth, the room the edge takes on the side of each node it touches (its two attachment spans are the centre line's two ends, half the breadth either way across the flow). The Sankey layout's ribbons are as broad at one end as at the other, so the width profile is one number; an engine that tapers one would need a profile here, and none of the three does.inksays how the ribbon is drawn: aBandas broad as it is, or aHairlinedown its middle. It is an ADT and not a second number because a stroke beside a breadth is two numbers that can disagree, and in a band they are one.Polyline,layered-layout's: straight legs from point to point, and its line jumps (where it hops over an edge it crosses). That the bends are right angles is not in the type: that engine's routes through nested groups are joined at the group's boundary and may slant by a pixel or two there, so right angles are a promise an engine makes and a law checks (RoutesOrthogonal), not a constructor.Spline, Graphviz dot's (Stemma): cubic Bézier pieces end to end.
NO ROUTE WITHOUT A LINE. Each constructor has a first point and at least
one more (a NonEmptyArray of pieces, or a to), so an edge that is
placed has somewhere to be drawn; an engine that cannot route an edge
leaves the edge out, and the law that every edge is placed says so. The
trial's unrouted measure counted polylines of fewer than two points;
there is no such value now.
MEASURING. flatten is the one rule by which every route becomes
straight pieces: a straight piece is its two ends, a cubic piece is
curveSteps (12) straight pieces, and a cubic whose four points lie on
one line is one. It is the trial's rule (it read the same pieces back
from the path string), kept so that its figures stand. A polyline's
jumps are ink, not geometry: they are drawn and not measured.
#Ink Source
data InkHow a ribbon is drawn: as broad as it is, or as a line of this stroke
down its middle. Least (0.7) is the one stated exception to breadth
being data: a ribbon too thin to be seen (its breadth is still the
data's, and still the room it takes on its nodes) is drawn as a line of
this stroke, broader than it is, and is not to scale. The tree marks
it so, and Laws.notToScale lists it.
Constructors
Instances
#curveSteps Source
curveSteps :: IntStraight pieces to a cubic piece.
#svgPath Source
svgPath :: Route -> StringA route as the d of an SVG path: absolute M, L and C, and for a
polyline's jumps A. A jump is drawn as a half circle of hopRadius
where it lies on a leg with that much of the leg clear on either side
of it (of the leg's ends and of the jump before); a jump with less room
is passed straight through.
#sweptPath Source
sweptPath :: Point -> Route -> StringA ribbon as the d of the area it sweeps (0.5): its span on its
source, carried along its centre line to its span on its target. across
is one pixel across the flow ({ x: 0, y: 1 } where the flow runs left
to right, { x: 1, y: 0 } top-down); the outline is the centre line set
half the breadth to one side, the end, and the centre line set half the
breadth to the other side and run backwards, closed. So both ends are
flat on their nodes' sides, and the area is exactly its breadth across
the flow all the way, however much it slants, which a line stroked as
broad as the ribbon is not: a stroke is broad across the line. A route
that is no ribbon has no breadth to sweep, and its path is svgPath's.
- Modules
- Hylograph.
Flow. Render. Columns - Hylograph.
Flow. Render. Continuity - Hylograph.
Flow. Render. Engine - Hylograph.
Flow. Render. Internal. Bands - Hylograph.
Flow. Render. Keys - Hylograph.
Flow. Render. Laws - Hylograph.
Flow. Render. Layout - Hylograph.
Flow. Render. Measures - Hylograph.
Flow. Render. Motion - Hylograph.
Flow. Render. Present - Hylograph.
Flow. Render. Reshape - Hylograph.
Flow. Render. Route - Hylograph.
Flow. Render. Sankey - Hylograph.
Flow. Render. Signal - Hylograph.
Flow. Render. Text - Hylograph.
Flow. Render. Transition - Hylograph.
Flow. Render. Tree - Hylograph.
Flow. Render. Unfold