class_docstr: A renderer class inheriting from base for rendering mpl plots in plotly.
  
  A renderer class to be used with an exporter for rendering matplotlib
  plots in Plotly. This module defines the PlotlyRenderer class which handles
  the creation of the JSON structures that get sent to plotly.
  
  All class attributes available are defined in __init__().
  
  Basic Usage:
  
  # (mpl code) #
  fig = gcf()
  renderer = PlotlyRenderer(fig)
  exporter = Exporter(renderer)
  exporter.run(fig)  # ... et voila
docstr: Create a data dict for a line obj.
  
  This will draw 'lines', 'markers', or 'lines+markers'. For legend elements,
  this will use layout.shapes, so they can be positioned with paper refs.
  
  props.keys() -- [
  'coordinates',  ('data', 'axes', 'figure', or 'display')
  'data',         (a list of xy pairs)
  'mplobj',       (the matplotlib.lines.Line2D obj being rendered)
  'label',        (the name of the Line2D obj being rendered)
  'linestyle',    (linestyle dict, can be None, see below)
  'markerstyle',  (markerstyle dict, can be None, see below)
  ]
  
  props['linestyle'].keys() -- [
  'alpha',        (opacity of Line2D obj)
  'color',        (color of the line if it exists, not the marker)
  'linewidth',
  'dasharray',    (code for linestyle, see DASH_MAP in mpltools.py)
  'zorder',       (viewing precedence when stacked with other objects)
  ]
  
  props['markerstyle'].keys() -- [
  'alpha',        (opacity of Line2D obj)
  'marker',       (the mpl marker symbol, see SYMBOL_MAP in mpltools.py)
  'facecolor',    (color of the marker face)
  'edgecolor',    (color of the marker edge)
  'edgewidth',    (width of marker edge)
  'markerpath',   (an SVG path for drawing the specified marker)
  'zorder',       (viewing precedence when stacked with other objects)
  ]
