Plot a hierarchy for each layer

Hello,
I have a nested model of a graph with layers.
I’d like to plot the circular layout hierarchy. In addition to the whole graph, I’d like to have a separate plot for every layer of the hierarchy, including only layer-specific vertexes, retaining the vertex positions (and colors) assigned in the whole plot.
How this can be done? More in general, would it be enough to set a vertex filter on the state.g graph?

Nevermind, I found that building a list of edges matching the layer property and passing that to draw_hierarchy does the job.

Yes, that works!

You could also copy the NestedBlockState object with a graph that only has the edges of a particular layer:

# ec is the edge property that encodes the layers
lstate = state.copy(g=GraphView(state.g, efilt=ec.fa = 4)   # layer 4

But you should never try to modify directly the internals of the state objects… This will almost never work.