daft-dev / daft

Render probabilistic graphical models using matplotlib
https://docs.daft-pgm.org
MIT License
675 stars 118 forks source link

Automatic placement of nodes #122

Open phinate opened 3 years ago

phinate commented 3 years ago

Hello! Recently stumbled upon this lib, and I'm a big fan of the aesthetics -- the only big thing that's missing for me is the default assignment of node positions in a graph.

An example use case: I'm writing a pgm-type module that could make use of daft for nice vizualisations, but I wont know the layout of the network until the runtime of any future users (and it feels a bit mean to make them specify the layout for their model on a grid...)

There are plenty of algorithms to do this, e.g. these summarized by Isabel F. Cruz and Roberto Tamassia, but I wasn't sure if this was something on the roadmap or within the scope of the library. I can't instantly offer to try and implement something myself due to other priorities, but I may give it a go one day if I find time.

(oh, and if I'm being really stupid and this is already somewhere in the lib, apologies...)

dfm commented 3 years ago

This is not available and we don't really have a roadmap - I think everyone is a bit too busy to invest real time these days! A contribution would be much appreciated and I'd be happy to chat about ideas if you or someone else finds time to think about this.