docstr: Display Shap contributions to prediction graph component
  
  Args:
      explainer (Explainer): explainer object constructed , with either
                  ClassifierExplainer() or RegressionExplainer()
      title (str, optional): Title of tab or page. Defaults to
                  "Contributions Plot".
      name (str, optional): unique name to add to Component elements.
                  If None then random uuid is generated to make sure
                  it's unique. Defaults to None.
      subtitle (str): subtitle
      hide_title (bool, optional): Hide component title. Defaults to False.
      hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
      hide_index (bool, optional): Hide index selector. Defaults to False.
      hide_depth (bool, optional): Hide depth toggle. Defaults to False.
      hide_sort (bool, optional): Hide the sorting dropdown. Defaults to False.
      hide_orientation (bool, optional): Hide the orientation dropdown.
              Defaults to True.
      hide_selector (bool, optional): hide pos label selector. Defaults to False.
      hide_popout (bool, optional): hide popout button
      feature_input_component (FeatureInputComponent): A FeatureInputComponent
          that will give the input to the graph instead of the index selector.
          If not None, hide_index=True. Defaults to None.
      index_dropdown (bool, optional): Use dropdown for index input instead
          of free text input. Defaults to True.
      pos_label ({int, str}, optional): initial pos label.
                  Defaults to explainer.pos_label
      index ({int, bool}, optional): Initial index to display. Defaults to None.
      depth (int, optional): Initial number of features to display. Defaults to None.
      sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional): sorting of shap values.
                  Defaults to 'high-to-low'.
      orientation ({'vertical', 'horizontal'}, optional): orientation of bar chart.
                  Defaults to 'vertical'.
      higher_is_better (bool, optional): Color positive shap values green and
          negative shap values red, or the reverse.
      description (str, optional): Tooltip to display when hover over
          component title. When None default text is shown.
