15

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

4

2 に答える 2

16

Graphviz にはこれを行うための独自のスタイル設定はありませんが、Unicode であるため、文字を組み合わせたり、取り消し線に関するウィキペディアの記事 (U+0336) を組み合わせたりする手法使用できます。

マークアップを使用できないプレーン テキストのシナリオでは、Unicode は、同様の効果を実現する多数の結合文字を提供します。「ロング ストローク オーバーレイ」(U+0336) は、テキスト全体に途切れのないストロークをもたらします。

  • 別:A̶B̶C̶D̶E̶F̶G̶H̶I̶
  • 組み合わせ: A—B—C—D—E—F—G—H—I—

このグラフ:

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

このpng出力をgraphviz 2.23.6でレンダリングします:

Unicode の取り消し線を使用した Graphviz の例

于 2012-08-19T18:44:29.323 に答える