canmod / macpan2helpers

GNU General Public License v3.0
0 stars 0 forks source link

small vis issues with open systems #4

Open bbolker opened 1 year ago

bbolker commented 1 year ago

(I don't think I have push access to this repo - may I get it?)

library(macpan2)
library(macpan2helpers)
## with birth (D0)/death (D) distinct
sir1 <- Compartmental("examples/sir_open1")
visCompartmental(sir1)
## with all fake compartments distinct
sir2 <- Compartmental("examples/sir_open2")
visCompartmental(sir2)

Setting up an 'open' SIR model (with births/deaths) with separate fake birth and death compartments gives this:

Screenshot from 2023-06-24 19-09-57

all the correct arrows are actually there, and can be seen if you manipulate the diagram by dragging the boxes around, but the hierarchical layout doesn't do anything about trying to position bins so that arrows don't coincide

Adding a separate fake compartment for birth (D0) and each death flow (D1, D2, D3) gives something prettier (but doing this is annoying)

Screenshot from 2023-06-24 19-11-24

This is obviously low priority but might be something for a small student project (i.e. see if there's any way to adapt the visNetwork layout algorithms so we can get something that works better out of the box ...)

stevencarlislewalker commented 1 year ago

Thanks @bbolker. I think that this is related to https://github.com/canmod/macpan2/issues/56.