Module

Hylograph.Shape.Arc

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

Pure PureScript Arc Generator

Creates SVG path data for circular/annular sectors (pie slices, donut segments). No D3 dependency - pure trigonometry.

Usage

import Hylograph.Shape.Arc (arcPath, ArcDatum)

-- Pie slice (inner radius = 0)
let path = arcPath { innerRadius: 0.0, outerRadius: 100.0 }
      { startAngle: 0.0, endAngle: Math.pi / 2.0 }

-- Donut segment (inner radius > 0)
let path = arcPath { innerRadius: 50.0, outerRadius: 100.0 }
      { startAngle: 0.0, endAngle: Math.pi / 2.0 }

Angles are in radians, with 0 at 12 o'clock, increasing clockwise. This matches D3's convention.

#ArcConfig Source

type ArcConfig = { innerRadius :: Number, outerRadius :: Number }

Configuration for arc generation (static per chart)

#ArcDatum Source

type ArcDatum = { endAngle :: Number, startAngle :: Number }

Per-slice data (typically from pie layout)

#arcPath Source

arcPath :: ArcConfig -> ArcDatum -> String

Generate SVG path data for an arc sector

The path creates a "pie slice" or "donut segment" shape:

  • Outer arc from startAngle to endAngle
  • Line (or inner arc) back to start

Angles follow D3 convention: 0 = 12 o'clock, increasing clockwise.

#arcPathWithCenter Source

arcPathWithCenter :: Number -> Number -> ArcConfig -> ArcDatum -> String

Generate arc path centered at a specific point

#degreesToRadians Source

degreesToRadians :: Number -> Number

Convert degrees to radians

#tau Source

tau :: Number

Full circle in radians

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