Skip to content

Conversation

@tim-at-topos
Copy link
Contributor

@tim-at-topos tim-at-topos commented Dec 12, 2025

Enriching the theory of stock-flow diagrams to have positive and negative links, instead of merely links. Includes a mass-action simulation analysis.

@tim-at-topos tim-at-topos added the enhancement New feature or request label Dec 12, 2025
@tim-at-topos tim-at-topos marked this pull request as draft December 12, 2025 17:52
@github-actions github-actions bot temporarily deployed to netlify-preview December 12, 2025 17:52 Destroyed
@tim-at-topos tim-at-topos force-pushed the signed-links-for-stock-flow branch from debe992 to 6385bac Compare December 12, 2025 17:56
@github-actions github-actions bot temporarily deployed to netlify-preview December 12, 2025 17:57 Destroyed
@github-actions github-actions bot temporarily deployed to netlify-preview December 15, 2025 12:18 Destroyed
@tim-at-topos
Copy link
Contributor Author

@epatters I'm trying to get + and - to appear on positive / negative links in the visualisation, and it's proving very frustrating. What's currently confusing me even more is the file svg_styles.module.css, which seems to tell me that links should be blue and rectangles should be a delightful ube colour, but this isn't what's happening in reality. Any suggestions?

@github-actions github-actions bot temporarily deployed to netlify-preview December 15, 2025 12:37 Destroyed
@tim-at-topos tim-at-topos force-pushed the signed-links-for-stock-flow branch from b2c42d0 to 76be97f Compare December 15, 2025 12:43
@github-actions github-actions bot temporarily deployed to netlify-preview December 15, 2025 12:43 Destroyed
@tim-at-topos tim-at-topos force-pushed the signed-links-for-stock-flow branch from 76be97f to 3908d5c Compare December 15, 2025 14:38
@github-actions github-actions bot temporarily deployed to netlify-preview December 15, 2025 14:39 Destroyed
@tim-at-topos tim-at-topos force-pushed the signed-links-for-stock-flow branch from 3908d5c to 0a71db0 Compare December 15, 2025 14:46
@github-actions github-actions bot temporarily deployed to netlify-preview December 15, 2025 14:46 Destroyed
@tim-at-topos tim-at-topos marked this pull request as ready for review December 15, 2025 18:16
@epatters epatters added frontend TypeScript frontend and Rust-wasm integrations core Rust core for categorical logic and general computation labels Dec 16, 2025
Copy link
Member

@epatters epatters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tim, this looks great so far!

My only major request is that we create a new theory in the frontend rather than replacing the old one. There are at least three reasons for this:

  1. It won't break any existing models that use the old theory
  2. More importantly, it's consistent with our philosophy of having a family of languages of increasing expressiveness and complexity, with migrations between them, like we've done with CLDs. (As we've discussed, the UX for these migrations currently isn't great, but that's a separate problem.)
  3. More importantly still, in my perusal of stock-flow diagrams in the wild, the links very often don't have signs, and thus keeping the old theory around is a way of respecting the tradition while still being able to go beyond it

@epatters
Copy link
Member

epatters commented Dec 16, 2025

@epatters I'm trying to get + and - to appear on positive / negative links in the visualisation, and it's proving very frustrating. What's currently confusing me even more is the file svg_styles.module.css, which seems to tell me that links should be blue and rectangles should be a delightful ube colour, but this isn't what's happening in reality. Any suggestions?

Argh, there appears to be a regression on next in

  • coloring places in a Petri net
  • coloring links in a stock-flow diagram on next.

On prod they look fine. @kasbah, I wonder if this is an unintended consequence of #888? I don't have time to investigate right now.

But note @tim-at-topos that the fun ube color is specific to places in Petri nets: the CSS selector is .place rect. However, making the links be blue should work and, until recently, did.

@kasbah
Copy link
Member

kasbah commented Dec 16, 2025

On prod they look fine. @kasbah, I wonder if this is an unintended consequence of #888? I don't have time to investigate right now.

My observations differ. Importantly I don't see any regression from prod to next.

  • Petri net place borders are colored everywhere (prod, next, loaclhost/main)
  • Petri net fill is set to transparent on localhost but colored on main
screenshots image image image

There is a conflict between .node rect { fill: transparent; } set in visualization/graph_svg.css and fill: #e6e6ff set in svg_styles.module.css. Presumably development and production servers result in different resolution order.

  • Stock and flow links are not colored anywhere (prod, next, localhost/main)
image

EDIT: This is also due to a similar conflict. It can be worked around with !important.

I made an issue for it: #913

@github-actions github-actions bot temporarily deployed to netlify-preview December 16, 2025 18:43 Destroyed
@tim-at-topos tim-at-topos force-pushed the signed-links-for-stock-flow branch from 1f67b98 to 6ecb11b Compare December 16, 2025 18:46
@github-actions github-actions bot temporarily deployed to netlify-preview December 16, 2025 18:46 Destroyed
@epatters
Copy link
Member

Presumably development and production servers result in different resolution order.

That must be it, although I do see different behavior in prod and next/local for Petri nets. In any case, I've got a fix in #915.

@epatters epatters changed the title Signed links for stock-flow Stock-flow diagrams with signed links Dec 17, 2025
Copy link
Member

@epatters epatters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! @tim-at-topos, I made a few small cleanups (see new commits).

I've also rebased off main, which includes my fixes to the CSS for SVG graph visualizations (#915). However, instead of delaying further, I'm going to merge this as-is and let you follow up with a PR to add the positive/negative signs to the stock-flow visualization. Thanks!

@epatters epatters merged commit 5579937 into main Dec 17, 2025
19 checks passed
@epatters epatters deleted the signed-links-for-stock-flow branch December 17, 2025 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Rust core for categorical logic and general computation enhancement New feature or request frontend TypeScript frontend and Rust-wasm integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants