code: def test_updates_when_visibility_is_toggled(
      self, single_plot_page: SinglePlotPage
  ) -> None:
      source = ColumnDataSource(dict(x=[1, 2], y1=[0, 1], y2=[10, 11]))
      plot = Plot(
          height=400,
          width=400,
          x_range=DataRange1d(),
          y_range=DataRange1d(only_visible=True),
          min_border=0,
      )
      plot.add_glyph(source, Circle(x="x", y="y1"))
      glyph = plot.add_glyph(source, Circle(x="x", y="y2"))
      code = RECORD("yrstart", "p.y_range.start", final=False) + RECORD(
          "yrend", "p.y_range.end"
      )
      plot.tags.append(
          CustomJS(name="custom-action", args=dict(p=plot), code=code)
      )
      plot.toolbar_sticky = False
      button = Button()
      button.js_on_event(
          "button_click",
          CustomJS(args=dict(glyph=glyph), code="glyph.visible=false"),
      )
  
      page = single_plot_page(column(plot, button))
  
      page.eval_custom_action()
  
      results = page.results
      assert results["yrstart"] <= 0
      assert results["yrend"] >= 11
  
      button = find_element_for(page.driver, button, ".bk-btn")
      button.click()
  
      page.eval_custom_action()
  
      results = page.results
      assert results["yrstart"] <= 0
      assert results["yrend"] < 5
  
      assert page.has_no_console_errors()
  
file_path: bokeh/tests/integration/models/test_datarange1d.py
imports: from __future__ import annotations
  import pytest
  from bokeh.layouts import column
  from bokeh.models import Button, Circle, ColumnDataSource, CustomJS, DataRange1d, Plot
  from tests.support.plugins.project import SinglePlotPage
  from tests.support.util.selenium import RECORD, find_element_for
label_desc: Use image node_id 4 for calling the Test_DataRange1d obj's underlying member method code with example usage: obj.test_updates_when_visibility_is_toggled(single_plot_page) without return types