-
Notifications
You must be signed in to change notification settings - Fork 6
Stylesheet Processor
The stylesheet processor is integrated with Euler Toolkit and is being used for visualizing input/output graphs but it can also be used as an standalone tool set. It gets a plain graph (in Euler CleanTax format or a pre-defined Yaml-based format) as well as a stylesheet (in a pre-defined Yaml format) and generates a dot file for the graph.
-
c2y - takes a CleanTax file as input and outputs it in Euler output Yaml format
-
y2d - takes a Euler output Yaml file as input and outputs a dot file
To apply the stylesheet file on a graph use the following command (The default inputs are "data.yaml" and "stylesheet.yaml"):
cat data.yaml | y2d -s [stylesheetfile.yaml] > [result.dot]
Example. Input visualization
cat [cleantaxfile.txt] | ./c2y | ./y2d -s [stylesheetfile.yaml] > [result.dot]
- Nodes:
Nodes are defined using two keys: concept, group. Example:
1.A:
concept: A
group: 1
- Edges:
Edges are defined using 4 keys: label, s (source), t (target), w (penwidth). w is optional. Example:
1.F_2.B:
label: overlaps
s: 1.F
t: 2.B
w: '1'
- Graph:
Currently we are using only one graph property (PW: number of possible worlds). New properties can be added as the need comes
Graph:
PW: 6
-
graphstyle:
-
Graph attributes for dot file. Example:
graph: "rankdir=TB"
(ifrankdir = LR
, in the the "second" taxonomy source and target will be swapped with backward "isa" edges, so that the two taxonomies face each other) -
subgraph: a switch for subgraph. Example:
subgraph: "on"
If the value of subgraph is “on”, nodes will be clustered based on their “group” in the output dot file. Anything other than “on” (e.g. “off”) means no subgraph in the output. -
legend: a switch similar to subgraph
If the value of legend is not "off", a table showing the number of nodes an edges will be added to the output dot file. The placement of this table depends on the value of legend: "source" places it before the first node in the output and "sink" place it after the last node -
wcolor: a switch for converting penwidth to edge color using PW (number of possible worlds)
-
wmap: a switch for penwidth scaling. The value "on" here means the penwidths in the input graph get mapped to the speified range in the stylesheet.
-
wmin, wmax: range of penwidth
Note: penwidth ("w") in the input graph is an optional key so if penwidth is not defined for an edge, when scaling the penwith values, the code assumes pendiwth of 1 for that edge. -
nodestyle:
Maps each “group” to a dot string. Example:
'1': "shape=box style=\"filled,rounded\" color=black fillcolor=\"#CCFFCC\""
"all" style is applied to all of the nodes but it can be overwritten by the style defined for each node group. -
edgestyle:
Maps each “label” to a dot string.
There are 3 options for showing label that are defined by assigning the following values to "display" key in edgestyle -
(w)display: show penwidth as label
-
“label”: show the label from data file
-
"[displaystring]": show the specified string as label (special caseL: "" means no label)
If the value of "penwidth" is on and "w" is defined in the datafile, the penwidth of edges is assigned accordingly. "w" is set to 1 if it is not defined in the data file. Example:
label: "isa"
dot: "style=solid color=black"
display: "(w)display"
Also, "(w)display" means apply the penwidth value
“default” style will be applied if no style is defined for a node group or edge label.
"all" style is applied to all of the edges but it can be overwritten by the style defined for each label.
The default stylesheets for running Euler are in folder default_stylesheet/. Users can customize their own stylesheets. In order to do this, simple copy and paste all stylesheets in this default_stylesheet/ folder to a separate subfolder "stylesheets/" in the folder of input example, and then customize them.
- Disable the legends
Open the corresponding stylesheet yaml file need to be changed, switch legend "off" under "graphstyle".
graphstyle:
graph: "rankdir=LR"
face2face: "on"
subgraph: "off"
legend: "off"
- Change styles of nodes in input or possible worlds visualizations:
The stylesheet file "inputstyle.yaml" (for input visualization) and "rcgstyle.yaml" (for possible worlds visualization) show the formats as:
nodestyle:
all: "shape=circle style=filled fillcolor=\"#FFFFFF\""
"1": "shape=box style=filled fillcolor=\"#CCFFCC\""
"2": "shape=octagon style=filled fillcolor=\"#FFFFCC\""
"3": "shape=box style=filled fillcolor=\"#CCCCFF\""
"4": "shape=box style=filled fillcolor=\"#FFCCCC\""
"5": "shape=box style=filled fillcolor=\"#CCFFFF\""
default: "shape=circle style=filled fillcolor=\"#FFFFFF\""
where the numbers ("1", "2", "3", "4", "5") represent the taxonomies in input ("1" represents the first taxonomy from input file, "2" represents the second, and so on), "all" and "default" represents the styles of nodes in general case. User may change the nodes style of corresponding taxonomy by adding the constraints between the double quotes, or add their own style entry for particular taxonomy.
change the fonts to "Helvetica" for nodes from first taxonomy
"1": "shape=box style=filled fillcolor=\"#CCFFCC\" fontname=\"helvetica\""
add an entry line for a particular taxonomy "myTax" under "nodestyle"
"myTax": "shape=box style=filled fillcolor=\"#CCFFCC\" fontname=\"helvetica\""
- Change styles of edges:
Similar to change on nodes, change the styles of edges of corresponding group:
Disable the arrow head of the articulation edge in input visualization: open "inputstyle.yaml", change it as follows:
label: "Art."
dot: "style=dotted color=\"#AA00FF\" constraint=true penwidth=3 arrowhead=none"
display: "label"
penwidth: "off"
This wiki and the README contain information that you need to get started with using EulerX toolkit.
If you have any question or comments, please contact Shizhuo Yu at szyu@ucdavis.edu.