Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to strike-through text in dot language (graphviz)

Tags:

graphviz

dot

I am trying to find out how can I strike-through some text in my nodes in dot based graphviz diagrams?

I checked out on this page, but couldn't figure out: http://www.graphviz.org/doc/info/attrs.html

Googling around didn't help as well.

Consider this diagram, these are basically bug numbers from a bugzilla. The red nodes represent closed bugs, but I do not want to color code them like this. Obviously striken-through 511272 is more intuitive than a red colored node 511272.

enter image description here

If anyone knows how to strike-through text inside nodes, please share. thanks,

Shobhit

like image 203
bits Avatar asked Aug 06 '12 18:08

bits


People also ask

What language does Graphviz use?

Abstract grammar for defining Graphviz nodes, edges, graphs, subgraphs, and clusters. Terminals are shown in bold font and nonterminals in italics. Literal characters are given in single quotes.

What is the DOT language called?

Braille, universally accepted system of writing used by and for blind persons and consisting of a code of 63 characters, each made up of one to six raised dots arranged in a six-position matrix or cell.

How do I open a DOT file in graphviz?

For windows: dl the msi and install; Find gvedit.exe in your programs list; Open . dot file in question; Click running person on toolbar; Go to graph -> settings ; change Output file type to file type of your liking and press ok..

How do I test my graphviz?

Run "dot -V" from the command prompt. If GraphViz is installed and configured you'll get it's version.


1 Answers

Graphviz does not have a styling of its own to do this, but since it is Unicode you can use the technique with combining characters and "combining long stroke overlay" (U+0336) that the wikipedia article on strikethrough suggests:

In plain text scenarios where markup cannot be used, Unicode offers a number of combining characters that achieve similar effects. The "long stroke overlay" (U+0336) results in an unbroken stroke across the text,

  • Separate: A̶B̶C̶D̶E̶F̶G̶H̶I̶
  • Combined: A̶B̶C̶D̶E̶F̶G̶H̶I̶

This graph:

digraph G {
    a [label="1̶2̶3̶4̶5̶"]
    b [label="54321"]
    a->b
}

Renders this png output with graphviz 2.23.6:

graphviz example with unicode strikethrough

like image 121
Anders Lindahl Avatar answered Sep 23 '22 03:09

Anders Lindahl