-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi all,
I am trying to render a colorbar to the map but it is not working correctly. The code for this issue:
import ipywidgets as widgets
# make colorbar
colors = ["#d7191c", "#fdae61", "#ffffbf", "#abdda4", "#2b83ba"]
vmin = z_orig.min()
vmax = z_orig.max()
levels = len(colors) * 10
cm = branca.colormap.LinearColormap(colors, vmin=vmin, vmax=vmax).to_step(5)
output = widgets.Output()
position = "bottomright"
colormap_ctrl = ipyleaflet.WidgetControl(
widget=output,
position=position,
# transparent_bg=transparent_bg,
# **kwargs,
)
with output:
output.outputs = ()
display(cm)
m = Map(
center=[0, 0],
zoom=3,
scroll_wheel_zoom=True,
basemap=basemaps.CartoDB.DarkMatter,
)
m.add(colormap_ctrl)
This work well in jupyterlab
But not for shiny app, which only has a small point in the bottom right
the version of each pacakage
shiny 1.2.1
shinywidgets 0.3.4
ipywidgets 7.8.5
Metadata
Metadata
Assignees
Labels
No labels