code: def on_resize(e):
      width, height = e.size[0], e.size[1]
      gloo.set_viewport(0, 0, width, height)
      segments["viewport"] = 0, 0, width, height
  
imports: import numpy
  from vispy import app, gloo
  from vispy.visuals.collections import SegmentCollection
label_desc: Use image node_id 2 for calling a global function with example usage: on_resize(e) without return types