Skip to content

Allow user to specify placement of nodes #9

@rfriedman22

Description

@rfriedman22

When there is a bidirectional edge in a cell_state_graph, there can be some strange placements of nodes. For example, in the below plot, the node labeled "retina, gabaergic amacrine" is placed above "retinal neuron precursor" because of the bidirectional edge:
Image

In reality, it would be better for the gabaergic amacrine node to be placed below the neuron precursor node. This is what happens when I plot the state graph using the old function plot_cell_state_annotations():
Image

The difference is likely because plot_cell_state_annotations() draws two directed edges while new_cell_state_graph() draws a single undirected edge, which changes how the graph layout is set.

It would be nice if the user can specify what level certain nodes should be placed on so they can force the graph layout to be a certain way, e.g.:

tribble(
  ~cell_state, ~layer,
  "retinal neuron precursor", 3,
  "retina, gabaergic amacrine", 4
)

A similar method (which might be better) is to require that all leaf nodes are drawn in a single row at the bottom, root nodes drawn at the top, and then let the layout algorithm figure out where to put the rest of the nodes given those constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions