class_docstr: Create object used for visualizing graph using Pyvis library.
class_docstr_tok: ["Create","object","used","for","visualizing","graph","using","Pyvis","library","."]
docstr: Init for PyvisVisualizer.
  
  Args:
      graph_styles: A dictionary that contains graph style for node and edges by their type.
          Example: Display the nodes with different color by their lineage entity / different
              shape by start arn.
                  lineage_graph_styles = {
                      "TrialComponent": {
                          "name": "Trial Component",
                          "style": {"background-color": "#f6cf61"},
                          "isShape": "False",
                      },
                      "Context": {
                          "name": "Context",
                          "style": {"background-color": "#ff9900"},
                          "isShape": "False",
                      },
                      "StartArn": {
                          "name": "StartArn",
                          "style": {"shape": "star"},
                          "isShape": "True",
                          "symbol": "★", # shape symbol for legend
                      },
                  }
      pyvis_options(optional): A dict containing PyVis options to customize visualization.
          (see https://visjs.github.io/vis-network/docs/network/#options for supported fields)
docstr_tok: ["Init","for","PyvisVisualizer",".","Args",":","graph_styles",":","A","dictionary","that","contains","graph","style","for","node","and","edges","by","their","type",".","Example",":","Display","the","nodes","with","different","color","by","their","lineage","entity","\/","different","shape","by","start","arn",".","lineage_graph_styles","=","{","``","TrialComponent","''",":","{","``","name","''",":","``","Trial","Component","''",",","``","style","''",":","{","``","background-color","''",":","``","#","f6cf61","''","}",",","``","isShape","''",":","``","False","''",",","}",",","``","Context","''",":","{","``","name","''",":","``","Context","''",",","``","style","''",":","{","``","background-color","''",":","``","#","ff9900","''","}",",","``","isShape","''",":","``","False","''",",","}",",","``","StartArn","''",":","{","``","name","''",":","``","StartArn","''",",","``","style","''",":","{","``","shape","''",":","``","star","''","}",",","``","isShape","''",":","``","True","''",",","``","symbol","''",":","``","\u2605","''",",","#","shape","symbol","for","legend","}",",","}","pyvis_options","(","optional",")",":","A","dict","containing","PyVis","options","to","customize","visualization",".","(","see","https",":","\/\/visjs.github.io\/vis-network\/docs\/network\/","#","options","for","supported","fields",")"]
code: def __init__(
      self, graph_styles, pyvis_options: Optional[Dict[str, Any]] = None
  ):
      """Init for PyvisVisualizer.
  
      Args:
          graph_styles: A dictionary that contains graph style for node and edges by their type.
              Example: Display the nodes with different color by their lineage entity / different
                  shape by start arn.
                      lineage_graph_styles = {
                          "TrialComponent": {
                              "name": "Trial Component",
                              "style": {"background-color": "#f6cf61"},
                              "isShape": "False",
                          },
                          "Context": {
                              "name": "Context",
                              "style": {"background-color": "#ff9900"},
                              "isShape": "False",
                          },
                          "StartArn": {
                              "name": "StartArn",
                              "style": {"shape": "star"},
                              "isShape": "True",
                              "symbol": "★", # shape symbol for legend
                          },
                      }
          pyvis_options(optional): A dict containing PyVis options to customize visualization.
              (see https://visjs.github.io/vis-network/docs/network/#options for supported fields)
      """
      # import visualization packages
      (
          self.Network,
          self.Options,
          self.IFrame,
          self.BeautifulSoup,
      ) = self._import_visual_modules()
  
      self.graph_styles = graph_styles
  
      if pyvis_options is None:
          # default pyvis graph options
          pyvis_options = {
              "configure": {"enabled": False},
              "layout": {
                  "hierarchical": {
                      "enabled": True,
                      "blockShifting": True,
                      "direction": "LR",
                      "sortMethod": "directed",
                      "shakeTowards": "leaves",
                  }
              },
              "interaction": {
                  "multiselect": True,
                  "navigationButtons": True,
              },
              "physics": {
                  "enabled": False,
                  "hierarchicalRepulsion": {
                      "centralGravity": 0,
                      "avoidOverlap": None,
                  },
                  "minVelocity": 0.75,
                  "solver": "hierarchicalRepulsion",
              },
          }
      # A string representation of a Javascript-like object used to override pyvis options
      self._pyvis_options = f"var options = {dumps(pyvis_options)}"
  
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 1 to create a new PyvisVisualizer object from inherited base classes: object with example: obj = PyvisVisualizer(graph_styles, pyvis_options)