GmapPlot

I created the dashboard with a map in it using GMapPlot. It loads okay first time but when I update sliders or other widgets it doesn’t load the map properly.

I am basically following stock_app_simple.py example and replaced the scatter plot with GmapPlot.

I am using lastest Bokeh.

I could use basemap but GMapPlot seems very handy and it shows all the street names and I want to show the path on the map for example.

TJ

Hi TJ,

Can you provide a minimal runnable example that demonstrates the issue? Absolutely nothing goes further towards helping diagnose problems quickly than a minimal runnable example.

Thanks,

Bryan

···

On Jul 23, 2015, at 1:37 PM, TJ <[email protected]> wrote:

I created the dashboard with a map in it using GMapPlot. It loads okay first time but when I update sliders or other widgets it doesn't load the map properly.

I am basically following stock_app_simple.py example and replaced the scatter plot with GmapPlot.

I am using lastest Bokeh.

I could use basemap but GMapPlot seems very handy and it shows all the street names and I want to show the path on the map for example.

TJ

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/67ae80dd-2847-4306-b32b-9efaaf6138c7%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Please find the “google_map_app_simple.py” that uses “daily” data.

Let me know if you need to have the data to run it. It uses bokeh example data

Regards

TJ

google_map_app_simple.py (19.1 KB)

Any Update on this??

Hi TJ,

One note first: In your example you didn’t specify any event handler associated to the widgets you’ve defined. This fires the entire app (Plots and Widgets) recreation everytime. Honestly I’m a bit surprised simpleapp implements this behaviour by default and I’m -1 about this. I’ll probably open an issue to consider improving this on the efforts that are in act to improve bokeh-server.

I’ve downloaded your script and was able to reproduce the issue. Honestly I’m not sure why this is happening… But just for the sake of more clarity on identifying the app flow I’ve just defined an extra function to layout the simple app and defined an event handler to handle the specific slider updates. With that I’m just updating the map plot without recreating everything else. This seems to solve the issue for me locally. Can you check if the attached script works for you too?

Also, as an advice I suggest to break the code and the components creation into smaller functions as I’ve seen that the simpleapp workflow can easily fall into quite long functions (with considerable long boilerplate code) that end up being hard to easily work with when debugging/modifying.

Cheers

google_map_app_simple.py (22.6 KB)

···

On Sun, Aug 9, 2015 at 8:40 AM, TJ [email protected] wrote:

Any Update on this??

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/0f64b104-8040-467f-ab7c-8a3ac51bcc65%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Fabio Pliger

Senior Software Engineer, Bokeh

Fabio,

Thank you so much for your quick response and great solution. It works very well on my end. I knew there was a missing function for the slider update but I didn’t know how to add it or implement as I am new to Bokeh and didn’t know where to look at for detailed information for such things. Hope there are more complete examples and more detailed information for advanced users who want to create fairly complex dashboard.

Very much appreciated.

TJ

Dear Fabio,

I added Checkboxgroup to the original dashboard but I can not make it working.

It seems like nothing happens when it calls out checkbox_button_group_handler

I have attached the modified code

Thank you in advance.

TJ

google_map_app_simple_checkbox.py (24.3 KB)

Fabio,

The method you have suggested works better and it is more robust as it renders the map correctly most of time but not always and it gets worse (meaning map doesn’t render properly) when I try to ingest csv data within the create_map function and plot the scatter points on top of the map.

The map should be a background info as I am not changing map location and it could be static but points I am plotting on top of the map should be dynamic.

Is there way for me to load the map more robustly? I would like to cache the map info and use it over and over for plotting some location marks dynamically.

Again I want to thank you for your help in advance.

TJ