Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Graph (dot) functions.
Synopsis
- s_classify :: (t -> Bool) -> (t -> Bool) -> ([t] -> Bool) -> [t] -> Bool
- is_symbol :: String -> Bool
- is_number :: String -> Bool
- maybe_quote :: String -> String
- type Dot_Key = String
- type Dot_Value = String
- type Dot_Attr = (Dot_Key, Dot_Value)
- dot_attr_pp :: Dot_Attr -> String
- dot_attr_seq_pp :: [Dot_Attr] -> String
- dot_attr_ext :: [Dot_Attr] -> [Dot_Attr] -> [Dot_Attr]
- type Dot_Type = String
- type Dot_Attr_Set = (Dot_Type, [Dot_Attr])
- dot_attr_set_pp :: Dot_Attr_Set -> String
- type Dot_Meta_Key = String
- type Dot_Meta_Attr = (Dot_Meta_Key, Dot_Value)
- dot_key_sep :: Dot_Meta_Key -> (Dot_Type, Dot_Key)
- dot_attr_collate :: [Dot_Meta_Attr] -> [Dot_Attr_Set]
- dot_attr_def :: (String, String, Double, String) -> [Dot_Meta_Attr]
- type Graph_Pp v e = ((Int, v) -> [Dot_Attr], ((Int, Int), e) -> [Dot_Attr])
- gr_pp_label_m :: Maybe (v -> Dot_Value) -> Maybe (e -> Dot_Value) -> Graph_Pp v e
- gr_pp_label :: (v -> Dot_Value) -> (e -> Dot_Value) -> Graph_Pp v e
- gr_pp_label_v :: (v -> Dot_Value) -> Graph_Pp v e
- br_csl_pp :: Show t => [t] -> String
- data Graph_Type
- g_type_to_string :: Graph_Type -> String
- g_type_to_edge_symbol :: Graph_Type -> String
- node_pos_attr :: (Show n, Real n) => (n, n) -> Dot_Attr
- edge_pos_attr :: Real t => [(t, t)] -> Dot_Attr
- edge_pos_attr_1 :: Real t => ((t, t), (t, t), (t, t), (t, t)) -> Dot_Attr
- lbl_to_dot :: Graph_Type -> [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> [String]
- lbl_to_udot :: [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> [String]
- lbl_to_udot_wr :: FilePath -> [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> IO ()
- fgl_to_dot :: Graph gr => Graph_Type -> [Dot_Meta_Attr] -> Graph_Pp v e -> gr v e -> [String]
- fgl_to_udot :: Graph gr => [Dot_Meta_Attr] -> Graph_Pp v e -> gr v e -> [String]
- dot_to_ext :: [String] -> FilePath -> FilePath -> IO ()
- dot_to_svg :: [String] -> FilePath -> IO ()
Util
s_classify :: (t -> Bool) -> (t -> Bool) -> ([t] -> Bool) -> [t] -> Bool Source #
Classify s using a first element predicate, a remainder predicate and a unit predicate.
is_symbol :: String -> Bool Source #
Symbol rule.
map is_symbol ["sym","Sym2","3sym","1",""] == [True,True,False,False,False]
is_number :: String -> Bool Source #
Number rule.
map is_number ["123","123.45",".25","1.","1.2.3",""] == [True,True,False,True,False,False]
maybe_quote :: String -> String Source #
Attr/Key
dot_attr_seq_pp :: [Dot_Attr] -> String Source #
Format sequence of Dot_Attr.
dot_attr_seq_pp [("layout","neato"),("epsilon","0.0001")]
type Dot_Attr_Set = (Dot_Type, [Dot_Attr]) Source #
(type,[attr])
dot_attr_set_pp :: Dot_Attr_Set -> String Source #
Format Dot_Attr_Set.
a = ("graph",[("layout","neato"),("epsilon","0.0001")]) dot_attr_set_pp a == "graph [layout=neato,epsilon=0.0001]"
type Dot_Meta_Key = String Source #
type:attr (type = graph|node|edge)
type Dot_Meta_Attr = (Dot_Meta_Key, Dot_Value) Source #
dot_key_sep :: Dot_Meta_Key -> (Dot_Type, Dot_Key) Source #
Keys are given as "type:attr".
dot_key_sep "graph:layout" == ("graph","layout")
dot_attr_collate :: [Dot_Meta_Attr] -> [Dot_Attr_Set] Source #
Collate Dot_Key attribute set to Dot_Attr_Set.
dot_attr_def :: (String, String, Double, String) -> [Dot_Meta_Attr] Source #
Default values for default meta-keys.
k = dot_attr_def ("neato","century schoolbook",10,"plaintext") map dot_attr_set_pp (dot_attr_collate k)
Graph
type Graph_Pp v e = ((Int, v) -> [Dot_Attr], ((Int, Int), e) -> [Dot_Attr]) Source #
Graph pretty-printer, (v -> [attr],e -> [attr])
gr_pp_label_m :: Maybe (v -> Dot_Value) -> Maybe (e -> Dot_Value) -> Graph_Pp v e Source #
Make Graph_Pp value given label functions for vertices and edges.
gr_pp_label_v :: (v -> Dot_Value) -> Graph_Pp v e Source #
Label V only.
g_type_to_string :: Graph_Type -> String Source #
node_pos_attr :: (Show n, Real n) => (n, n) -> Dot_Attr Source #
Generate node position attribute given (x,y) coordinate.
edge_pos_attr :: Real t => [(t, t)] -> Dot_Attr Source #
Edge POS attributes are sets of cubic bezier control points.
edge_pos_attr_1 :: Real t => ((t, t), (t, t), (t, t), (t, t)) -> Dot_Attr Source #
Variant that accepts single cubic bezier data set.
lbl_to_dot :: Graph_Type -> [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> [String] Source #
lbl_to_udot :: [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> [String] Source #
lbl_to_udot_wr :: FilePath -> [Dot_Meta_Attr] -> Graph_Pp v e -> Lbl v e -> IO () Source #
fgl_to_dot :: Graph gr => Graph_Type -> [Dot_Meta_Attr] -> Graph_Pp v e -> gr v e -> [String] Source #
fgl_to_udot :: Graph gr => [Dot_Meta_Attr] -> Graph_Pp v e -> gr v e -> [String] Source #
Dot-Process
dot_to_ext :: [String] -> FilePath -> FilePath -> IO () Source #
Run dot to generate a file type based on the output file extension (ie. .svg, .png, .jpeg, .gif) -n must be given to not run the layout algorithm and to use position data in the dot file.
dot_to_svg :: [String] -> FilePath -> IO () Source #
dot_to_ext
generating .svg filename by replacing .dot extension with .svg