class_docstr: Create object used for visualizing graph using Pyvis library.
class_docstr_tok: ["Create","object","used","for","visualizing","graph","using","Pyvis","library","."]
docstr: Render graph for lineage query result.
  
  Args:
      elements: A dictionary that contains the node and the edges of the graph.
          Example:
              elements["nodes"] contains list of tuples, each tuple represents a node
                  format: (node arn, node lineage source, node lineage entity,
                      node is start arn)
              elements["edges"] contains list of tuples, each tuple represents an edge
                  format: (edge source arn, edge destination arn, edge association type)
  
      path(optional): The path/filename of the rendered graph html file.
          (default path: "lineage_graph_pyvis.html")
  
  Returns:
      display graph: The interactive visualization is presented as a static HTML file.
docstr_tok: ["Render","graph","for","lineage","query","result",".","Args",":","elements",":","A","dictionary","that","contains","the","node","and","the","edges","of","the","graph",".","Example",":","elements","[","``","nodes","''","]","contains","list","of","tuples",",","each","tuple","represents","a","node","format",":","(","node","arn",",","node","lineage","source",",","node","lineage","entity",",","node","is","start","arn",")","elements","[","``","edges","''","]","contains","list","of","tuples",",","each","tuple","represents","an","edge","format",":","(","edge","source","arn",",","edge","destination","arn",",","edge","association","type",")","path","(","optional",")",":","The","path\/filename","of","the","rendered","graph","html","file",".","(","default","path",":","``","lineage_graph_pyvis.html","''",")","Returns",":","display","graph",":","The","interactive","visualization","is","presented","as","a","static","HTML","file","."]
code: def render(self, elements, path="lineage_graph_pyvis.html"):
      """Render graph for lineage query result.
  
      Args:
          elements: A dictionary that contains the node and the edges of the graph.
              Example:
                  elements["nodes"] contains list of tuples, each tuple represents a node
                      format: (node arn, node lineage source, node lineage entity,
                          node is start arn)
                  elements["edges"] contains list of tuples, each tuple represents an edge
                      format: (edge source arn, edge destination arn, edge association type)
  
          path(optional): The path/filename of the rendered graph html file.
              (default path: "lineage_graph_pyvis.html")
  
      Returns:
          display graph: The interactive visualization is presented as a static HTML file.
  
      """
      net = self.Network(
          height="600px", width="82%", notebook=True, directed=True
      )
      net.set_options(self._pyvis_options)
  
      # add nodes to graph
      for arn, source, entity, is_start_arn in elements["nodes"]:
          entity_text = sub(r"(\w)([A-Z])", r"\1 \2", entity)
          source = sub(r"(\w)([A-Z])", r"\1 \2", source)
          account_id = search(r":\d{12}:", arn)
          name = search(r"\/.*", arn)
          node_info = (
              "Entity: "
              + entity_text
              + "\nType: "
              + source
              + "\nAccount ID: "
              + str(account_id.group()[1:-1])
              + "\nName: "
              + str(name.group()[1:])
          )
          if is_start_arn:  # startarn
              net.add_node(
                  arn,
                  label=source,
                  title=node_info,
                  color=self._node_color(entity),
                  shape="star",
                  borderWidth=3,
              )
          else:
              net.add_node(
                  arn,
                  label=source,
                  title=node_info,
                  color=self._node_color(entity),
                  borderWidth=3,
              )
  
      # add edges to graph
      for src, dest, asso_type in elements["edges"]:
          net.add_edge(src, dest, title=asso_type, width=2)
  
      net.write_html(path)
      self._add_legend(path)
  
      return self.IFrame(path, width="100%", height="600px")
  
imports: from __future__ import absolute_import
  from datetime import datetime
  from enum import Enum
  from typing import Any, Optional, Union, List, Dict
  from json import dumps
  from re import sub, search
  from sagemaker.utils import get_module
  from sagemaker.lineage._utils import get_resource_name_from_arn
label_desc: Use image node_id 6 for calling the PyvisVisualizer obj's underlying member method code with example usage: obj.render(elements, path) and returns: self