chesschart

Difference between version 8 and 9 - Previous - Next
<<toc>>

----

**Name**

''chesschart'' - widget to create flowcharts using chess coordinates or other user declared coordinate systems.

**Description**

[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.

**Links**

    * Homepage: https://github.com/mittelmark/DGTcl
    * Download: https://github.com/mittelmark/DGTcl/tree/master/lib/chesschart
    * Manual: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/chesschart/chesschart.html
    * Tutorial: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/chesschart/doc/intro.html
    * Tcl2020 conference video: https://www.youtube.com/watch?v=lfIPM5eyuVA&t=970s
    * Version: 0.2 - 2020-12-03
    * License: MIT

**Example**

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
======

**Image**

Below is an image of the running application.

[chesschart-image]

----

**See also**

   * [snidgets] (Snit widgets)

----

**Discussion**

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: http://htmlpreview.github.io/?https://github.com/mittelmark/DGTcl/blob/master/lib/chesschart/doc/intro.html%|%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 suggession. 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.

<<categories>> Package | Widget | Snit Widgets