Coder Social home page Coder Social logo

thebrain2dot's Introduction

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

Before:

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)

Dependencies

Graphviz

Ubuntu:

apt install -y graphviz

Windows:

TODO

Pygraphviz

Ubuntu:

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

Windows:

TODO

Networkx

pip install networkx

Fonts (When Necessary)

If a language involving non-ascii characters is not correctly shown in the visualization, try to install corresponding fonts.

Example (for Chinese):

Ubuntu:

apt-get install -y fonts-wqy-microhei

TODO

  • Doc: parsing of thebrain10's thoughts.json & links.json
  • Doc: Windows / Mac installation
  • Dev: SVG
  • Dev: publish package to PYPI
  • Dev: 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.