Holoviews annotator not displaying in Jupyter Lab

I’m trying to follow the ML annotator example from pyviz dot org.

I’m running jupyterlab from the pangeo-notebook docker image which includes:

  • holoviews = 1.14.0
  • jupyterlab = 2.2.9
  • labextension: @pyviz/jupyterlab_pyviz v1.0.4

Here is the code from the example:

import holoviews as hv
import geoviews as gv

hv.extension('bokeh')

tiles = gv.tile_sources.EsriImagery()
tiles

pts = dict(
    Longitude = [-121.932619100, -121.932362392, -121.933530027],
    Latitude  = [  36.631164244,   36.629475356,   36.630623206])
    
opts = dict(size=10, line_color='black', padding=0.1, min_height=400)

points = gv.Points(pts).opts(**opts)

points_annotator = hv.annotate.instance()
hv.annotate.compose(tiles, points_annotator(points, annotations=dict(Size=int, Type=str)))

When I run it in jupyterlab, nothing is displayed.

I can display the points and tiles in an overlay: points * tiles. This works as expected based on the example.

But the annotator creates empty output in the notebook. Rather than displaying the expected result from the example.

I hope some one can point me in the right direction. Thanks! :slightly_smiling_face:

If you create an environment from the example, the output will appear properly. Here is the download:

https://examples.pyviz.org/assets/ml_annotators.zip

Output appears, but an annoying byproduct that arises are param warnings. When running each section of code, I’ll be given 20+ lines of param warnings.

@jsimkins2
Hi
I have the same problem as @mharty3
With your example, I have no output to
“points_annotator = hv.annotate.instance()
hv.annotate.compose(tiles, points_annotator(points, annotations=dict(Size=int, Type=str)))”

I also don’t have output for
"rectangles = gv.Rectangles([(0, 0, 3, 3), (12, 12, 15, 15)]).opts(fill_alpha=0.2)
box_annotator = hv.annotate.instance()
labels = gv.tile_sources.StamenLabels()
layout = box_annotator(rectangles, name=“Rectangles”)

hv.annotate.compose(tiles, layout, labels)"

thanks

The Javascript console show this error
VM67:306 Uncaught Error: Model ‘geoviews.models.custom_tools.ClearTool’ does not exist. This could be due to a widget or a custom model not being registered before first usage.
at u.get (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :306:1010)
at Function._instantiate_object (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :305:4811)
at Function._instantiate_references_json (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :305:4999)
at Function.from_json (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :305:8497)
at Object.t.embed_items_notebook (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :729:2437)
at embed_document (:5:22)
at :8:5
at :24:3
at eval (eval at append_javascript (main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195), :138:28)
at Array.forEach ()