Module

Hylograph.Interpreter.SemiQuine

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

SemiQuine Interpreter

Converts a BuilderTree to compilable PureScript code using the Tree API. Generates code that uses T.named, T.elem, T.withChild, and T.joinData.

Named "SemiQuine" because it generates PureScript code from a data structure that represents PureScript code - a quine-ish concept, but not a true quine.

Two variants:

  • treeToCode (this module): works on BuilderTree (fully inspectable)
  • TreeToCode.treeToCode: works on actual Tree datum (evaluates functions) Import separately: import Hylograph.Interpreter.SemiQuine.TreeToCode

#treeToCode Source

treeToCode :: BuilderTree -> String

Convert a BuilderTree to compilable PureScript code Now generates evalAttr syntax for true round-trip capability

Re-exports from Hylograph.Interpreter.SemiQuine.Types

#NodeId Source

type NodeId = Int

Unique identifier for nodes in the builder tree

#BuilderTree Source

data BuilderTree

The builder tree structure

Constructors

Instances

#BuilderNode Source

type BuilderNode = { attributes :: Array AttributeBinding, elementType :: String, expanded :: Boolean, id :: NodeId, name :: Maybe String }

A node in the builder tree (editable form)

#AttributeChoice Source

data AttributeChoice

How an attribute value is determined. This is the key abstraction that avoids runtime PureScript compilation.

Constructors

Instances

#AttributeBinding Source

type AttributeBinding = { attrName :: String, choice :: AttributeChoice }

An attribute binding: which attribute + how to get its value

#emptyNode Source

emptyNode :: NodeId -> String -> BuilderNode

Create an empty node of a given type

#defaultAttributesFor Source

defaultAttributesFor :: String -> Array AttributeBinding

Default attributes based on element type

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