class_docstr: Displacement of overlapping bar or area marks along the value axis.
  
  Examples
  --------
  .. include:: ../docstrings/objects.Stack.rst
class_docstr_tok: ["Displacement","of","overlapping","bar","or","area","marks","along","the","value","axis",".","Examples","--","--","--","--","..","include",":",":","..","\/docstrings\/objects.Stack.rst"]
code: def _stack(self, df, orient):
      # TODO should stack do something with ymin/ymax style marks?
      # Should there be an upstream conversion to baseline/height parameterization?
  
      if df["baseline"].nunique() > 1:
          err = "Stack move cannot be used when baselines are already heterogeneous"
          raise RuntimeError(err)
  
      other = {"x": "y", "y": "x"}[orient]
      stacked_lengths = (df[other] - df["baseline"]).dropna().cumsum()
      offsets = stacked_lengths.shift(1).fillna(0)
  
      df[other] = stacked_lengths
      df["baseline"] = df["baseline"] + offsets
  
      return df
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import ClassVar, Callable, Optional, Union, cast
  import numpy
  from pandas import DataFrame
  from seaborn._core.groupby import GroupBy
  from seaborn._core.scales import Scale
  from seaborn._core.typing import Default
label_desc: Use image node_id 1 for calling the Stack obj's underlying member method code with example usage: obj._stack(df, orient) and returns: df