escher.js
/**
 * Return an object containing beziers for the segments object.
 * segments: A segments object, e.g. *escher.Map.segments*.
 * reaction_id: The reaction id for the segments.
 */
Return an object containing beziers for the segments object.
segments: A segments object, e.g.
Return an object containing beziers for the segments object . segments : A segments object e . g .
function new_beziers_for_segments (segments, reaction_id) {
  var beziers = {}
  for (var segment_id in segments) {
    var segment = segments[segment_id]
    ;[ 'b1', 'b2' ].forEach(function (bez) {
      var seg_bez = segment[bez]
      if (seg_bez !== null) {
        var bezier_id = bezier_id_for_segment_id(segment_id, bez)
        beziers[bezier_id] = {
          bezier: bez,
          x: seg_bez.x,
          y: seg_bez.y,
          reaction_id: reaction_id,
          segment_id: segment_id
        }
      }
    })
  }
  return beziers
}
function new_beziers_for_segments ( segments , reaction_id ) { var beziers = { } for ( var segment_id in segments ) { var segment = segments [ segment_id ] ; [ 'b1' , 'b2' ] . forEach ( function ( bez ) { var seg_bez = segment [ bez ] if ( seg_bez !== null ) { var bezier_id = bezier_id_for_segment_id ( segment_id , bez ) beziers [ bezier_id ] = { bezier : bez , x : seg_bez . x , y : seg_bez . y , reaction_id : reaction_id , segment_id : segment_id } } } ) } return beziers }
Return an object containing beziers for the segments object.
Return an object containing beziers for the segments object .