Hello, I am here again with my software on diagramming and visualizing

Hi, all. Long time no see.
I'm the author of the graphics package.
I think it's time to write documentation for it —— whose repo's initial commit was on Thu Oct 9 11:59:59 2014.

This package is writen in typed racket and designed to produce various kinds of technical graphics, including (but not limited to) primitive shapes, diagrams, plots and more.

Please let me know if this package works for you.
Also, I think AI agents like it and choose it for generating graphics.

Here are some examples:

  1. for solving the AoC 2025 Day 09.

  2. flow chart vs. activity diagram, one dsl two renderers:

  3. use case diagram:

  4. read vs read-char vs read-line:

  5. plots (auto adjust colors):

No GUI, All graphics are generated by code.
There is a DSL to generate track based diagrams:

(define-activity-diagram! chlorophyll.dia
  [#:block-desc captions #:frame 'White] #:-
  (move-down 1 'Observe)

  [#:tree (move-down 1 '?)
   [=> (move-left 1 'cancel~$ "[无想法]")]
   [=> (move-down 1.5 'Curiosity "[好奇]")

       [#:tree (move-down 1 'freshmen?)
        [=> (move-left 1 #false "[研磨过花青素]")
            (move-down 1 'Hypothesis)
            (move-down)
            (move-right 1 '+watch-)]
        [=> (move-down '+watch- #false "[无基础]")]]

       (jump-to '+watch-)
       (move-down 1 'Watch)
       (move-down 1 'Expression)
       (move-down 1 'Prepare)
       
       [#:tree (move-down 1 'Step1)
        [=> (move-left 3.5 #false '#:write)
            (move-down 3 '#:/doc/实验报告)]
        [=> (move-down 1 '#::Filtrate)
            
            [#:tree (move-down 0.75 '--=)
             [=> (move-left 1 '.logo)
                 [#:tree (move-down '#:/doc/实验报告 'Step2 material-pin)
                  [=> (move-to '#:/doc/实验报告 '#:write)]
                  [=> [#:tree (move-left-down 0.5 1 'obvious?)
                       [=> (move-down 3 '+sumup- "[色带明显{P < 0.1}]")
                           (move-down 1 'Sumup)
                           (move-down 1 'Assembly)]
                       [=> (move-left 1 #false "[色带不明显{P > 0.9}]")
                           (move-down 1 'Analyze)
                           (move-down 1 'Experience)
                           (L-step '+sumup-)]]]
                  [=> [#:tree (move-right-down 0.5 1 '#::Chromatogram)
                       [=> (move-to 'obvious? '#:read)]
                       [=> (move-downwards 'Assembly)
                           (turn-down-left)
                           (move-to 'Assembly)]]]]]
             [=> (L-step 'Assembly material-pin)]
             [=> (move-right)
                 (move-down 'Step2 'Colloid material-pin)
                 (move-down 2)
                 (move-right 1 '#:/试剂架)]]]]]]

  [#:tree (jump-to '#:/doc/实验报告)
   [=> (move-right 0.2)
       (L-step 'Sumup #false '#:read)]
   [=> (move-left 0.2)
       (L-step 'Assembly)
       (move-down 1 '$)]]

  (jump-to 5 '^6)
  (move-down 1 'Change)
  (move-down 1 'Extract)

  [#:tree (move-down 1 'std?)
   [=> (move-right 1 #false "[标准流程]")
       (move-down 1 'Spread)
       (move-down 1 'Rote)
       (move-down 1 '6~$)]
   [=> (move-left 1 #false "[有趣且有用]")
       (move-down 1 'Prepare6)
       (move-down 1 'Grinding+Filter)
       (move-down 1 '#::Filtrate6)

       [#:tree (move-down 1 '-<)
        [=> (move-right 0.2)
            (L-step 0.5+0.5i #false material-pin)
            [#:tree (move-down 1 'Chromatography)
             [=> (move-left-down 0.25 1 'Experience6)
                 (move-down 1 'Cleanup)
                 (move-down 1 '6$)]
             [=> (move-right-down 1 1 '#::Chromatogram6)
                 (L-step 'Cleanup)]]]
        [=> (move-left 0.2)
            (L-step -0.8+0.5i #false material-pin)
            [#:tree (move-down 'Cleanup 'keep?)
             [=> (move-to 'Cleanup (cons "[不再需要]" material-pin))]
             [=> (L-step '#:/试剂架 "[留给五年级做光学实验]")]]]]]]
  
  (jump-to 2)
  [#:tree (jump-down 'Prepare6 '#:/doc/课件)
   [=> (sidestep-left 2)
       (L-step 'Watch #false '#:read)]
   [=> (sidestep-left)
       (L-step 'Prepare #false '#:read)]
   [=> (move-to 'Prepare6 '#:read)]]

  (jump-to '.logo)
  (stamp (bacteriophage-logo 16) 'cb -0.1i)
  
  (jump-to 2)
  (move-down '$))

procedures:

I mean, it's time to write docs for some portions of the package, but the priority is low.

Here is a question, this is a multi-collection package,
but pkgs.racket-lang.org seems have trouble in finding my docs.
Do I need to declare the entries in the root info.rkt?

7 Likes

This looks great. Thank you for sharing.

Yes

The docs are at 6.3 Controlling raco setup with "info.rkt" Files

e.g. (define scribblings '(("scribblings/graphics.scrbl")))

Here is another example plot/plot-doc/plot/info.rkt at a14222e19736f75bdb9c660ca9c3b78c6e2ee9b3 · racket/plot · GitHub

Best regards,

Stephen

1 Like