class_docstr: Renderer for contour plots composed of filled polygons and/or lines.
  
  Rather than create these manually it is usually better to use
  :func:`~bokeh.plotting.figure.contour` instead.
docstr: Set the contour line and filled polygon data to render.
  
  Accepts a :class:`~bokeh.plotting.contour.ContourData` object, such as
  is returned from :func:`~bokeh.plotting.contour.contour_data`.
docstr_tok: ["Set","the","contour","line","and","filled","polygon","data","to","render",".","Accepts","a",":","class",":","`","~bokeh.plotting.contour.ContourData","`","object",",","such","as","is","returned","from",":","func",":","`","~bokeh.plotting.contour.contour_data","`","."]
code: def set_data(self, data: ContourData) -> None:
      """Set the contour line and filled polygon data to render.
  
      Accepts a :class:`~bokeh.plotting.contour.ContourData` object, such as
      is returned from :func:`~bokeh.plotting.contour.contour_data`.
  
      """
      if data.fill_data:
          # Convert dataclass to dict to add new fields and put into CDS.
          fill_data = data.fill_data.asdict()
          # Copy fill and hatch properties from old to new data source
          old_fill_data = self.fill_renderer.data_source.data
          for name in old_fill_data.keys():
              if name not in (
                  "xs",
                  "ys",
                  "lower_levels",
                  "upper_levels",
              ):
                  fill_data[name] = old_fill_data[name]
          self.fill_renderer.data_source.data = fill_data
      else:
          self.fill_renderer.data_source.data = dict(
              xs=[], ys=[], lower_levels=[], upper_levels=[]
          )
  
      if data.line_data:
          # Convert dataclass to dict to add new fields and put into CDS.
          line_data = data.line_data.asdict()
          # Copy line properties from old to new data source
          old_line_data = self.line_renderer.data_source.data
          for name in old_line_data.keys():
              if name not in ("xs", "ys", "levels"):
                  line_data[name] = old_line_data[name]
          self.line_renderer.data_source.data = line_data
      else:
          self.line_renderer.data_source.data = dict(
              xs=[], ys=[], levels=[]
          )
  
file_path: bokeh/src/bokeh/models/renderers/contour_renderer.py
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING
  from ...core.properties import Float, Instance, Seq
  from .glyph_renderer import GlyphRenderer
  from .renderer import DataRenderer
label_desc: Use image node_id 2 for calling the ContourRenderer obj's underlying member method code with example usage: obj.set_data(data) without return types