graphviz - Multiline tooltip for pydot graph -


i add multiline tool-tip nodes in graph generating using pydot. here doing:

node = pydot.node('abc', style='filled', fillcolor='#ccff00', fontsize=12) txt = 'foo' + '\n' + 'test' node.set_tooltip(txt) 

the tool tip see appears "foo\ntest'

i appreciate help.

thanks abhijit

it seems new line character supported labels , names (newline in node label in dot (graphwiz) language), tool tips put directly resultant html, not see "\n" special character.

using direct character codes alternative. (see formatting & ascii control codes)

node = pydot.node('abc', style='filled', fillcolor='#ccff00', fontsize=12)  # specify html carriage return (\r) and/or line feed (\n) characters directly txt = 'foo' + '
' + test'  node.set_tooltip(txt) 

or simple pre-processing allow keep '\n' form:

node.set_tooltip(txt.replace('\n', '
')) 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -