Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render widget with Panel library #86

Open
nlooije opened this issue Jan 6, 2022 · 2 comments
Open

render widget with Panel library #86

nlooije opened this issue Jan 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@nlooije
Copy link

nlooije commented Jan 6, 2022

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 nlooije added the enhancement New feature or request label Jan 6, 2022
@bollwyvl
Copy link

bollwyvl commented Jan 6, 2022

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.

@nlooije
Copy link
Author

nlooije commented Jan 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants