fadno-braids-0.1.3: Braid representations in Haskell

Safe HaskellNone
LanguageHaskell2010

Fadno.Braids.Graphics

Description

Diagrams for braids.

Synopsis

Documentation

data DrawConf Source #

Configure braid/strand drawing.

Constructors

DrawConf 

Fields

Instances
Default DrawConf Source # 
Instance details

Defined in Fadno.Braids.Graphics

Methods

def :: DrawConf #

renderBraid :: Braid b a => DrawConf -> [BraidDrawF a] -> FilePath -> b a -> IO () Source #

Draw a braid with specified stepWidth and draw decorators.

type BraidDrawF a = [Strand a] -> [Diagram B] -> [Diagram B] Source #

Modify braid drawing, with strand data and diagrams.

renderStrand :: Integral a => DrawConf -> [StrandDrawF a] -> FilePath -> Colour Double -> Strand a -> IO () Source #

Draw a strand with specified stepWidth, color, and draw decorators.

type StrandDrawF a = Strand a -> Diagram B -> Diagram B Source #

Modify a single-strand drawing, with strand and diagram.

colorStrands :: BraidDrawF a Source #

Color a braid's strands separately.

colorLoops :: forall a. (Eq a, Show a) => BraidDrawF a Source #

Color a braid's loops, such that looped strands have the same color.

gridStrand :: Integral a => StrandDrawF a Source #

Draw a grid behind a single strand.

renderBraids :: Braid b a => DrawConf -> [BraidDrawF a] -> FilePath -> [[b a]] -> IO () Source #

Draw rows and columns of braids with specified stepWidth and draw decorators.

randomBraid :: Int -> IO (MultiGen Int) Source #

Create a roughly square braid with specified strand count.