code: def to_html(self, state_dict=None, add_header=True):
      args = self.get_state_args(state_dict)
      if self.feature_input_component is None:
          fig = self.explainer.plot_pdp(
              args["col"],
              args["index"],
              drop_na=bool(args["dropna"]),
              sample=args["sample"],
              gridlines=args["gridlines"],
              gridpoints=args["gridpoints"],
              sort=args["cats_sort"],
              pos_label=args["pos_label"],
          )
          html = to_html.fig(fig)
      else:
          inputs = {
              k: v
              for k, v in self.feature_input_component.get_state_args(
                  state_dict
              ).items()
              if k != "index"
          }
          inputs = list(inputs.values())
          if len(inputs) == len(
              self.feature_input_component._input_features
          ) and not any([i is None for i in inputs]):
              X_row = self.explainer.get_row_from_input(
                  inputs, ranked_by_shap=True
              )
              fig = self.explainer.plot_pdp(
                  args["col"],
                  X_row=X_row,
                  drop_na=bool(args["dropna"]),
                  sample=args["sample"],
                  gridlines=args["gridlines"],
                  gridpoints=args["gridpoints"],
                  sort=args["cats_sort"],
                  pos_label=args["pos_label"],
              )
              html = to_html.fig(fig)
          else:
              html = f"<div>input data incorrect</div>"
  
      html = to_html.card(html, title=self.title)
      if add_header:
          return to_html.add_header(html)
      return html
  
imports: from math import ceil
  import numpy
  import pandas
  import dash
  from dash import html, dcc, Input, Output, State, dash_table
  from dash.exceptions import PreventUpdate
  import dash_bootstrap_components
  from ..dashboard_methods import *
  from ..None import to_html
label_desc: Use image node_id 4 for calling the PdpComponent obj's underlying member method code with example usage: obj.to_html(state_dict, add_header) and returns: html, to_html