class_docstr: An IPython widget display a Vega chart.
  
  Specifying the spec directly::
  
      widget = VegaWidget({...})
      widget.update(remove='datum.t < 5', insert=[{...}, {...}])
  
  To modify the created plot, additional options can be passed as in::
  
      widget = VegaWidget(spec, opt)
  
  Usage with ``altair``::
  
      widget = VegaWidget(chart.to_dict())
  
  To select between Vega and Vega-Lite use the ``$schema`` property on
  the ``spec`` dictionary.
  
  The chart can be updated by setting the ``spec`` property. In additon
  embedding options, such as the used theme, can be set via the ``opt``
  property::
  
      widget.spec = {...}
      widget.opt = {"theme": "dark"}
  
  For streaming data, setting the whole spec may be slow. For this use case,
  ``VegaWidget`` offers the ``update`` method. It sends the data to the
  client without persisting it on the Python side. In particular resetting
  the ``spec`` and ``opt`` properties will lose any data changes performed
  via ``update``.
class_docstr_tok: ["An","IPython","widget","display","a","Vega","chart",".","Specifying","the","spec","directly",":",":","widget","=","VegaWidget","(","{","...","}",")","widget.update","(","remove='datum.t","<","5","'",",","insert=","[","{","...","}",",","{","...","}","]",")","To","modify","the","created","plot",",","additional","options","can","be","passed","as","in",":",":","widget","=","VegaWidget","(","spec",",","opt",")","Usage","with","``","altair","``",":",":","widget","=","VegaWidget","(","chart.to_dict","(",")",")","To","select","between","Vega","and","Vega-Lite","use","the","``","$","schema","``","property","on","the","``","spec","``","dictionary",".","The","chart","can","be","updated","by","setting","the","``","spec","``","property",".","In","additon","embedding","options",",","such","as","the","used","theme",",","can","be","set","via","the","``","opt","``","property",":",":","widget.spec","=","{","...","}","widget.opt","=","{","``","theme","''",":","``","dark","''","}","For","streaming","data",",","setting","the","whole","spec","may","be","slow",".","For","this","use","case",",","``","VegaWidget","``","offers","the","``","update","``","method",".","It","sends","the","data","to","the","client","without","persisting","it","on","the","Python","side",".","In","particular","resetting","the","``","spec","``","and","``","opt","``","properties","will","lose","any","data","changes","performed","via","``","update","``","."]
code: def spec(self, value):
      self._spec_source = json.dumps(value)
      self._reset()
  
file_path: ipyvega/vega/widget.py
imports: from __future__ import print_function
  import json
  import pandas
  from ._frontend import module_name, EXTENSION_SPEC_VERSION
  from ipytablewidgets import serialization, SourceAdapter, PandasAdapter, NumpyAdapter, TableType
  import numpy
label_desc: Use image node_id 5 for calling the VegaWidget obj's underlying member method code with example usage: obj.spec(value) without return types