Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize composition patterns for open models #381

Open
epatters opened this issue Feb 4, 2025 · 1 comment
Open

Visualize composition patterns for open models #381

epatters opened this issue Feb 4, 2025 · 1 comment
Labels
enhancement New feature or request frontend TypeScript frontend and Rust-wasm integrations visualization Visualization and plotting

Comments

@epatters
Copy link
Member

epatters commented Feb 4, 2025

These are undirected wiring diagrams (UWDs), defined implicitly by variable sharing, as familiar from the @relation macro in Catlab.

In Catlab, UWDs are visualized using Graphviz. That's always an option, and we're already using Graphviz to visualize the generating graph of a model, but I'm hoping we can do better. Specifically, we should investigate Elkjs (#133), which has native support for nested diagrams and will hopefully do better with the outer box of wiring diagrams than Graphviz.

@epatters epatters added enhancement New feature or request frontend TypeScript frontend and Rust-wasm integrations visualization Visualization and plotting labels Feb 4, 2025
@epatters
Copy link
Member Author

epatters commented Feb 5, 2025

ELK does pretty well on this basic UWD, the composition pattern corresponding to the (undirected) composition of, say, two binary relations.

The source:

algorithm: layered
//hierarchyHandling: INCLUDE_CHILDREN

node outer {
    portConstraints: FIXED_SIDE
    port px {
        ^port.side: EAST
    }
    port pz {
        ^port.side: EAST
    }

    node n1 {
        portConstraints: FIXED_SIDE

        port px {
            ^port.side: EAST
        }
        port py {
            ^port.side: EAST
        }
    }
    node n2 {
        portConstraints: FIXED_SIDE

        port py {
            ^port.side: EAST
        }
        port pz {
            ^port.side: EAST
        }
    }

    node j1 {
        layout [ size: 5,5 ]
    }

    edge n1.px -> outer.px
    edge n1.py -> j1

    edge n2.py -> j1
    edge n2.pz -> outer.pz
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend TypeScript frontend and Rust-wasm integrations visualization Visualization and plotting
Projects
Status: No status
Development

No branches or pull requests

1 participant