@domoinc/get-path-string-with-two-bends

1.1.0 • Public • Published

getPathStringWithTwoBends

This lib will provide access to the following function.

  • getPathStringWithTwoBends

This function has been overloaded to handle two different sets of inputs. Passing 4 arguments assumes you will be passing two pints in (x1, y1) form Passing 5 arguments assumes you will be passing the starting point, and then bend deltas for y1, x1, and y2

//----------------------------------------------------------------------------------
// Example using 4 arguments getPathStringWithTwoBends
//----------------------------------------------------------------------------------
 var d = {x1:0, y1:0, x2:10, y2:10};
 var path = svg.append('path')
   .attr('style', 'fill:none;stroke:#90C4E3;stroke-miterlimit:10;')
   .attr('d', getPathStringWithTwoBends(d.x1, d.y1, d.x2, d.y2) );


//----------------------------------------------------------------------------------
// Example using 5 arguments getPathStringWithTwoBends
//----------------------------------------------------------------------------------
 var d = {x1:200, y1:100, x2:100, y2:100};
 var bendDeltas = getDeltas(d) // hypothetically returns { dy1, dx1, dy2 }
 var path = svg.append('path')
   .attr('style', 'fill:none;stroke:#90C4E3;stroke-miterlimit:10;')
   .attr('d', getPathStringWithTwoBends(d.x1, d.x2, bendDeltas.dy1, bendDeltas.dx1, bendDeltas.dy2));

Readme

Keywords

Package Sidebar

Install

npm i @domoinc/get-path-string-with-two-bends

Weekly Downloads

1

Version

1.1.0

License

SEE LICENSE IN LICENSE

Last publish

Collaborators

  • ttingey
  • morganjohn12
  • jeff.smith
  • cameronnokes
  • congrieb
  • diazd2
  • statianzo
  • mountain01
  • th3uiguy
  • jasonleehodges
  • jmnemelka