Add visual feature
For programmers who use the CVXPY library, and for the developers of the library we want to add visuals to the optimization problems that found in the CVXPY library.
Our idea is to add a feature as known as visual() function , the function will show the problem by tree diagrams like this example:


Hi @nivmoti ! Thanks for your interest in improving the visualization capabilities of CVXPY!
Have you started with an implementation already? @PTNobel and I recently talked about building a web tool similar to https://dcp.stanford.edu/analyzer that would integrate directly with CVXPY.
Hi, @phschiele ! Yes, we started with implementation, we built a class called visual whose purpose is to show the cvxpy expression like a DCP.
Is there a codebase I could look at? This sounds awesome!
hi! @PTNobel Attaching link to our repository https://github.com/nivmoti/cvxpyanalyzer, you can see there readme with running examples. the code is inside the Visual folder and the primary code is in a file named visual.py and the class of the tree is in the binary_tree.py file. We would also like to know if you have a recommendation for a library in Python with which we can paint the tree more clearly.
@einav242 we appreciate your contribution a lot! We will get back to you with recommendations for visualization libraries.
@einav242 we discussed internally. Here were the ideas we had:
- Output html
- Use plotly or dash
- GraphViz https://www.graphviz.org/
- More tree visualization libraries https://stackoverflow.com/questions/7670280/tree-plotting-in-python
Sorry we can't be more helpful! Most of our visualization experience is using plotting libraries or in javascript/html.
@SteveDiamond Ok we will try the options, thank you very much!
Hi! @SteveDiamond We wanted to update you about our progress in the project and ask your opinion. you can see in the link (https://github.com/nivmoti/cvxpyanalyzer/blob/master/README.md) the readme of our project with new example.
Hi! @SteveDiamond We wanted to update you about our progress in the project and ask your opinion. you can see in the link (https://github.com/nivmoti/cvxpyanalyzer/blob/master/README.md) the readme of our project with new example.
It looks great! Do you want to make a pull request to cvxpyanalyzer?
Yes , we did it. Thanks @SteveDiamond
Resolved via https://github.com/cvxpy/cvxpyanalyzer/pull/2