class GraphViz
module Constants
RGV_VERSION = "1.2.5"
FORMATS = [
"bmp",
"canon",
"dot",
"xdot",
"cmap",
"dia",
"eps",
"fig",
"gd",
"gd2",
"gif",
"gtk",
"hpgl",
"ico",
"imap",
"cmapx",
"imap_np",
"cmapx_np",
"ismap",
"jpeg",
"jpg",
"jpe",
"mif",
"mp",
"pcl",
"pdf",
"pic",
"plain",
"plain-ext",
"png",
"ps",
"ps2",
"svg",
"svgz",
"tga",
"tiff",
"tif",
"vml",
"vmlz",
"vrml",
"vtx",
"wbmp",
"xlib",
"none"
]
PROGRAMS = [
"dot",
"neato",
"twopi",
"fdp",
"circo",
"sfdp"
]
GRAPHTYPE = [
"digraph",
"graph",
"strict digraph"
]
def self.getAttrsFor( x )
list = {}
GENCS_ATTRS.each { |k,v|
list[k] = v[:type] if x.match( v[:usedBy] ) and not list.keys.include?(k)
}
list
end
GENCS_ATTRS = {
"Damping" => { :usedBy => "G", :type => :GvDouble },
"K" => { :usedBy => "GC", :type => :GvDouble },
"URL" => { :usedBy => "ENGC", :type => :EscString },
"_background" => { :usedBy => "G", :type => :EscString },
"area" => { :usedBy => "NC", :type => :GvDouble },
"arrowhead" => { :usedBy => "E", :type => :ArrowType }, "arrowsize" => { :usedBy => "E", :type => :GvDouble },
"arrowtail" => { :usedBy => "E", :type => :ArrowType }, "bb" => { :usedBy => "G", :type => :Rect }, "bgcolor" => { :usedBy => "GC", :type => :Color }, "center" => { :usedBy => "G", :type => :GvBool }, "charset" => { :usedBy => "G", :type => :EscString }, "class" => { :usedBy => "ENCG", :type => :EscString }, "clusterrank" => { :usedBy => "G", :type => :EscString }, "color" => { :usedBy => "ENC", :type => :ColorList }, "colorscheme" => { :usedBy => "ENCG", :type => :EscString }, "comment" => { :usedBy => "ENG", :type => :EscString }, "compound" => { :usedBy => "G", :type => :GvBool }, "concentrate" => { :usedBy => "G", :type => :GvBool }, "constraint" => { :usedBy => "E", :type => :GvBool }, "decorate" => { :usedBy => "E", :type => :GvBool }, "defaultdist" => { :usedBy => "G", :type => :GvDouble },
"dim" => { :usedBy => "G", :type => :EscString }, "dimen" => { :usedBy => "G", :type => :EscString }, "dir" => { :usedBy => "E", :type => :EscString }, "diredgeconstraints" => { :usedBy => "G", :type => :EscString }, "distortion" => { :usedBy => "N", :type => :GvDouble },
"dpi" => { :usedBy => "G", :type => :GvDouble },
"edgeURL" => { :usedBy => "E", :type => :EscString },
"edgehref" => { :usedBy => "E", :type => :EscString },
"edgetarget" => { :usedBy => "E", :type => :EscString },
"edgetooltip" => { :usedBy => "E", :type => :EscString },
"epsilon" => { :usedBy => "G", :type => :GvDouble },
"esep" => { :usedBy => "G", :type => :EscString }, "fillcolor" => { :usedBy => "NEC", :type => :Color }, "fixedsize" => { :usedBy => "N", :type => :GvBool }, "fontcolor" => { :usedBy => "ENGC", :type => :Color }, "fontname" => { :usedBy => "ENGC", :type => :EscString }, "fontnames" => { :usedBy => "G", :type => :EscString }, "fontpath" => { :usedBy => "G", :type => :EscString }, "fontsize" => { :usedBy => "ENGC", :type => :GvDouble },
"forcelabels" => { :usedBy => "G", :type => :GvBool}, "gradientangle" => { :usedBy => "NCG", :type => :EscString }, "group" => { :usedBy => "N", :type => :EscString }, "headURL" => { :usedBy => "E", :type => :EscString },
"head_lp" => { :usedBy => "E", :type => :EscString }, "headclip" => { :usedBy => "E", :type => :GvBool }, "headhref" => { :usedBy => "E", :type => :EscString },
"headlabel" => { :usedBy => "E", :type => :EscString }, "headport" => { :usedBy => "E", :type => :EscString }, "headtarget" => { :usedBy => "E", :type => :EscString },
"headtooltip" => { :usedBy => "E", :type => :EscString },
"height" => { :usedBy => "N", :type => :GvDouble },
"href" => { :usedBy => "ENGC", :type => :EscString },
"id" => { :usedBy => "ENG", :type => :EscString },
"image" => { :usedBy => "N", :type => :EscString }, "imagepath" => { :usedBy => "G", :type => :EscString }, "imagescale" => { :usedBy => "N", :type => :EscString }, "inputscale" => { :usedBy => "G", :type => :GvDouble },
"label" => { :usedBy => "ENGC", :type => :LblString },
"labelURL" => { :usedBy => "E", :type => :EscString },
"label_scheme" => { :usedBy => "G", :type => :EscString }, "labelangle" => { :usedBy => "E", :type => :GvDouble },
"labeldistance" => { :usedBy => "E", :type => :GvDouble },
"labelfloat" => { :usedBy => "E", :type => :GvBool }, "labelfontcolor" => { :usedBy => "E", :type => :Color }, "labelfontname" => { :usedBy => "E", :type => :EscString }, "labelfontsize" => { :usedBy => "E", :type => :GvDouble },
"labelhref" => { :usedBy => "E", :type => :EscString },
"labeljust" => { :usedBy => "GC", :type => :EscString }, "labelloc" => { :usedBy => "GCN", :type => :EscString }, "labeltarget" => { :usedBy => "E", :type => :EscString },
"labeltooltip" => { :usedBy => "E", :type => :EscString },
"landscape" => { :usedBy => "G", :type => :GvBool }, "layer" => { :usedBy => "ENC", :type => :EscString }, "layerlistsep" => { :usedBy => "G", :type => :EscString }, "layers" => { :usedBy => "G", :type => :EscString }, "layerselect" => { :usedBy => "G", :type => :EscString }, "layersep" => { :usedBy => "G", :type => :EscString }, "layout" => { :usedBy => "G", :type => :EscString }, "len" => { :usedBy => "E", :type => :GvDouble },
"levels" => { :usedBy => "G", :type => :EscString }, "levelsgap" => { :usedBy => "G", :type => :GvDouble },
"lhead" => { :usedBy => "E", :type => :EscString }, "lheight" => { :usedBy => "GC", :type => :GvDouble },
"lp" => { :usedBy => "EGC", :type => :EscString }, "ltail" => { :usedBy => "E", :type => :EscString }, "lwidth" => { :usedBy => "GC", :type => :GvDouble },
"margin" => { :usedBy => "NGC", :type => :EscString }, "maxiter" => { :usedBy => "G", :type => :EscString }, "mclimit" => { :usedBy => "G", :type => :GvDouble },
"mindist" => { :usedBy => "G", :type => :GvDouble },
"minlen" => { :usedBy => "E", :type => :EscString }, "mode" => { :usedBy => "G", :type => :EscString }, "model" => { :usedBy => "G", :type => :EscString }, "mosek" => { :usedBy => "G", :type => :GvBool }, "newrank" => { :usedBy => "G", :type => :EscString }, "nodesep" => { :usedBy => "G", :type => :GvDouble },
"nojustify" => { :usedBy => "GCNE", :type => :GvBool }, "normalize" => { :usedBy => "G", :type => :GvBool }, "nslimit" => { :usedBy => "G", :type => :GvDouble },
"nslimit1" => { :usedBy => "G", :type => :GvDouble },
"ordering" => { :usedBy => "GN", :type => :EscString }, "orientation" => { :usedBy => "NG", :type => :GvDouble }, "outputorder" => { :usedBy => "G", :type => :EscString }, "overlap" => { :usedBy => "G", :type => :EscString }, "overlap_scaling" => { :usedBy => "G", :type => :GvDouble },
"overlap_shrink" => { :usedBy => "G", :type => :GvBool },
"pack" => { :usedBy => "G", :type => :EscString }, "packmode" => { :usedBy => "G", :type => :EscString }, "pad" => { :usedBy => "G", :type => :EscString }, "page" => { :usedBy => "G", :type => :EscString }, "pagedir" => { :usedBy => "G", :type => :EscString }, "pencolor" => { :usedBy => "C", :type => :Color }, "penwidth" => { :usedBy => "CNE", :type => :GvDouble },
"peripheries" => { :usedBy => "NC", :type => :EscString }, "pin" => { :usedBy => "N", :type => :GvBool }, "pos" => { :usedBy => "EN", :type => :SplineType }, "quadtree" => { :usedBy => "G", :type => :GvBool }, "quantum" => { :usedBy => "G", :type => :GvDouble },
"rank" => { :usedBy => "S", :type => :EscString }, "rankdir" => { :usedBy => "G", :type => :EscString }, "ranksep" => { :usedBy => "G", :type => :EscString }, "ratio" => { :usedBy => "G", :type => :EscString }, "rects" => { :usedBy => "N", :type => :Rect }, "regular" => { :usedBy => "N", :type => :GvBool }, "remincross" => { :usedBy => "G", :type => :GvBool }, "repulsiveforce" => { :usedBy => "G", :type => :GvDouble },
"resolution" => { :usedBy => "G", :type => :GvDouble },
"root" => { :usedBy => "GN", :type => :EscString }, "rotate" => { :usedBy => "G", :type => :EscString }, "rotation" => { :usedBy => "G", :type => :GvDouble },
"samehead" => { :usedBy => "E", :type => :EscString }, "sametail" => { :usedBy => "E", :type => :EscString }, "samplepoints" => { :usedBy => "G", :type => :EscString }, "scale" => { :usedBy => "G", :type => :EscString }, "searchsize" => { :usedBy => "G", :type => :EscString }, "sep" => { :usedBy => "G", :type => :EscString }, "shape" => { :usedBy => "N", :type => :EscString }, "shapefile" => { :usedBy => "N", :type => :EscString }, "showboxes" => { :usedBy => "ENG", :type => :EscString }, "sides" => { :usedBy => "N", :type => :EscString }, "size" => { :usedBy => "NG", :type => :EscString }, "skew" => { :usedBy => "N", :type => :GvDouble },
"smoothing" => { :usedBy => "G", :type => :EscString }, "sortv" => { :usedBy => "GCN", :type => :EscString }, "splines" => { :usedBy => "G", :type => :EscString }, "start" => { :usedBy => "G", :type => :EscString }, "style" => { :usedBy => "ENCG", :type => :EscString }, "stylesheet" => { :usedBy => "G", :type => :EscString }, "tailURL" => { :usedBy => "E", :type => :EscString },
"tail_lp" => { :usedBy => "E", :type => :EscString }, "tailclip" => { :usedBy => "E", :type => :GvBool }, "tailhref" => { :usedBy => "E", :type => :EscString },
"taillabel" => { :usedBy => "E", :type => :EscString }, "tailport" => { :usedBy => "E", :type => :EscString }, "tailtarget" => { :usedBy => "E", :type => :EscString },
"tailtooltip" => { :usedBy => "E", :type => :EscString },
"target" => { :usedBy => "ENGC", :type => :EscString }, "tooltip" => { :usedBy => "NEC", :type => :EscString },
"truecolor" => { :usedBy => "G", :type => :GvBool }, "vertices" => { :usedBy => "N", :type => :EscString }, "viewport" => { :usedBy => "G", :type => :EscString }, "voro_margin" => { :usedBy => "G", :type => :GvDouble },
"weight" => { :usedBy => "E", :type => :GvDouble },
"width" => { :usedBy => "N", :type => :GvDouble },
"xdotversion" => { :usedBy => "G", :type => :EscString },
"xlabel" => { :usedBy => "EN", :type => :LblString },
"xlp" => { :usedBy => "EN", :type => :EscString }, "z" => { :usedBy => "N", :type => :GvDouble }
}
GRAPHSATTRS = GraphViz::Constants::getAttrsFor( /G|S|C/ )
NODESATTRS = GraphViz::Constants::getAttrsFor( /N/ )
EDGESATTRS = GraphViz::Constants::getAttrsFor( /E/ )
end
end