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

Implement bokeh as alternative plotting lib #3

Open
mmaelicke opened this issue May 11, 2020 · 9 comments
Open

Implement bokeh as alternative plotting lib #3

mmaelicke opened this issue May 11, 2020 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@mmaelicke
Copy link
Collaborator

I am thinking about implementing bokeh as an alternative for plotting. Similar to holoviews, the user could switch from the default matplotlib plotting backend to bokeh.
Plotting tools would return the bokeh.plotting.figure.Figure to let the user decide whether to use it in a notebook, save it into a file or create the Jsonfor bokehjs from it.
Similar to matplotlib, the functions would also accept a bokeh.Figure to plot on as an argument.

I think it is still not too much work to go for this way. Would help the lib, and might be helpful in V-FOR-WaTer portal.
@MarcusStrobl , what do you think about this?

Would it be appreciated and helpful in the Visualization implementation of V-FOR-WaTer?

@mmaelicke mmaelicke added enhancement New feature or request help wanted Extra attention is needed labels May 11, 2020
@MarcusStrobl
Copy link
Member

For V-FOR-WaTer there is no big difference if the image is produced with matplotlib or bokeh. Only, matplotlib images are only html. When the result from hydrobox needs the javascript library of bokeh as well, there might be version conflicts at some time, as V-FOR-WaTer is using bokeh, too.

In my opinion, when possible, the visualization of V-FOR-WaTer should be independent from the tools to be more flexible.

@mmaelicke
Copy link
Collaborator Author

Thanks, Marcus.

What about bokeh JSON output? Could V-FOR-WaTer consume that? On severe version mismatches, WPS_toolbox could adjust the JSON.
I am just wondering how some of the very specialized plots from hydrobox can be visualized in the Portal. How are axis labels, colors, shapes and stuff like this exported? As static images?

@MarcusStrobl
Copy link
Member

MarcusStrobl commented May 12, 2020

I am using components of bokeh. To use bokeh JSON doesn't seem to be complicated. I would only need a label to recognize the bokeh JSON and handle it accordingly. This could be set in the wps interface.
Could the information for the plot be exported to the metadata file?

@mmaelicke
Copy link
Collaborator Author

Yeah I was thinking of something like this:
https://docs.bokeh.org/en/latest/docs/reference/core/json_encoder.html

Workflow would be:

  1. hydrobox can return bokeh.Figure
  2. WPS_toolbox checks tool output for bokeh.Figure
    3a. If no Figure found, image/table/text output is assumed
    3b. if Figure is recognized, the encoder is used and the JSON for bokehjs is added to metadata file

We could transfer WPS_toolbox as a private project to V-FOR-WaTer organization (they are free now) and transfer this issue there.

@MarcusStrobl
Copy link
Member

Not sure what you want to do with json_encoder.
Didn't you think of a JSON-item like in the following link?
https://docs.bokeh.org/en/latest/docs/user_guide/embed.html#json-items

@mmaelicke
Copy link
Collaborator Author

Yeah, sorry I sent the wrong link! Sorry

@MarcusStrobl
Copy link
Member

About transferring WPS_toolbox here to V-FOR-WaTer:
From our side, there is no necessity to have a private project in github. The code which is used on the server is in Gitlab, which is hosted on our own servers.

@mmaelicke
Copy link
Collaborator Author

Alright, then I will create a v0.2 milestone, at which hydrobox should be 'bokeh ready'. As soon as I start implementing I will create a sample JSON output and let you know. Then we can see if that is helpful and working.

@mmaelicke mmaelicke added this to the Version 0.2 milestone May 12, 2020
@mmaelicke
Copy link
Collaborator Author

This is still open. Unfortunately, all geostatistical tools included have a plotly and a matplotlib plotting method, but not a bokeh method. So these methods need to be added either to the underlying packages themselves, hydrobox or at the wps_toolbox level.
I don't have the capacity to implement this myself right now, therefore I'll leave this issue open.

@mmaelicke mmaelicke modified the milestones: Version 0.2, Version 1.0 May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Development

No branches or pull requests

2 participants