Skip to content

Feature Brainstorm: Automatic model diagrams #10

@billdenney

Description

@billdenney

Automatic model diagrams would be hard to get right, but I think that we could possibly get close (good enough for most reports and giving the user something to work from in any case). This will be oriented toward PK/PD models, and it should work okay with PK combined to a single PD model, I think.

Here is how I'm thinking of it:

  • Any dosing compartment goes on the top (detected based on dosing records in the data. Compartments then connect down from there.
  • The next row would follow compartments that receive transport from the dosing compartment (detected by being in the differential equations and having a plus sign on the term with the dosing compartment amount)
  • Anything with bidirectional transport from the central compartment goes to the left of the central compartment (fanning up and down if there are more than one)
  • Any unidirectional transport out of the central compartment should be clearance, and it should go below that.
  • Any interaction with the central compartment that does not affect mass transport (e.g. an effect compartment) would go to the right. These would be assumed to be a PD model.
  • Input compartments to the PD model would go above and outputs would go below.

I think that all of this could be automated. The way that I'm doing it right now would add dependencies of tidygraph and ggraph.

An example is in thomasp85/ggraph#316 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions