ipydrawio icon indicating copy to clipboard operation
ipydrawio copied to clipboard

render widget with Panel library

Open nlooije opened this issue 3 years ago • 2 comments

Sorry for the many bug reports and feature requests lately. I really appreciate the work you put into ipydrawio and any feedback and support you give.

Motivation

I would like for the ipydrawio widget to be able to render within a Panel app.

Panel is an open-source Python library that lets you create custom interactive web apps and dashboards by connecting user-defined widgets to plots, images, tables, or text.

This library is useful when integrating the ipydrawio widget into a GUI

Panel library can be used to develop rich interactive applications without tying your domain-specific code to any particular GUI or web tools.

Design Ideas

Currently, it doesn't seem that the ipydrawio widget renders within the Panel library.

image

No errors are generated, nothing to help make it render or where to start:

image

Rather than issuing a bug report i figured that rendering within Panel wasn't a design goal so it would be best to add this as a feature request.

Honestly, i don't have the faintest idea why it is not rendering with panel. Other widgets are rendering something:

ipyleaflet: image

ipyvolume: image

nlooije avatar Jan 06 '22 08:01 nlooije

without tying your domain-specific code to any particular GUI or web tools.

... except panel

Yeah, panel integration is kind of a moving target, non-goal, and a dependency unacceptable, but if you contributed a tutorial as a PR with tests, I'd take it. You'll probably want to dig a bit deeper into the DOM itself to see if it's actually showing up... for... reasons... under the hood Diagram is actually a Box and might just need a bit more layout configuration to appease whatever panel wraps it in. It may be easier to experiment with another box around it, and if panel can't handle Boxes, then that's pretty much endgame.

bollwyvl avatar Jan 06 '22 14:01 bollwyvl

Ok, Panel seems to handle boxes just fine:

image

and wrapping Diagram in a box also gives no issues:

image

but combining yields nothing:

image

I am still looking at what the main differences in HTML generated are

nlooije avatar Jan 07 '22 10:01 nlooije