code: def _draw_line_through_box(
      dashboard_html,
      top_left_x,
      top_left_y,
      box_w,
      box_h,
      is_horizontal,
      direction,
      fill_percent=50,
  ):
      if is_horizontal:
          new_top_left_x = top_left_x + box_w * (fill_percent / 100.0)
          new_top_left_y = top_left_y
          new_box_w = 1
          new_box_h = box_h
      else:
          new_top_left_x = top_left_x
          new_top_left_y = top_left_y + box_h * (fill_percent / 100.0)
          new_box_w = box_w
          new_box_h = 1
  
      html_box = """<!-- Draw some lines in -->
            context.beginPath();
            context.rect({top_left_x}, {top_left_y}, {box_w}, {box_h});
            context.lineWidth = 1;
            context.strokeStyle = 'black';
            context.stroke();
      """.format(
          top_left_x=new_top_left_x,
          top_left_y=new_top_left_y,
          box_w=new_box_w,
          box_h=new_box_h,
      )
  
      index_for_new_box = dashboard_html.find("</script>") - 1
      dashboard_html = (
          dashboard_html[:index_for_new_box]
          + html_box
          + dashboard_html[index_for_new_box:]
      )
      return dashboard_html
  
imports: import pprint
  import _plotly_utils.exceptions
  from _plotly_utils import optional_imports
  from chart_studio import exceptions
label_desc: Use image node_id 4 for calling a global function with example usage: _draw_line_through_box(dashboard_html, top_left_x, top_left_y, box_w, box_h, is_horizontal, direction, fill_percent) and returns: dashboard_html