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"]
docstr: Reposition each node based on its outgoing (source) links.
docstr_tok: ["Reposition","each","node","based","on","its","outgoing","(","source",")","links","."]
code: def relaxRightToLeft(self, columns, alpha, beta, py):
      """Reposition each node based on its outgoing (source) links."""
      for column in columns[-2::-1]:
          for source in column:
              y = 0
              w = 0
              for link in source["sourceLinks"]:
                  target = link["target"]
                  v = link["value"] * (
                      target["column"] - source["column"]
                  )
                  y += self.sourceTop(source, target, py) * v
                  w += v
              if w <= 0:
                  continue
              dy = (y / w - source["y0"]) * alpha
              source["y0"] += dy
              source["y1"] += dy
              self.reorderNodeLinks(source)
          if self.p.node_sort:
              column.sort(key=cmp_to_key(self.ascendingBreadth))
          self.resolveCollisions(column, beta, py)
  
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 20 for calling the _layout_sankey obj's underlying member method code with example usage: obj.relaxRightToLeft(columns, alpha, beta, py) without return types