Skip to content

qk9000/Control-Diagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please look forward to a big version upgrade !

Simple Diagram Maker

An easy, alterable, boundless, interconnected, versatile, efficient, intuitive and extensible diagram-generator from text.

Example 1

./ControlDiagram.sh example/exmaple1.txt

20211229_142333

Example 2

./ControlDiagram.sh example/exmaple2.txt

20211229_135103

Example 3

./ControlDiagram.sh example/example3.txt

20211228_140518

Example 4

./ControlDiagram.sh -c example/code.c example/code2.c

20211228_140756

Example 5

Automatically draw the call diagram

./ControlDiagram.sh -d LR -c code/linux/kernel/sched/core_sched.c

Example 6

A swimlane diagram that can represent a time sequence

./ControlDiagram.sh -s example/example4.txt

Introduction

In design and development, engineering, notes, documents, and drawings are usually related, but spatially isolated; It's a bit of a headache to draw in a complex way, to switch angles, to do a lot of repetitive work, and possibly to modify, tweak, and refactor constantly.

Control Flow hopes to help users really improve efficiency, synchronously complete these several things, and guide users to produce certain forms of output in the process of research, design and development, and play the role of complementation, induction and feedback. You want to make documentation and drawings useful from the start.

If you don't want to intervention and control, need only simple program for graphical automatically, and does not focus on the content of drawings, this tool may be more suitable for you: [SciTools]understandCodeQuery: A code-understanding, code-browsing or code-search toolCodeViz: A CallGraph Visualiser (github.com)

If you prefer to draw first and automatically generate code frames, these tools may be for you : Flowgorithm - Flowchart Programming Languagehttps://www.gituml.com/、 Code Generation - Turn Your Diagram to Code - Software Ideas Modeler

If you want to use a sophisticated IDE with industry-approved tools

: Enterprise Architect (Personal opinion: not a fan of UML, more concerned with communicating intent in an appropriate and understandable way );light weight free tool recommend Umbrello、亿图 and Topology

If you want to add personality and variety to your drawings in more detail, these tools may be for you: GitHub - jgraph/drawio-desktop: Official electron build of diagrams.netyEd - Graph Editor (yworks.com)

If you want to inspect any of the existing open source tools again: GitHub - antvis/G6: ♾ A Graph Visualization Framework in JavaScriptGitHub - mingrammer/diagrams: Diagram as Code for prototyping cloud system architecturesGitHub - adrai/flowchart.js: Draws simple SVG flow chart diagrams from textual representation of the diagram 、PlantUML、Mermaid、Graphviz and other Markdown tools

Setup

Based on shell,graphviz,and cflow(only for c code)。

Debian-based:

apt install gawk graphviz cflow

Windows-base:

Based on MingW or Cygwin, and please refer to the folder “for windows” for packages you need:

Option 1,

cd [Directory of this program]
export PATH=`pwd`/for_windows:$PATH

Option 2,

Or simply copy cflow exe file into “C:\Windows\System32\”.

Options

-d <[TB|LR]> - direction (default is TB) (example: '-d LR')
-D <num> - depth
-f <name> - function name (-f '' means all functions)
-F <string [string]> - strings to filter out
-c <code-file> - input file is raw code
-s enable swimlane, recommend direction from top to bottom
-S disable swimlane
-r reverse flow as order as called by

Grammar

Indent can be used by 4 spaces or one Tab.

Use space as delimiter for symbols, connections, prefix, postfix

symbol effection
(Just indent) invoke flow(Program)or associate(UML)
symbol effection
+ heading module(support multiple '+', i.e. multiple nested modules),but cross-module connections should not be under it
: condition
< invoked flow(Program)or associated by(UML)
~ asynchronous transmission(Program)or depend(UML)
<~ backward asynchronous transmission(Program)or depended by(UML)
# comment
! customize color (default/red/blue/green/yellow/orange/pink/gray/purple)
- queue up with no line
-- queue up with line
= link
{ aggregation(UML)
{{ composition(UML)
^ extend(UML)
^^ implement(UML)
connection effection
/_ subcell (can have multiple ones)
/| paracell (can have multiple ones)
// text one the line
/- wrap to next line (can have multiple ones)
prefix declare internal cell
<alias> define an alias of the subcell or paracell
postfix reference internal cell
/> alias refer to a subcell or paracell

Specify and change style by starting with annotation symbol "#" or "//" at anywhere in runtime

symbol effection
# -s enable swimlane, recommend direction from top to bottom
# -S disable swimlane
# -d LR direction is from left to right
# -d TB direction is from top to bottom

About

An easy, alterable, boundless, interconnected, versatile, efficient, intuitive and extensible diagram-generator from text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published