class_docstr: :class`~perspective.PerspectiveWidget` allows for Perspective to be used
  in the form of a Jupyter IPython widget.
  
  Using `perspective.Table`, you can create a widget that extends the full
  functionality of `perspective-viewer`.  Changes on the viewer can be
  programatically set on the :class`~perspective.PerspectiveWidget` instance,
  and state is maintained across page refreshes.
  
  Examples:
      >>> from perspective import Table, PerspectiveWidget
      >>> data = {
      ...     "a": [1, 2, 3],
      ...     "b": [
      ...         "2019/07/11 7:30PM",
      ...         "2019/07/11 8:30PM",
      ...         "2019/07/11 9:30PM"
      ...     ]
      ... }
      >>> tbl = Table(data, index="a")
      >>> widget = PerspectiveWidget(
      ...     tbl,
      ...     group_by=["a"],
      ...     sort=[["b", "desc"]],
      ...     filter=[["a", ">", 1]]
      ... )
      >>> widget.sort
      [["b", "desc"]]
      >>> widget.sort.append(["a", "asc"])
      >>> widget.sort
      [["b", "desc"], ["a", "asc"]]
      >>> widget.update({"a": [4, 5]}) # Browser UI updates
docstr: Replaces the widget's `Table` with new data conforming to the same
  schema. Does not clear user-set state. If in client mode, serializes
  the data and sends it to the browser.
docstr_tok: ["Replaces","the","widget","'s","`","Table","`","with","new","data","conforming","to","the","same","schema",".","Does","not","clear","user-set","state",".","If","in","client","mode",",","serializes","the","data","and","sends","it","to","the","browser","."]
code: def replace(self, data):
      """Replaces the widget's `Table` with new data conforming to the same
      schema. Does not clear user-set state. If in client mode, serializes
      the data and sends it to the browser.
      """
      if self.client is True:
          if isinstance(data, pandas.DataFrame) or isinstance(
              data, pandas.Series
          ):
              data, _ = deconstruct_pandas(data)
          d = _serialize(data)
          self.post({"cmd": "replace", "data": d})
          self._data = d
      else:
          super(PerspectiveWidget, self).replace(data)
  
imports: import base64
  import jinja2
  import json
  import os
  from datetime import date, datetime
  from functools import partial
  import numpy
  import pandas
  from ipywidgets import DOMWidget
  from traitlets import Unicode, observe
  from ..core._version import __version__
  from ..core.data import deconstruct_pandas
  from ..core.exception import PerspectiveError
  from ..libpsp import is_libpsp
  from ..viewer import PerspectiveViewer
label_desc: Use image node_id 5 for calling the PerspectiveWidget obj's underlying member method code with example usage: obj.replace(data) without return types