class_docstr: Dodge overlaps and place objects side-by-side
  
  Parameters
  ----------
  width :
      Dodging width, when different to the width of the
      individual elements. This is useful when you want
      to align narrow geoms with wider geoms
  preserve :
      Should dodging preserve the total width of all elements
      at a position, or the width of a single element?
code: def setup_params(self, data):
      if (
          ("xmin" not in data)
          and ("xmax" not in data)
          and (self.params["width"] is None)
      ):
          msg = (
              "Width not defined. "
              "Set with `position_dodge(width = ?)`"
          )
          raise PlotnineError(msg)
  
      params = copy(self.params)
  
      if params["preserve"] == "total":
          params["n"] = None
      else:
          # Count at the xmin values per panel and find the highest
          # overall count
          def max_xmin_values(gdf):
              try:
                  n = gdf["xmin"].value_counts().max()
              except KeyError:
                  n = gdf["x"].value_counts().max()
              return pd.DataFrame({"n": [n]})
  
          res = groupby_apply(data, "PANEL", max_xmin_values)
          params["n"] = res["n"].max()
      return params
  
file_path: plotnine/plotnine/positions/position_dodge.py
imports: from __future__ import annotations
  import typing
  from contextlib import suppress
  from copy import copy
  import numpy
  import pandas
  from .._utils import groupby_apply, match
  from ..exceptions import PlotnineError
  from .position import position
label_desc: Use image node_id 3 for calling the position_dodge obj's underlying member method code with example usage: obj.setup_params(data) and returns: params, pd