You might also look at mermaid instead of graphviz. Although ideally I think you'd want something where you can dynamically expand/collapse the tree elements. Otherwise, this sort of thing would be unusable for any expression that isn't fairly small.
Aaron Meurer On Sun, Dec 11, 2022 at 1:01 PM Björn Dahlgren <[email protected]> wrote: > > I often find myself wanting to look both at the tree representation and the > latex rendering of an expression. Ideally I'd like to get both of them side > by side. Here's a notebook I hacked together which is a start: > > https://gist.github.com/bjodah/581ca5d5c18dd34ff945134f5c6cecd7 > > I would also like to add tooltips (the example has tooltip for hovering > symbols in the tree representation, with mathjax I think we need mathjax 3 in > the notebook), as well as coloring (e.g. color symbols based on assumptions > such as non-negativity etc.). > > I dabbled with embedding javascript to highlight the nodes in both in the > mathjax rendering and the tree view simultaneously when hovering the > subexpression on either side. But I couldn't quite figure out how to achieve > this. > > For now I'll have to leave this be, but I'm most curious if anyone else finds > this useful, and perhaps are better versed in javascript/jupyter hacking. If > so, we should ideally put something together, either for inclusion into SymPy > or as a "side" package for starters. Or maybe this functionality is already > available somewhere that I've simply missed? > > All the best, > Björn > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/24896b1a-1058-430c-bd5a-bc04f5cd90e5n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KNaTdxAiajgMm0GjkZdjh1andnw3wagqRM6MWVGYv0PA%40mail.gmail.com.
