[graph-tool] How can I extract the positions of the nodes and edges of the dendrogram obtained from minimize_nested_blockmodel_dl?

2021-04-20 Thread messias . physics
Hi. 
I'm trying to create an interactive web plot with the result obtained form 
minimize_nested_blockmodel_dl. 
Until now, I'm able to draw the edges and nodes positions in webgl. However, I 
have a issue. 
How can I get the node positions and edges from the dendrogram graph? 

graph-tool result https://ibb.co/hLKrcxs
webgl result https://ibb.co/YLnhy83
```python
state = gt.inference.minimize.minimize_nested_blockmodel_dl(g,
 ...
pos, tg, tpos = state.draw(**options)
```

# beizer control points
cts = gt.draw.get_hierarchy_control_points(g, tg, tpos)
```
Thanks
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Re: get_hierarchy_control_points return values

2021-04-19 Thread messias . physics
I have the same question as Davide Cittaro. 

I'm trying to create the same plot got from  minimize_nested_blockmodel_dl and 
draw_hyerarch, but using the threejs
(https://threejs.org/docs/?q=curve#api/in/extras/curves/Quadratic Bezier Curve)

I'm using this code to extract the control points

```
state = gt.inference.minimize.minimize_nested_blockmodel_dl(g)

pos, t, tpos = state.draw(**options)
cts = gt.draw.get_hierarchy_control_points(g, t, tpos) 
```
However I couldn't get how the control points are enconded in the cts ds. 

For example, a  sinlge instance of cts object I have this

print(list(cts)[100] )
[0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.03 0.09
 0.05 0.18 0.11 0.36 0.17 0.48 0.23 0.61 0.3  0.69 0.36 0.84 0.42 0.99
 0.46 1.21 0.5  1.23 0.55 1.25 0.6  1.06 0.65 0.87 0.7  0.69 0.75 0.5
 0.81 0.35 0.87 0.21 0.93 0.1  0.97 0.05 1.   0.   1.   0.   1.   0.
 1.   0.   1.   0.   1.   0.  ]

What's the meaning of the first 12 elements?  How (x,y) for control points are 
encoded?

Best regards
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de