dotparse-0.1.0.0: dot language parsing and printing.
Safe HaskellSafe-Inferred
LanguageGHC2021

DotParse.Examples.NumHask

Description

Example of Dot graph construction for the NumHask class heirarchy.

Synopsis

Documentation

>>> import DotParse
>>> import Chart
>>> import Optics.Core
>>> :set -XOverloadedStrings
>>> :set -XOverloadedLabels

data Dependency Source #

A class dependency.

Constructors

Dependency 

Fields

dependencies :: [Dependency] Source #

List of all dependencies (as at v0.11)

classesNH :: [Class] Source #

List of classes to use in diagram.

classesModule :: [(Class, Text)] Source #

Names of the modules where each class is located.

dependenciesNH :: [Dependency] -> [Dependency] Source #

List of dependencies to draw.

graphNHG :: Graph Class Source #

NumHask Classes as an algebraic graph

toLinkNH :: ID -> Text Source #

Convert a node ID to a label for chart-svg charts Doing this directly in dot doesn't quite work because the engines get the width of the link wrong.

dotGraphNH :: Directed -> Graph Source #

NumHask statements in a dot Graph with box shapes for the nodes.

g <- processGraph (dotGraphNH Directed)
writeChartOptions "other/nh.svg" (graphToChartWith (defaultChartConfig & set #chartVshift (-4) & set #textSize 12) toLinkNH g)