Skip to content

thebrain10 .json to .dot visualization (Graphviz)

Notifications You must be signed in to change notification settings

swarma/thebrain2dot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thebrain2dot

TheBrain10 .json (File>Export>JSON Files ) to .dot visualization with Graphviz

  • Python 3 support
  • UTF-8 support
  • Nodes (thoughts.json)
    • support shapes, colors
    • size depends on PageRank centrality
  • Links (links.json)
    • support types, directions, colors
  • Layout
    • support layout (algorithm), splines
  • Useful Reference

Before:

thebrain10 screenshot

After:

More Complicated Example:

API

Example: see test/test.py

brain_json2dot(thoughts_path, links_path, dot_path='thebrain.dot', png_path='thebrain.png', 
                layout='dot', bg_color='grey22', node_shape='circle', node_color='white', 
                edge_default_color='white', edge_splines='', edge_font_size=10)

The Function will output both .dot file + .png file), recommended Tool for .dot: MS Code + Graphviz Interactive Preview

Dependency

Graphviz

Ubuntu:

apt install -y graphviz

Windows: TODO

Pygraphviz

Ubuntu:

apt-get install -y graphviz-dev
pip install pygraphviz

Windows: TODO

Chinese Fonts (If Chinese is not correctly shown in the visualization)

Ubuntu:

apt-get install -y fonts-wqy-microhei

TODO

  • Doc: parsing of thebrain10's thoughts.json & links.json
  • Dev: publish package to PYPI
  • Parsing: correct color mapping (thebrain exported json seems to have bugs about color)
  • Layout: label / tag
  • Layout: parent / sibling location restriction in visualization
  • Layout: community detection

About

thebrain10 .json to .dot visualization (Graphviz)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%