Skip to content

Commit

Permalink
First working version of the web
Browse files Browse the repository at this point in the history
  • Loading branch information
rveciana committed Nov 8, 2016
1 parent ce04cef commit 392bf90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ To use with npm, just type
USAGE
=====

var path = require("svg-path-properties");
var properties = path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
var length = properties.getTotalLength();
var point = properties.getPointAtLength(200);
var path = require("svg-path-properties");
var properties = path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
var length = properties.getTotalLength();
var point = properties.getPointAtLength(200);
var tangent = properties.getTangentAtLength(200);
var allProperties = properties.getPropertiesAtLength(200);

[Check this block](http://bl.ocks.org/rveciana/209fa7efeb01f05fa4a544a76ac8ed91) to see how it works with the browser.

Expand All @@ -30,9 +32,10 @@ Some parts of the code are taken from other libraries or questions at StackOverf

For Bézier curves:

http://bl.ocks.org/hnakamur/e7efd0602bfc15f66fc5, https://gist.github.com/tunght13488/6744e77c242cc7a94859, http://stackoverflow.com/questions/11854907/calculate-the-length-of-a-segment-of-a-quadratic-bezier and
http://pomax.github.io/bezierinfo
* http://bl.ocks.org/hnakamur/e7efd0602bfc15f66fc5, https://gist.github.com/tunght13488/6744e77c242cc7a94859
* http://stackoverflow.com/questions/11854907/calculate-the-length-of-a-segment-of-a-quadratic-bezier
* http://pomax.github.io/bezierinfo

For path parsing:

https://github.com/jkroso/parse-svg-path
* https://github.com/jkroso/parse-svg-path
2 changes: 1 addition & 1 deletion build/path-properties.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// http://geoexamples.com/path-properties/ Version 0.0.2. Copyright 2016 Roger Veciana i Rovira.
// http://geoexamples.com/path-properties/ Version 0.1.0. Copyright 2016 Roger Veciana i Rovira.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
Expand Down

0 comments on commit 392bf90

Please sign in to comment.