Module

Hylograph.Internal.Selection.Operations.Selection

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

Core Selection API

Entry points for creating and querying DOM selections. These are the primary functions users interact with for data binding.

#select Source

select :: forall m datum. MonadEffect m => String -> m (Selection SEmpty Element datum)

Select a single element matching the CSS selector

Returns an empty selection (no data bound). The datum type is polymorphic and will be inferred from usage. This is typically the starting point for data binding.

Example:

svg <- select "svg"
circles <- renderData Circle [1, 2, 3] "circle" svg ...

#selectElement Source

selectElement :: forall m datum. MonadEffect m => Element -> m (Selection SEmpty Element datum)

Select from a DOM element directly

This is useful for framework integration (React, Vue, etc.) where you have a reference to a DOM element rather than a CSS selector.

Example:

selectElement element >>= renderTree myVisualization

#selectAll Source

selectAll :: forall state parent parentDatum datum m. MonadEffect m => String -> Selection state parent parentDatum -> m (Selection SEmpty Element datum)

Select all elements matching the CSS selector within a parent selection

Returns an empty selection (no data bound yet). The datum type is polymorphic and will be inferred from usage. Use this for nested selections.

Example:

svg <- select "svg"
groups <- selectAll "g" svg

#selectAllWithData Source

selectAllWithData :: forall state parent parentDatum datum m. MonadEffect m => String -> Selection state parent parentDatum -> m (Selection SBoundOwns Element datum)

Select all elements matching selector and extract their bound data

Use this when selecting child elements that have inherited data from their parent. This is necessary when you want to use the selection with transitions that need access to the bound data (like withTransitionStaggered).

Example:

-- After creating nodes with appendChildInheriting
groups <- selectSimulationGroups
circles <- selectAllWithData "circle" groups.nodes
withTransitionStaggered config delayFn circles [fill colorByDepth]
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