class_docstr: Layer is where Sugiyama layout organises vertices in hierarchical lists.
  The placement of a vertex is done by the Sugiyama class, but it highly relies on
  the *ordering* of vertices in each layer to reduce crossings.
  This ordering depends on the neighbors found in the upper or lower layers.
  
  Attributes:
      layout (SugiyamaLayout): a reference to the sugiyama layout instance that contains this layer
      upper (Layer): a reference to the *upper* layer (layer-1)
      lower (Layer): a reference to the *lower* layer (layer+1)
      crossings (int) : number of crossings detected in this layer
  
  Methods:
      setup (layout): set initial attributes values from provided layout
      nextlayer(): returns *next* layer in the current layout's direction parameter.
      prevlayer(): returns *previous* layer in the current layout's direction parameter.
      order(): compute *optimal* ordering of vertices within the layer.
class_docstr_tok: ["Layer","is","where","Sugiyama","layout","organises","vertices","in","hierarchical","lists",".","The","placement","of","a","vertex","is","done","by","the","Sugiyama","class",",","but","it","highly","relies","on","the","*","ordering","*","of","vertices","in","each","layer","to","reduce","crossings",".","This","ordering","depends","on","the","neighbors","found","in","the","upper","or","lower","layers",".","Attributes",":","layout","(","SugiyamaLayout",")",":","a","reference","to","the","sugiyama","layout","instance","that","contains","this","layer","upper","(","Layer",")",":","a","reference","to","the","*","upper","*","layer","(","layer-1",")","lower","(","Layer",")",":","a","reference","to","the","*","lower","*","layer","(","layer+1",")","crossings","(","int",")",":","number","of","crossings","detected","in","this","layer","Methods",":","setup","(","layout",")",":","set","initial","attributes","values","from","provided","layout","nextlayer","(",")",":","returns","*","next","*","layer","in","the","current","layout","'s","direction","parameter",".","prevlayer","(",")",":","returns","*","previous","*","layer","in","the","current","layout","'s","direction","parameter",".","order","(",")",":","compute","*","optimal","*","ordering","of","vertices","within","the","layer","."]
code: def prevlayer(self):
      return self.lower if self.layout.dirv == +1 else self.upper
  
file_path: pygraphistry/graphistry/layout/utils/layer.py
imports: from bisect import bisect
label_desc: Use image node_id 5 for calling the Layer obj's underlying member method code with example usage: obj.prevlayer() and returns: unknown