docstr_tok: ["Create","a","data","dict","for","a","line","obj",".","This","will","draw","'lines","'",",","'markers","'",",","or","'lines+markers","'",".","For","legend","elements",",","this","will","use","layout.shapes",",","so","they","can","be","positioned","with","paper","refs",".","props.keys","(",")","--","[","'coordinates","'",",","(","'data","'",",","'axes","'",",","'figure","'",",","or","'display","'",")","'data","'",",","(","a","list","of","xy","pairs",")","'mplobj","'",",","(","the","matplotlib.lines.Line2D","obj","being","rendered",")","'label","'",",","(","the","name","of","the","Line2D","obj","being","rendered",")","'linestyle","'",",","(","linestyle","dict",",","can","be","None",",","see","below",")","'markerstyle","'",",","(","markerstyle","dict",",","can","be","None",",","see","below",")","]","props","[","'linestyle","'","]",".keys","(",")","--","[","'alpha","'",",","(","opacity","of","Line2D","obj",")","'color","'",",","(","color","of","the","line","if","it","exists",",","not","the","marker",")","'linewidth","'",",","'dasharray","'",",","(","code","for","linestyle",",","see","DASH_MAP","in","mpltools.py",")","'zorder","'",",","(","viewing","precedence","when","stacked","with","other","objects",")","]","props","[","'markerstyle","'","]",".keys","(",")","--","[","'alpha","'",",","(","opacity","of","Line2D","obj",")","'marker","'",",","(","the","mpl","marker","symbol",",","see","SYMBOL_MAP","in","mpltools.py",")","'facecolor","'",",","(","color","of","the","marker","face",")","'edgecolor","'",",","(","color","of","the","marker","edge",")","'edgewidth","'",",","(","width","of","marker","edge",")","'markerpath","'",",","(","an","SVG","path","for","drawing","the","specified","marker",")","'zorder","'",",","(","viewing","precedence","when","stacked","with","other","objects",")","]"]
code: def draw_marked_line(self, **props):
      """Create a data dict for a line obj.
  
      This will draw 'lines', 'markers', or 'lines+markers'. For legend elements,
      this will use layout.shapes, so they can be positioned with paper refs.
  
      props.keys() -- [
      'coordinates',  ('data', 'axes', 'figure', or 'display')
      'data',         (a list of xy pairs)
      'mplobj',       (the matplotlib.lines.Line2D obj being rendered)
      'label',        (the name of the Line2D obj being rendered)
      'linestyle',    (linestyle dict, can be None, see below)
      'markerstyle',  (markerstyle dict, can be None, see below)
      ]
  
      props['linestyle'].keys() -- [
      'alpha',        (opacity of Line2D obj)
      'color',        (color of the line if it exists, not the marker)
      'linewidth',
      'dasharray',    (code for linestyle, see DASH_MAP in mpltools.py)
      'zorder',       (viewing precedence when stacked with other objects)
      ]
  
      props['markerstyle'].keys() -- [
      'alpha',        (opacity of Line2D obj)
      'marker',       (the mpl marker symbol, see SYMBOL_MAP in mpltools.py)
      'facecolor',    (color of the marker face)
      'edgecolor',    (color of the marker edge)
      'edgewidth',    (width of marker edge)
      'markerpath',   (an SVG path for drawing the specified marker)
      'zorder',       (viewing precedence when stacked with other objects)
      ]
  
      """
      self.msg += "    Attempting to draw a line "
      line, marker, shape = {}, {}, {}
      if props["linestyle"] and props["markerstyle"]:
          self.msg += "... with both lines+markers\n"
          mode = "lines+markers"
      elif props["linestyle"]:
          self.msg += "... with just lines\n"
          mode = "lines"
      elif props["markerstyle"]:
          self.msg += "... with just markers\n"
          mode = "markers"
      if props["linestyle"]:
          color = mpltools.merge_color_and_opacity(
              props["linestyle"]["color"], props["linestyle"]["alpha"]
          )
  
          if props["coordinates"] == "data":
              line = go.scatter.Line(
                  color=color,
                  width=props["linestyle"]["linewidth"],
                  dash=mpltools.convert_dash(
                      props["linestyle"]["dasharray"]
                  ),
              )
          else:
              shape = dict(
                  line=dict(
                      color=color,
                      width=props["linestyle"]["linewidth"],
                      dash=mpltools.convert_dash(
                          props["linestyle"]["dasharray"]
                      ),
                  )
              )
      if props["markerstyle"]:
          if props["coordinates"] == "data":
              marker = go.scatter.Marker(
                  opacity=props["markerstyle"]["alpha"],
                  color=props["markerstyle"]["facecolor"],
                  symbol=mpltools.convert_symbol(
                      props["markerstyle"]["marker"]
                  ),
                  size=props["markerstyle"]["markersize"],
                  line=dict(
                      color=props["markerstyle"]["edgecolor"],
                      width=props["markerstyle"]["edgewidth"],
                  ),
              )
          else:
              shape = dict(
                  opacity=props["markerstyle"]["alpha"],
                  fillcolor=props["markerstyle"]["facecolor"],
                  symbol=mpltools.convert_symbol(
                      props["markerstyle"]["marker"]
                  ),
                  size=props["markerstyle"]["markersize"],
                  line=dict(
                      color=props["markerstyle"]["edgecolor"],
                      width=props["markerstyle"]["edgewidth"],
                  ),
              )
      if props["coordinates"] == "data":
          marked_line = go.Scatter(
              mode=mode,
              name=(
                  str(props["label"])
                  if isinstance(props["label"], str)
                  else props["label"]
              ),
              x=[xy_pair[0] for xy_pair in props["data"]],
              y=[xy_pair[1] for xy_pair in props["data"]],
              xaxis="x{0}".format(self.axis_ct),
              yaxis="y{0}".format(self.axis_ct),
              line=line,
              marker=marker,
          )
          if self.x_is_mpl_date:
              formatter = (
                  self.current_mpl_ax.get_xaxis()
                  .get_major_formatter()
                  .__class__.__name__
              )
              marked_line["x"] = mpltools.mpl_dates_to_datestrings(
                  marked_line["x"], formatter
              )
          self.plotly_fig.add_trace(marked_line),
          self.msg += "    Heck yeah, I drew that line\n"
      elif props["coordinates"] == "axes":
          # dealing with legend graphical elements
          self.draw_legend_shapes(mode=mode, shape=shape, **props)
      else:
          self.msg += (
              "    Line didn't have 'data' coordinates, "
              "not drawing\n"
          )
          warnings.warn(
              "Bummer! Plotly can currently only draw Line2D "
              "objects from matplotlib that are in 'data' "
              "coordinates!"
          )
  
imports: import warnings
  import plotly.graph_objs
  from plotly.matplotlylib.mplexporter import Renderer
  from plotly.matplotlylib import mpltools
label_desc: Use image node_id 9 for calling the PlotlyRenderer obj's underlying member method code with example usage: obj.draw_marked_line() without return types