morazanm / fsm

A DSL for the Automata Theory Classroom
15 stars 6 forks source link

Bug: Edges on nested subgraphs #99

Open jschappel opened 1 year ago

jschappel commented 1 year ago

Overview

Adding nested subgraph edges does not work as expected. It currently just references to outer most subgraph.

Steps to Reproduce

#lang racket
(require "lib.rkt")

(define base-graph (add-nodes (create-graph 'test #:atb (hash 'compound #t)) 
                              '(message_queue)))

(define sg2 (add-node (create-subgraph #:name 'clusterWorker #:atb(hash 'label "Worker Thread" 'fontsize 20))
                      'radiogpt_worker))

(define sub-graph (add-nodes (create-subgraph #:name 'clusterTasks #:atb (hash 'label "Tasks" 'fontsize 20))
                             #:atb(hash 'shape 'none)
                             '(build_script translate replace_symbols replace_phonetics build_audio callback)))

(define final (add-edges (add-subgraph base-graph (add-subgraph sg2 sub-graph))
                         '((clusterTasks "" radiogpt_worker)
                           (radiogpt_worker "" clusterTasks)
                           (message_queue "" radiogpt_worker))))

(graph->png final
            (current-directory)
            "test"
            #:clean #f)