chesschart - widget to create flowcharts using chess coordinates or other user declared coordinate systems.
DDG 2020-11-08: chesschart is a snit widget based on the Tk canvas widget to create in an easy way nice flowcharts using standard chess coordinates or other user defined coordinate systems.
Below a simple example to create a flowchart:
package require chesschart set demo [chesschart .chart -background white] pack $demo -side top -fill both -expand true $demo rect C5 -text "Chesschart" -width 140 -height 60 -color beige $demo oval A3 ;# default -text is coordinate, default -color is salmon $demo oval A1 ;# with -text string you can overwrite the text, etc. $demo oval B2 -color grey80 $demo oval C2 -color grey80 $demo oval D3 -color grey80 $demo oval D1 -color "light blue" $demo arrow A3 B2 -width 5 $demo arrow A1 B2 -width 5 $demo arrow B2 C2 -width 5 $demo arrow C2 D3 -width 5 $demo arrow C2 D1 -width 5 $demo arrow D3 D1 -width 5 $demo line C5 A3 # standard canvas commands still work $demo move all -20 -400
Below is an image of the running application.
Please discuss here ...
DDG - 2020-11-20: chesschart was in fact created as a toy example for presenting the tmdoc::tmdoc literate programming tool at the 2020 Tcl/Tk Conference. The complete presentations can be seen on youtube here: https://www.youtube.com/watch?v=lfIPM5eyuVA
DDG - 2020-12-03: version 0.2 fixes the pkgIndex.tcl file, adds colors for lines, splines, user defined coordinate systems and adds a background argument to allow canvas::snap create always figures of the same size. An tutorial made with tmdoc::tmdoc was added as well: tutorial
chw - 2020-12-03: very nice! What about adding a constructor option and respective additional logic to alternatively use the tkpath canvas widget? The immediate benefit is antialiased rendering for Windows and POSIX platforms and potentially alpha blending for canvas elements. High quality PDF output should be possible, too.
DDG - 2020-12-03: Great suggestion. Thanks. I never used tkpath before, it seems to be compatible with the canvas widget, so I can check in the constructor if tkpath is available and if yes, use this instead of the standard canvas. Seems as well that I then can snap the image directly to a PNG or even a PDF even without canvas::snap. I put this on my TODO list.
chw - 2020-12-03: But please be aware that you have to use the tkpath specific item types (e.g. pline, prect, ptext, etc.) in order to get antialiased effects and alpha blending since the original item types are still drawn with the platform's standard methods, i.e. Windows GDI or POSIX Xlib. Only for the p* items GDIplus or Cairo are used.