docstr_tok: ["Display","Shap","contributions","to","prediction","graph","component","Args",":","explainer","(","Explainer",")",":","explainer","object","constructed",",","with","either","ClassifierExplainer","(",")","or","RegressionExplainer","(",")","title","(","str",",","optional",")",":","Title","of","tab","or","page",".","Defaults","to","``","Contributions","Plot","''",".","name","(","str",",","optional",")",":","unique","name","to","add","to","Component","elements",".","If","None","then","random","uuid","is","generated","to","make","sure","it","'s","unique",".","Defaults","to","None",".","subtitle","(","str",")",":","subtitle","hide_title","(","bool",",","optional",")",":","Hide","component","title",".","Defaults","to","False",".","hide_subtitle","(","bool",",","optional",")",":","Hide","subtitle",".","Defaults","to","False",".","hide_index","(","bool",",","optional",")",":","Hide","index","selector",".","Defaults","to","False",".","hide_depth","(","bool",",","optional",")",":","Hide","depth","toggle",".","Defaults","to","False",".","hide_sort","(","bool",",","optional",")",":","Hide","the","sorting","dropdown",".","Defaults","to","False",".","hide_orientation","(","bool",",","optional",")",":","Hide","the","orientation","dropdown",".","Defaults","to","True",".","hide_selector","(","bool",",","optional",")",":","hide","pos","label","selector",".","Defaults","to","False",".","hide_popout","(","bool",",","optional",")",":","hide","popout","button","feature_input_component","(","FeatureInputComponent",")",":","A","FeatureInputComponent","that","will","give","the","input","to","the","graph","instead","of","the","index","selector",".","If","not","None",",","hide_index=True",".","Defaults","to","None",".","index_dropdown","(","bool",",","optional",")",":","Use","dropdown","for","index","input","instead","of","free","text","input",".","Defaults","to","True",".","pos_label","(","{","int",",","str","}",",","optional",")",":","initial","pos","label",".","Defaults","to","explainer.pos_label","index","(","{","int",",","bool","}",",","optional",")",":","Initial","index","to","display",".","Defaults","to","None",".","depth","(","int",",","optional",")",":","Initial","number","of","features","to","display",".","Defaults","to","None",".","sort","(","{","'abs","'",",","'high-to-low","'",",","'low-to-high","'",",","'importance","'","}",",","optional",")",":","sorting","of","shap","values",".","Defaults","to","'high-to-low","'",".","orientation","(","{","'vertical","'",",","'horizontal","'","}",",","optional",")",":","orientation","of","bar","chart",".","Defaults","to","'vertical","'",".","higher_is_better","(","bool",",","optional",")",":","Color","positive","shap","values","green","and","negative","shap","values","red",",","or","the","reverse",".","description","(","str",",","optional",")",":","Tooltip","to","display","when","hover","over","component","title",".","When","None","default","text","is","shown","."]
code: def __init__(
      self,
      explainer,
      title="Contributions Plot",
      name=None,
      subtitle="How has each feature contributed to the prediction?",
      hide_title=False,
      hide_subtitle=False,
      hide_index=False,
      hide_depth=False,
      hide_sort=False,
      hide_orientation=True,
      hide_selector=False,
      hide_popout=False,
      feature_input_component=None,
      index_dropdown=True,
      pos_label=None,
      index=None,
      depth=None,
      sort="high-to-low",
      orientation="vertical",
      higher_is_better=True,
      description=None,
      **kwargs,
  ):
      """Display Shap contributions to prediction graph component
  
      Args:
          explainer (Explainer): explainer object constructed , with either
                      ClassifierExplainer() or RegressionExplainer()
          title (str, optional): Title of tab or page. Defaults to
                      "Contributions Plot".
          name (str, optional): unique name to add to Component elements.
                      If None then random uuid is generated to make sure
                      it's unique. Defaults to None.
          subtitle (str): subtitle
          hide_title (bool, optional): Hide component title. Defaults to False.
          hide_subtitle (bool, optional): Hide subtitle. Defaults to False.
          hide_index (bool, optional): Hide index selector. Defaults to False.
          hide_depth (bool, optional): Hide depth toggle. Defaults to False.
          hide_sort (bool, optional): Hide the sorting dropdown. Defaults to False.
          hide_orientation (bool, optional): Hide the orientation dropdown.
                  Defaults to True.
          hide_selector (bool, optional): hide pos label selector. Defaults to False.
          hide_popout (bool, optional): hide popout button
          feature_input_component (FeatureInputComponent): A FeatureInputComponent
              that will give the input to the graph instead of the index selector.
              If not None, hide_index=True. Defaults to None.
          index_dropdown (bool, optional): Use dropdown for index input instead
              of free text input. Defaults to True.
          pos_label ({int, str}, optional): initial pos label.
                      Defaults to explainer.pos_label
          index ({int, bool}, optional): Initial index to display. Defaults to None.
          depth (int, optional): Initial number of features to display. Defaults to None.
          sort ({'abs', 'high-to-low', 'low-to-high', 'importance'}, optional): sorting of shap values.
                      Defaults to 'high-to-low'.
          orientation ({'vertical', 'horizontal'}, optional): orientation of bar chart.
                      Defaults to 'vertical'.
          higher_is_better (bool, optional): Color positive shap values green and
              negative shap values red, or the reverse.
          description (str, optional): Tooltip to display when hover over
              component title. When None default text is shown.
      """
      super().__init__(explainer, title, name)
  
      self.index_name = "contributions-graph-index-" + self.name
  
      if self.depth is not None:
          self.depth = min(self.depth, self.explainer.n_features)
      else:
          self.depth = self.explainer.n_features
  
      if self.feature_input_component is not None:
          self.exclude_callbacks(self.feature_input_component)
          self.hide_index = True
  
      if self.description is None:
          self.description = """
          This plot shows the contribution that each individual feature has had
          on the prediction for a specific observation. The contributions (starting
          from the population average) add up to the final prediction. This allows you
          to explain exactly how each individual prediction has been built up
          from all the individual ingredients in the model.
          """
  
      self.selector = PosLabelSelector(
          explainer, name=self.name, pos_label=pos_label
      )
      self.index_selector = IndexSelector(
          explainer,
          "contributions-graph-index-" + self.name,
          index=index,
          index_dropdown=index_dropdown,
          **kwargs,
      )
  
      self.popout = GraphPopout(
          "contributions-graph-" + self.name + "popout",
          "contributions-graph-" + self.name,
          self.title,
          self.description,
      )
      self.register_dependencies("shap_values_df")
  
imports: import dash
  from dash import html, dcc, Input, Output, State
  from dash.exceptions import PreventUpdate
  import dash_bootstrap_components
  from ..dashboard_methods import *
  from ..None import to_html
label_desc: Use image node_id 1 to create a new ShapContributionsGraphComponent object from inherited base classes: ExplainerComponent with example: obj = ShapContributionsGraphComponent(explainer, title, name, subtitle, hide_title, hide_subtitle, hide_index, hide_depth, hide_sort, hide_orientation, hide_selector, hide_popout, feature_input_component, index_dropdown, pos_label, index, depth, sort, orientation, higher_is_better, description)