class_docstr: Computes a Sankey diagram from a Graph element for internal use in
  the Sankey element constructor.
  
  Adapted from d3-sankey under BSD-3 license.
  
  Source: https://github.com/d3/d3-sankey/tree/v0.12.3
class_docstr_tok: ["Computes","a","Sankey","diagram","from","a","Graph","element","for","internal","use","in","the","Sankey","element","constructor",".","Adapted","from","d3-sankey","under","BSD-3","license",".","Source",":","https",":","\/\/github.com\/d3\/d3-sankey\/tree\/v0.12.3"]
code: def computeNodeColumns(self, graph):
      depth_upper_bound = max(x["depth"] for x in graph["nodes"]) + 1
      x0, x1 = self.p.bounds[0], self.p.bounds[2]
      dx = self.p.node_width
      kx = (x1 - x0 - dx) / (depth_upper_bound - 1)
      columns = [[] for _ in range(depth_upper_bound)]
      for node in graph["nodes"]:
          node["column"] = max(
              0,
              min(
                  depth_upper_bound - 1,
                  math.floor(
                      node["depth"]
                      if node["sourceLinks"]
                      else depth_upper_bound - 1
                  ),
              ),
          )
          node["x0"] = x0 + node["column"] * kx
          node["x1"] = node["x0"] + dx
          columns[node["column"]].append(node)
      return columns
  
imports: import math
  from functools import cmp_to_key
  from itertools import cycle
  import numpy
  import param
  from ..core.data import Dataset
  from ..core.dimension import Dimension
  from ..core.operation import Operation
  from ..core.util import get_param_values, unique_array
  from .graphs import EdgePaths, Graph, Nodes
  from .util import quadratic_bezier
label_desc: Use image node_id 7 for calling the _layout_sankey obj's underlying member method code with example usage: obj.computeNodeColumns(graph) and returns: columns