class_docstr: TODO: Maybe we should do something smart here. Like inject only once?
  But how to be robust to the user clearing the output of the cell where we injected the bundle?
      If he then refreshes the page, HiPlot bundle is no longer injected...
class_docstr_tok: ["TODO",":","Maybe","we","should","do","something","smart","here",".","Like","inject","only","once","?","But","how","to","be","robust","to","the","user","clearing","the","output","of","the","cell","where","we","injected","the","bundle","?","If","he","then","refreshes","the","page",",","HiPlot","bundle","is","no","longer","injected","..."]
code: def ensure_injected(cls) -> None:
      bundle = (
          Path(__file__).parent
          / "static"
          / "built"
          / "hiplot.bundle.js"
      )
      IPython.display.display(
          IPython.display.Javascript(
              f"""
  {bundle.read_text("utf-8")}
  // Local variables can't be accessed in other cells, so let's
  // manually create a global variable
  Object.assign(window, {{'hiplot': hiplot}});
  """
          )
      )
  
imports: import uuid
  import html
  import typing
  import json
  from pathlib import Path
  import IPython.display
  from ipykernel.comm import Comm
  from .None import experiment
  from .render import escapejs, make_experiment_standalone_page
label_desc: Use image node_id 1 for calling the NotebookJSBundleInjector obj's underlying member method code with example usage: obj.ensure_injected(cls) without return types