Giter Club home page Giter Club logo

blockdiag's Introduction

blockdiag generate block-diagram image file from spec-text file.

drone.io CI build status Latest PyPI version Number of PyPI downloads

Features

  • Generate block-diagram from dot like text (basic feature).
  • Multilingualization for node-label (utf-8 only).

You can get some examples and generated images on blockdiag.com .

Setup

Use pip:

$ sudo pip install blockdiag

If you want to export as PDF format, give pdf arguments:

$ sudo pip install "blockdiag[pdf]"

Copy and modify ini file. example:

$ cp <blockdiag installed path>/blockdiag/examples/simple.diag .
$ vi simple.diag

Please refer to spec-text setting sample section for the format of the simpla.diag configuration file.

spec-text setting sample

Few examples are available. You can get more examples at blockdiag.com .

simple.diag

simple.diag is simply define nodes and transitions by dot-like text format:

diagram admin {
  top_page -> config -> config_edit -> config_confirm -> top_page;
}

screen.diag

screen.diag is more complexly sample. diaglam nodes have a alternative label and some transitions:

diagram admin {
  top_page [label = "Top page"];

  foo_index [label = "List of FOOs"];
  foo_detail [label = "Detail FOO"];
  foo_add [label = "Add FOO"];
  foo_add_confirm [label = "Add FOO (confirm)"];
  foo_edit [label = "Edit FOO"];
  foo_edit_confirm [label = "Edit FOO (confirm)"];
  foo_delete_confirm [label = "Delete FOO (confirm)"];

  bar_detail [label = "Detail of BAR"];
  bar_edit [label = "Edit BAR"];
  bar_edit_confirm [label = "Edit BAR (confirm)"];

  logout;

  top_page -> foo_index;
  top_page -> bar_detail;

  foo_index -> foo_detail;
               foo_detail -> foo_edit;
               foo_detail -> foo_delete_confirm;
  foo_index -> foo_add -> foo_add_confirm -> foo_index;
  foo_index -> foo_edit -> foo_edit_confirm -> foo_index;
  foo_index -> foo_delete_confirm -> foo_index;

  bar_detail -> bar_edit -> bar_edit_confirm -> bar_detail;
}

Usage

Execute blockdiag command:

$ blockdiag simple.diag
$ ls simple.png
simple.png

Requirements

  • Python 2.7, 3.5 or later
  • Pillow 2.2.1 or later
  • funcparserlib 0.3.6 or later
  • reportlab (optional)
  • wand and imagemagick (optional)
  • setuptools

License

Apache License 2.0

blockdiag's People

Contributors

cdevienne avatar dridi avatar gchriz avatar legoktm avatar msnoigrs avatar nakamuray avatar rmoro avatar shimizukawa avatar shirou avatar surgo avatar tk0miya avatar

Watchers

 avatar

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.