Module

Hylograph.Transform

Package
purescript-hylograph-selection
Repository
afcondon/purescript-hylograph-selection

Generic element transformation based on bound data

Provides a type-safe way to update attributes on DOM elements based on their D3-bound data. Used for animations and position updates.

Example:

-- Update circle positions during animation
transformCircles "#viz" \node ->
  { cx: lerp 0.0 node.treeX progress
  , cy: lerp 0.0 node.treeY progress
  }

-- Update line positions
transformLines "#viz" \link ->
  { x1: lerp 0.0 link.sourceX progress
  , y1: lerp 0.0 link.sourceY progress
  , x2: lerp 0.0 link.targetX progress
  , y2: lerp 0.0 link.targetY progress
  }

#transformCircles Source

transformCircles :: forall d. String -> (d -> CirclePosition) -> Effect Unit

Transform circle elements by updating cx/cy based on bound data

#transformLines Source

transformLines :: forall d. String -> (d -> LinePosition) -> Effect Unit

Transform line elements by updating x1/y1/x2/y2 based on bound data

#transformPaths Source

transformPaths :: forall d. String -> (d -> String) -> Effect Unit

Transform path elements by updating d attribute based on bound data

#transformGroups Source

transformGroups :: forall d. String -> String -> (d -> String) -> Effect Unit

Transform group elements by updating transform attribute based on bound data

#transformGroupsById Source

transformGroupsById :: String -> String -> String -> (Int -> Maybe Point) -> Effect Unit

Transform groups by ID lookup: update transform using a position lookup function

#transformGroupsByName Source

transformGroupsByName :: String -> String -> String -> (String -> Maybe Point) -> Effect Unit

Transform groups by NAME lookup: update transform using a position lookup function

#setGroupsOpacityById Source

setGroupsOpacityById :: String -> String -> String -> (Int -> Maybe Number) -> Effect Unit

Set opacity on groups by ID lookup

#setViewBox Source

setViewBox :: String -> Number -> Number -> Number -> Number -> Effect Unit

Set viewBox on an SVG element

#clearContainer Source

clearContainer :: String -> Effect Unit

Clear all child elements from a container

#removeElement Source

removeElement :: String -> Effect Unit

Remove an element from the DOM entirely

#CirclePosition Source

type CirclePosition = { cx :: Number, cy :: Number }

Position for circle elements

#LinePosition Source

type LinePosition = { x1 :: Number, x2 :: Number, y1 :: Number, y2 :: Number }

Position for line elements

#Point Source

type Point = { x :: Number, y :: Number }

Point position for group transforms

Modules
Data.DependencyGraph
Hylograph.AST
Hylograph.Axis.Axis
Hylograph.Brush
Hylograph.Brush.FFI
Hylograph.Brush.Types
Hylograph.Classify
Hylograph.Data.Graph
Hylograph.Data.Graph.Algorithms
Hylograph.Data.Node
Hylograph.Data.Tree
Hylograph.Expr.Animation
Hylograph.Expr.Attr
Hylograph.Expr.Datum
Hylograph.Expr.Expr
Hylograph.Expr.Friendly
Hylograph.Expr.Integration
Hylograph.Expr.Interpreter.CodeGen
Hylograph.Expr.Interpreter.Eval
Hylograph.Expr.Interpreter.Meta
Hylograph.Expr.Interpreter.PureSVG
Hylograph.Expr.Interpreter.SVG
Hylograph.Expr.Path
Hylograph.Expr.Path.Generators
Hylograph.Expr.Sugar
Hylograph.Expr.Units
Hylograph.HATS
Hylograph.HATS.Friendly
Hylograph.HATS.InterpreterTick
Hylograph.HATS.Transitions
Hylograph.Interaction.Brush
Hylograph.Interaction.Coordinated
Hylograph.Interaction.Pointer
Hylograph.Interaction.Zoom
Hylograph.Internal.Attribute
Hylograph.Internal.Behavior.FFI
Hylograph.Internal.Behavior.Types
Hylograph.Internal.Capabilities.Selection
Hylograph.Internal.Capabilities.Transition
Hylograph.Internal.FFI
Hylograph.Internal.Selection.Join
Hylograph.Internal.Selection.Operations
Hylograph.Internal.Selection.Operations.Conversions
Hylograph.Internal.Selection.Operations.Helpers
Hylograph.Internal.Selection.Operations.Selection
Hylograph.Internal.Selection.Query
Hylograph.Internal.Selection.Types
Hylograph.Internal.Transition.FFI
Hylograph.Internal.Transition.Manager
Hylograph.Internal.Transition.Scene
Hylograph.Internal.Transition.Types
Hylograph.Internal.Types
Hylograph.Interpreter.D3
Hylograph.Interpreter.English
Hylograph.Interpreter.Mermaid
Hylograph.Interpreter.MetaAST
Hylograph.Interpreter.SemiQuine
Hylograph.Interpreter.SemiQuine.TreeToCode
Hylograph.Interpreter.SemiQuine.Types
Hylograph.Render
Hylograph.Scale
Hylograph.Scale.FP
Hylograph.Shape.Arc
Hylograph.Shape.Pie
Hylograph.Shape.Polygon
Hylograph.Tooltip
Hylograph.Transform
Hylograph.TreeDSL
Hylograph.TreeDSL.ShapeTree
Hylograph.Unified
Hylograph.Unified.Attribute
Hylograph.Unified.DataDSL
Hylograph.Unified.Display
Hylograph.Unified.Examples
Hylograph.Unified.Join
Hylograph.Unified.Sugar