Module

Hylograph.Components.Mark

Package
purescript-hylograph-components
Repository
afcondon/purescript-hylograph-components

Point-mark shapes for scatter-style charts.

One ADT, one pure render function. Each shape is drawn centered on {cx, cy} with a notional radius — meaning the distance from centre to the farthest vertex / edge. No attempt is made to equalise perceived area across shapes (a triangle with the same circumscribed radius as a circle looks smaller by area). That is D3's behaviour too; if it matters for a given chart, adjust encoding.radius per shape on the caller side.

Cross is a plus sign. Bar thickness is a fixed 35% of radius; if and when a caller wants a configurable bar width or an "×" variant, extend the ADT (MarkCrossAt, MarkEx, etc.) rather than retrofitting a second parameter on Cross.

All shapes ultimately resolve to a single HATS Tree element — Circle, Rect, or Polygon. The caller wraps in withBehaviors for hover / tooltip; this module has no opinion on interactivity.

#MarkProps Source

type MarkProps = { className :: String, cx :: Number, cy :: Number, fill :: String, radius :: Number, stroke :: String, strokeWidth :: Number }