Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /MLRISC/trunk/visualization/graphLayout.sml
ViewVC logotype

Annotation of /MLRISC/trunk/visualization/graphLayout.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2126 - (view) (download)

1 : monnier 411 (*
2 :     * Here are some graph layout annotations.
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 : monnier 245 structure GraphLayout =
8 :     struct
9 :    
10 : monnier 469 datatype format =
11 :     LABEL of string
12 :     | COLOR of string
13 :     | NODE_COLOR of string
14 :     | EDGE_COLOR of string
15 :     | TEXT_COLOR of string
16 :     | ARROW_COLOR of string
17 :     | BACKARROW_COLOR of string
18 :     | BORDER_COLOR of string
19 :     | BORDERLESS
20 :     | SHAPE of string
21 :     | ALGORITHM of string
22 :     | EDGEPATTERN of string
23 :     | DIR (* for internal use only! *)
24 : monnier 245
25 : monnier 469 val STYLE = Annotations.new(SOME(fn _ => "STYLE")) :
26 :     format list Annotations.property
27 : monnier 245
28 :     type ('n,'e,'g) style =
29 : monnier 469 { edge : 'e Graph.edge -> format list,
30 :     node : 'n Graph.node -> format list,
31 :     graph : 'g -> format list
32 : monnier 245 }
33 :    
34 : monnier 469 type layout = (format list, format list, format list) Graph.graph
35 : monnier 245
36 :     fun makeLayout {node,edge,graph} G =
37 :     IsomorphicGraphView.map node edge graph G
38 :    
39 : monnier 469 fun makeLayout' G =
40 :     let val edgeColor = [COLOR "red"]
41 :     in makeLayout {node=fn (i,_) => [LABEL(Int.toString i)],
42 :     edge=fn _ => edgeColor,
43 :     graph=fn _ => []} G
44 :     end
45 : monnier 245 end
46 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0