├── .gitignore ├── LICENSE ├── README.md ├── bench └── bench.js ├── index.d.ts ├── package.json ├── simplify.js └── test ├── fixtures └── 1k.json └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | ### Node template 2 | # Logs 3 | logs 4 | *.log 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 28 | node_modules 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Vladimir Agafonkin 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list 11 | of conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 15 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 17 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 21 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Simplify.js is a high-performance JavaScript polyline simplification library by Vladimir Agafonkin, extracted from [Leaflet](http://leafletjs.com). 2 | 3 | Checkout the demo with docs: http://mourner.github.io/simplify-js/ 4 | 5 | #### Ports 6 | 7 | * Python: [omarestrella / simplify.py](https://github.com/omarestrella/simplify.py) (by Omar Estrella) 8 | * PHP: [AKeN / simplify-php](https://github.com/AKeN/simplify-php) (by Rotari Gheorghe) 9 | * PHP: [andreychumak / simplify-php](https://github.com/andreychumak/simplify-php) (by Andrey Chumak) 10 | * Java: [ekeneijeoma / simplify-java](https://github.com/ekeneijeoma/simplify-java) (by Ekene Ijeoma) 11 | * Java: [hgoebl / simplify-java](https://github.com/hgoebl/simplify-java) (by Heinrich Göbl) 12 | * Processing: [ekeneijeoma / simplify-processing](https://github.com/ekeneijeoma/simplify-processing) (by Ekene Ijeoma) 13 | * AS3: [fnicollet / simplify-as3](https://github.com/fnicollet/simplify-as3) (by Fabien Nicollet) 14 | * Rust: [calvinmetcalf / simplify-rs](https://github.com/calvinmetcalf/simplify-rs) (by Calvin Metcalf) 15 | * Rust: [kade-robertson / simplify-polyline](https://github.com/kade-robertson/simplify-polyline) (by Kade Robertson) 16 | * Ruby: [odlp / simplify_rb](https://github.com/odlp/simplify_rb) (by Oliver Peate) 17 | * Go: [yrsh / simplify_go](https://github.com/yrsh/simplify-go) (by Anton Korotkikh) 18 | * C# (Portable): [imshz / simplify-net](https://github.com/imshz/simplify-net) (by Shees Ul-Hassan) 19 | * Swift: [malcommac / SwiftSimplify](https://github.com/malcommac/SwiftSimplify) (by Daniele Margutti) 20 | * Unreal Engine: [SINTEF-9012 / SimplifyUnreal](https://github.com/SINTEF-9012/SimplifyUnreal) (by Antoine Pultier) 21 | * Postgres (using PL/Python): [shubhamjain / simplify-coordinates-sql](https://github.com/shubhamjain/simplify-coordinates-sql) (by Shubham Jain) 22 | -------------------------------------------------------------------------------- /bench/bench.js: -------------------------------------------------------------------------------- 1 | 2 | var Benchmark = require('benchmark'); 3 | var simplify = require('../simplify'); 4 | 5 | var points = require('../test/fixtures/1k.json'); 6 | 7 | console.log('Benchmarking simplify on ' + points.length + ' points...'); 8 | 9 | new Benchmark.Suite() 10 | .add('simplify (HQ)', function() { 11 | simplify(points, 1, true); 12 | }) 13 | .add('simplify', function() { 14 | simplify(points, 1, false); 15 | }) 16 | .on('cycle', function(event) { 17 | console.log(String(event.target)); 18 | }) 19 | .run(); 20 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | interface Point { 2 | x: number; 3 | y: number; 4 | } 5 | 6 | declare function simplify(points: T[], tolerance?: number, highQuality?: boolean): T[]; 7 | declare namespace simplify {} 8 | 9 | export = simplify; 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simplify-js", 3 | "version": "1.2.4", 4 | "description": "A high-performance JavaScript 2D/3D polyline simplification library", 5 | "homepage": "http://mourner.github.com/simplify-js/", 6 | "author": "Vladimir Agafonkin", 7 | "license": "BSD-2-Clause", 8 | "keywords": [ 9 | "math", 10 | "geometry", 11 | "polyline", 12 | "simplification" 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "git://github.com/mourner/simplify-js.git" 17 | }, 18 | "main": "simplify.js", 19 | "files": [ 20 | "index.d.ts", 21 | "simplify.js" 22 | ], 23 | "types": "index.d.ts", 24 | "devDependencies": { 25 | "benchmark": "^2.1.4", 26 | "faucet": "0.0.1", 27 | "jshint": "^2.11.0", 28 | "tape": "^4.13.0" 29 | }, 30 | "scripts": { 31 | "test": "jshint simplify.js test/test.js && node test/test.js | faucet" 32 | }, 33 | "jshintConfig": { 34 | "quotmark": "single", 35 | "trailing": true, 36 | "unused": true 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /simplify.js: -------------------------------------------------------------------------------- 1 | /* 2 | (c) 2017, Vladimir Agafonkin 3 | Simplify.js, a high-performance JS polyline simplification library 4 | mourner.github.io/simplify-js 5 | */ 6 | 7 | (function () { 'use strict'; 8 | 9 | // to suit your point format, run search/replace for '.x' and '.y'; 10 | // for 3D version, see 3d branch (configurability would draw significant performance overhead) 11 | 12 | // square distance between 2 points 13 | function getSqDist(p1, p2) { 14 | 15 | var dx = p1.x - p2.x, 16 | dy = p1.y - p2.y; 17 | 18 | return dx * dx + dy * dy; 19 | } 20 | 21 | // square distance from a point to a segment 22 | function getSqSegDist(p, p1, p2) { 23 | 24 | var x = p1.x, 25 | y = p1.y, 26 | dx = p2.x - x, 27 | dy = p2.y - y; 28 | 29 | if (dx !== 0 || dy !== 0) { 30 | 31 | var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy); 32 | 33 | if (t > 1) { 34 | x = p2.x; 35 | y = p2.y; 36 | 37 | } else if (t > 0) { 38 | x += dx * t; 39 | y += dy * t; 40 | } 41 | } 42 | 43 | dx = p.x - x; 44 | dy = p.y - y; 45 | 46 | return dx * dx + dy * dy; 47 | } 48 | // rest of the code doesn't care about point format 49 | 50 | // basic distance-based simplification 51 | function simplifyRadialDist(points, sqTolerance) { 52 | 53 | var prevPoint = points[0], 54 | newPoints = [prevPoint], 55 | point; 56 | 57 | for (var i = 1, len = points.length; i < len; i++) { 58 | point = points[i]; 59 | 60 | if (getSqDist(point, prevPoint) > sqTolerance) { 61 | newPoints.push(point); 62 | prevPoint = point; 63 | } 64 | } 65 | 66 | if (prevPoint !== point) newPoints.push(point); 67 | 68 | return newPoints; 69 | } 70 | 71 | function simplifyDPStep(points, first, last, sqTolerance, simplified) { 72 | var maxSqDist = sqTolerance, 73 | index; 74 | 75 | for (var i = first + 1; i < last; i++) { 76 | var sqDist = getSqSegDist(points[i], points[first], points[last]); 77 | 78 | if (sqDist > maxSqDist) { 79 | index = i; 80 | maxSqDist = sqDist; 81 | } 82 | } 83 | 84 | if (maxSqDist > sqTolerance) { 85 | if (index - first > 1) simplifyDPStep(points, first, index, sqTolerance, simplified); 86 | simplified.push(points[index]); 87 | if (last - index > 1) simplifyDPStep(points, index, last, sqTolerance, simplified); 88 | } 89 | } 90 | 91 | // simplification using Ramer-Douglas-Peucker algorithm 92 | function simplifyDouglasPeucker(points, sqTolerance) { 93 | var last = points.length - 1; 94 | 95 | var simplified = [points[0]]; 96 | simplifyDPStep(points, 0, last, sqTolerance, simplified); 97 | simplified.push(points[last]); 98 | 99 | return simplified; 100 | } 101 | 102 | // both algorithms combined for awesome performance 103 | function simplify(points, tolerance, highestQuality) { 104 | 105 | if (points.length <= 2) return points; 106 | 107 | var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1; 108 | 109 | points = highestQuality ? points : simplifyRadialDist(points, sqTolerance); 110 | points = simplifyDouglasPeucker(points, sqTolerance); 111 | 112 | return points; 113 | } 114 | 115 | // export as AMD module / Node module / browser or worker variable 116 | if (typeof define === 'function' && define.amd) define(function() { return simplify; }); 117 | else if (typeof module !== 'undefined') { 118 | module.exports = simplify; 119 | module.exports.default = simplify; 120 | } else if (typeof self !== 'undefined') self.simplify = simplify; 121 | else window.simplify = simplify; 122 | 123 | })(); 124 | -------------------------------------------------------------------------------- /test/fixtures/1k.json: -------------------------------------------------------------------------------- 1 | [{"x":224.55,"y":250.15},{"x":224.69,"y":250.61},{"x":225.15,"y":249.8},{"x":224.16,"y":249.25},{"x":224.26,"y":248.87},{"x":224.93,"y":247.89},{"x":225.18,"y":246.9},{"x":226.56,"y":245.62},{"x":226.9,"y":245.04},{"x":226.91,"y":244.19},{"x":227.47,"y":244.29},{"x":227.98,"y":244.1},{"x":229.79,"y":244.14},{"x":231.58,"y":243.65},{"x":232.32,"y":242.32},{"x":232.76,"y":242.1},{"x":233.31,"y":241.45},{"x":233.59,"y":240.66},{"x":233.38,"y":238.66},{"x":234.32,"y":237.77},{"x":234.98,"y":236.06},{"x":235.45,"y":235.85},{"x":237.05,"y":235.71},{"x":237.44,"y":235.95},{"x":238.8,"y":235.98},{"x":240.13,"y":234.6},{"x":243.53,"y":233.18},{"x":243.72,"y":232.87},{"x":244.21,"y":232.76},{"x":244.67,"y":232.26},{"x":244.79,"y":231.8},{"x":245.39,"y":231.58},{"x":245.71,"y":231.27},{"x":247.44,"y":229},{"x":248.09,"y":228.83},{"x":248.75,"y":228.18},{"x":248.91,"y":227.75},{"x":249.91,"y":226.75},{"x":250.68,"y":225.45},{"x":251.76,"y":224.93},{"x":253.59,"y":223.23},{"x":254.27,"y":222.87},{"x":254.68,"y":222.92},{"x":255.45,"y":222.66},{"x":255.65,"y":222.25},{"x":256.48,"y":221.57},{"x":256.9,"y":221.42},{"x":257.8,"y":220.52},{"x":258.29,"y":220.46},{"x":259.12,"y":219.84},{"x":259.65,"y":219.81},{"x":259.69,"y":219.55},{"x":259.94,"y":219.41},{"x":259.96,"y":219.1},{"x":260.68,"y":218.47},{"x":260.62,"y":218.23},{"x":260.98,"y":218.1},{"x":261.38,"y":217.5},{"x":262.15,"y":216.86},{"x":262.15,"y":216},{"x":262.59,"y":215.31},{"x":263,"y":215.52},{"x":263.31,"y":215.31},{"x":265.12,"y":215.33},{"x":265.37,"y":215.08},{"x":266.19,"y":214.86},{"x":267.11,"y":214.04},{"x":267.76,"y":213.81},{"x":267.97,"y":212.72},{"x":268.57,"y":212.22},{"x":269,"y":212.1},{"x":269.13,"y":211.31},{"x":270.22,"y":209.55},{"x":270.42,"y":208.65},{"x":271.35,"y":206.48},{"x":271.16,"y":204.85},{"x":271.25,"y":204.51},{"x":272.26,"y":203.54},{"x":272.52,"y":203.4},{"x":272.91,"y":203.47},{"x":273.16,"y":203.05},{"x":273.09,"y":202.64},{"x":273.57,"y":201.84},{"x":273.24,"y":200.81},{"x":273.26,"y":200.35},{"x":272.56,"y":198.59},{"x":272.47,"y":197.87},{"x":272.65,"y":196.88},{"x":272.18,"y":195.66},{"x":272.46,"y":194.59},{"x":272.82,"y":194.1},{"x":273.12,"y":192.16},{"x":274.21,"y":190.81},{"x":276.63,"y":189.43},{"x":277.2,"y":189.42},{"x":277.62,"y":189.03},{"x":278,"y":188.43},{"x":278.14,"y":187.72},{"x":278.89,"y":187.1},{"x":279.35,"y":184.47},{"x":279.94,"y":182.84},{"x":280.02,"y":182.02},{"x":280.36,"y":181.41},{"x":282.49,"y":180.2},{"x":283.6,"y":180.14},{"x":285.89,"y":177.93},{"x":286.51,"y":177.74},{"x":286.51,"y":174.97},{"x":286.88,"y":173.04},{"x":286.83,"y":172.31},{"x":288.11,"y":171.63},{"x":288.83,"y":170.76},{"x":289.02,"y":170.83},{"x":289.34,"y":170.35},{"x":289.37,"y":169.96},{"x":290.07,"y":169.32},{"x":290.07,"y":168.66},{"x":290.41,"y":168.18},{"x":290.56,"y":167.19},{"x":291.34,"y":165.93},{"x":291.34,"y":164.45},{"x":292.41,"y":159.37},{"x":293.32,"y":158.78},{"x":294.89,"y":157.33},{"x":295.21,"y":156.86},{"x":295.71,"y":156.55},{"x":296.26,"y":156.57},{"x":296.91,"y":155.64},{"x":298.25,"y":155.53},{"x":298.69,"y":155.19},{"x":299.08,"y":155.3},{"x":299.69,"y":155.09},{"x":300.4,"y":155.31},{"x":301.77,"y":155.4},{"x":302.39,"y":155.17},{"x":303.28,"y":155.17},{"x":304.16,"y":154.83},{"x":305,"y":154.86},{"x":305.76,"y":154.33},{"x":306.8,"y":154.06},{"x":307.25,"y":153.61},{"x":307.94,"y":153.43},{"x":308.74,"y":153.92},{"x":310.09,"y":153.8},{"x":310.87,"y":153.12},{"x":311.14,"y":152.68},{"x":311.1,"y":152.41},{"x":311.44,"y":152.21},{"x":312.63,"y":152.11},{"x":313.39,"y":151.64},{"x":314.04,"y":151.61},{"x":314.49,"y":151.27},{"x":314.95,"y":151.37},{"x":315.01,"y":150.76},{"x":315.63,"y":150.29},{"x":316.54,"y":149.92},{"x":316.67,"y":149.58},{"x":317.12,"y":149.2},{"x":317.26,"y":148.67},{"x":317.1,"y":148.35},{"x":317.33,"y":147.82},{"x":318.7,"y":146.87},{"x":318.92,"y":146.51},{"x":319.39,"y":146.2},{"x":319.75,"y":145.16},{"x":321,"y":144.76},{"x":321.37,"y":144.26},{"x":321.61,"y":143.55},{"x":324.39,"y":142.35},{"x":325,"y":141.75},{"x":325.3,"y":140.82},{"x":325.7,"y":140.45},{"x":325.73,"y":140.23},{"x":326.1,"y":140.08},{"x":326.27,"y":139.6},{"x":327.29,"y":139.43},{"x":328.26,"y":139.49},{"x":328.77,"y":139.29},{"x":329.75,"y":138.04},{"x":330.33,"y":137.57},{"x":331.77,"y":137.48},{"x":332.2,"y":137.78},{"x":333.94,"y":138.17},{"x":334.22,"y":138.36},{"x":337.6,"y":138.61},{"x":338.49,"y":139.04},{"x":338.91,"y":139.46},{"x":341.06,"y":139.74},{"x":341.48,"y":139.96},{"x":342.92,"y":139.36},{"x":345.95,"y":139.2},{"x":346.8,"y":138.88},{"x":347.37,"y":138.23},{"x":348.87,"y":138.35},{"x":349.47,"y":138.79},{"x":352.86,"y":138.52},{"x":353.58,"y":138.61},{"x":354,"y":138.48},{"x":355.41,"y":138.6},{"x":356.64,"y":138.3},{"x":358.69,"y":138.57},{"x":361.11,"y":138.35},{"x":362.24,"y":138.46},{"x":362.92,"y":138.76},{"x":363.58,"y":138.53},{"x":364.44,"y":138.48},{"x":365.39,"y":138.74},{"x":366.01,"y":138.47},{"x":367.8,"y":138.1},{"x":369.98,"y":137.89},{"x":370.82,"y":138.25},{"x":372.24,"y":138.21},{"x":373.71,"y":138.64},{"x":375.12,"y":138.53},{"x":376.08,"y":138.63},{"x":379.45,"y":139.95},{"x":380.38,"y":140.19},{"x":381.02,"y":140.07},{"x":381.86,"y":140.18},{"x":382.52,"y":140.4},{"x":383.38,"y":141.16},{"x":385.1,"y":142},{"x":387.39,"y":142.51},{"x":387.67,"y":142.49},{"x":387.78,"y":142.12},{"x":389.17,"y":141.03},{"x":389.39,"y":140.38},{"x":390.47,"y":140.07},{"x":390.92,"y":139.47},{"x":391.14,"y":139.58},{"x":391.28,"y":139.39},{"x":393.29,"y":139.65},{"x":395.17,"y":139.38},{"x":395.55,"y":139.48},{"x":395.98,"y":139.3},{"x":398.28,"y":139.63},{"x":398.75,"y":139.84},{"x":400.57,"y":139.55},{"x":402.4,"y":139.89},{"x":402.45,"y":140.15},{"x":403.03,"y":140.26},{"x":404.11,"y":140.85},{"x":404.97,"y":141.02},{"x":405.47,"y":141.48},{"x":405.79,"y":141.49},{"x":406.09,"y":141.23},{"x":406.53,"y":141.13},{"x":407.24,"y":141.17},{"x":407.51,"y":141},{"x":408.37,"y":141.17},{"x":409.52,"y":141.14},{"x":410.11,"y":140.33},{"x":410.76,"y":140.08},{"x":411.69,"y":140.42},{"x":414.13,"y":139.64},{"x":414.47,"y":139.84},{"x":414.82,"y":139.75},{"x":414.99,"y":139.32},{"x":417.7,"y":137.3},{"x":419.56,"y":135.5},{"x":421.29,"y":134.3},{"x":421.9,"y":133.5},{"x":422.7,"y":131.95},{"x":423.23,"y":131.48},{"x":423.38,"y":130.94},{"x":426.08,"y":129.26},{"x":427.15,"y":128.21},{"x":427.72,"y":127.3},{"x":429.37,"y":126.9},{"x":429.83,"y":126.52},{"x":430.08,"y":125.88},{"x":432.07,"y":125.45},{"x":433.14,"y":125.07},{"x":434.13,"y":124.46},{"x":434.88,"y":123.79},{"x":435.25,"y":123},{"x":436.4,"y":122.42},{"x":437.77,"y":122.05},{"x":439.1,"y":120.02},{"x":439.6,"y":119.74},{"x":440.85,"y":119.64},{"x":441.91,"y":119.03},{"x":442.73,"y":118.95},{"x":445.6,"y":117.92},{"x":446.05,"y":117.97},{"x":447.34,"y":117.65},{"x":447.77,"y":117.29},{"x":448.22,"y":117.18},{"x":448.99,"y":116.53},{"x":451.14,"y":115.9},{"x":452.8,"y":115.83},{"x":455.08,"y":115.26},{"x":456.19,"y":114.32},{"x":458.08,"y":114.11},{"x":458.64,"y":113.86},{"x":460,"y":112.48},{"x":465.64,"y":111.28},{"x":466.42,"y":110.95},{"x":467.42,"y":111},{"x":468.84,"y":110.79},{"x":469.75,"y":110.92},{"x":471.64,"y":110.14},{"x":474.93,"y":107.87},{"x":475.8,"y":107.73},{"x":477.38,"y":107.87},{"x":478.2,"y":108.1},{"x":481.19,"y":108.21},{"x":481.8,"y":107.84},{"x":483.39,"y":107.3},{"x":486.51,"y":106.75},{"x":486.37,"y":107.53},{"x":486.79,"y":107.98},{"x":487.66,"y":108.73},{"x":488.86,"y":109.07},{"x":489.2,"y":109.45},{"x":491.39,"y":109.36},{"x":492.01,"y":109.1},{"x":493.15,"y":109.03},{"x":493.57,"y":108.63},{"x":493.79,"y":108.63},{"x":494.48,"y":109.16},{"x":495.27,"y":110.44},{"x":495.78,"y":110.65},{"x":496.09,"y":111.22},{"x":497.28,"y":111.75},{"x":497.3,"y":112.24},{"x":497.55,"y":112.68},{"x":498.84,"y":113.96},{"x":501.08,"y":115.96},{"x":502.08,"y":116.42},{"x":502.63,"y":117.28},{"x":503.71,"y":118.01},{"x":504.16,"y":118.77},{"x":504.18,"y":119.09},{"x":504.74,"y":119.66},{"x":505.18,"y":119.8},{"x":507.32,"y":119.66},{"x":508.21,"y":119.83},{"x":508.79,"y":120.46},{"x":509.6,"y":120.56},{"x":510.02,"y":121.08},{"x":512.96,"y":122.35},{"x":513.27,"y":121.99},{"x":513.66,"y":122.18},{"x":514.28,"y":122.2},{"x":514.8,"y":121.6},{"x":515.49,"y":121.39},{"x":516.2,"y":121.4},{"x":517.51,"y":120.87},{"x":517.86,"y":121.04},{"x":518.63,"y":120.89},{"x":518.88,"y":121.42},{"x":519.95,"y":122.03},{"x":520.43,"y":122.49},{"x":520.56,"y":122.87},{"x":521.93,"y":123.43},{"x":523.01,"y":125.73},{"x":524.09,"y":126.88},{"x":524.55,"y":126.97},{"x":524.92,"y":127.38},{"x":525.36,"y":127.41},{"x":526.63,"y":127.94},{"x":527.99,"y":127.95},{"x":528.98,"y":127.61},{"x":529.57,"y":127.86},{"x":529.89,"y":128.14},{"x":530.53,"y":129.23},{"x":530.87,"y":129.47},{"x":530.69,"y":129.79},{"x":530.81,"y":132.77},{"x":532.48,"y":134.47},{"x":533.15,"y":136.66},{"x":533.9,"y":137.9},{"x":534.03,"y":138.86},{"x":533.91,"y":139.82},{"x":534.21,"y":140.93},{"x":534.77,"y":141.58},{"x":535.23,"y":142.66},{"x":536.2,"y":143.65},{"x":536.69,"y":144.76},{"x":537.01,"y":144.47},{"x":537.85,"y":144.57},{"x":538.5,"y":144.83},{"x":539.24,"y":145.53},{"x":539.45,"y":146.73},{"x":539.27,"y":147.24},{"x":541.59,"y":148.01},{"x":542.6,"y":148.02},{"x":543.15,"y":148.44},{"x":543.68,"y":148.54},{"x":546.12,"y":148.44},{"x":546.26,"y":148.13},{"x":547.74,"y":147.7},{"x":548.95,"y":147.72},{"x":549.68,"y":147.45},{"x":550.4,"y":147.56},{"x":550.66,"y":147.27},{"x":552,"y":147.31},{"x":552.94,"y":148.22},{"x":554.75,"y":148.14},{"x":555.02,"y":148.64},{"x":555.32,"y":148.74},{"x":556.16,"y":148.56},{"x":557.88,"y":148.83},{"x":559.07,"y":148.41},{"x":559.7,"y":148.48},{"x":559.99,"y":148.85},{"x":560.62,"y":148.99},{"x":560.92,"y":149.29},{"x":562.06,"y":149.76},{"x":565.3,"y":149.57},{"x":566.51,"y":148.91},{"x":567.69,"y":148.91},{"x":567.89,"y":148.98},{"x":567.77,"y":149.19},{"x":568.1,"y":149.46},{"x":568.52,"y":149.57},{"x":568.94,"y":149.45},{"x":569.23,"y":150.05},{"x":570.38,"y":151.12},{"x":571.1,"y":152.6},{"x":571.76,"y":153.09},{"x":575.25,"y":157.26},{"x":576.85,"y":157.4},{"x":580.62,"y":158.15},{"x":581.86,"y":158.14},{"x":583.83,"y":157.79},{"x":584.98,"y":158.17},{"x":586.67,"y":158.32},{"x":592.8,"y":158.21},{"x":593.19,"y":157.95},{"x":595.17,"y":157.66},{"x":596.17,"y":157.78},{"x":598.02,"y":157.63},{"x":598.61,"y":157.4},{"x":599.48,"y":157.39},{"x":601.06,"y":157.06},{"x":601.53,"y":156.85},{"x":601.68,"y":157.03},{"x":605.03,"y":157.05},{"x":606.47,"y":157.69},{"x":606.9,"y":157.71},{"x":608.23,"y":157.27},{"x":608.5,"y":157.46},{"x":608.81,"y":157.35},{"x":609.47,"y":158.05},{"x":609.86,"y":157.92},{"x":611.26,"y":158.55},{"x":612.3,"y":158.44},{"x":614.73,"y":158.8},{"x":617.74,"y":159.86},{"x":618.14,"y":160.29},{"x":617.91,"y":160.98},{"x":619.71,"y":164.86},{"x":621.52,"y":166.36},{"x":622,"y":167.04},{"x":622.11,"y":170.69},{"x":622.01,"y":171.26},{"x":623.66,"y":173.26},{"x":624.15,"y":176.75},{"x":624.68,"y":177.5},{"x":625.05,"y":179.03},{"x":625.69,"y":179.83},{"x":626.06,"y":181.1},{"x":625.92,"y":185.63},{"x":626.45,"y":185.96},{"x":626.72,"y":186.8},{"x":627.07,"y":186.84},{"x":627.62,"y":188.65},{"x":628.11,"y":189.21},{"x":628.09,"y":190.19},{"x":629.18,"y":192.37},{"x":629.55,"y":194.6},{"x":629.93,"y":194.86},{"x":630.78,"y":194.7},{"x":632.12,"y":194.86},{"x":633.06,"y":195.47},{"x":635.78,"y":196.31},{"x":638.39,"y":195.52},{"x":638.9,"y":195.61},{"x":640.48,"y":197.63},{"x":640.44,"y":199.01},{"x":641.26,"y":200.81},{"x":644.54,"y":202.78},{"x":645.02,"y":202.82},{"x":645.55,"y":202.57},{"x":647.72,"y":202.67},{"x":648.57,"y":203.55},{"x":648.85,"y":203.38},{"x":648.94,"y":203.12},{"x":649.85,"y":203.32},{"x":651,"y":204.22},{"x":651.77,"y":204.56},{"x":653.14,"y":206.28},{"x":655.45,"y":208.18},{"x":656.46,"y":208.26},{"x":657.19,"y":208.81},{"x":657.89,"y":209.06},{"x":658.59,"y":210.25},{"x":659.45,"y":210.83},{"x":661.57,"y":213.37},{"x":664.15,"y":215.09},{"x":664.54,"y":215},{"x":664.76,"y":215.19},{"x":664.73,"y":215.38},{"x":665.8,"y":215.98},{"x":666.58,"y":216.94},{"x":667.21,"y":217.45},{"x":669.67,"y":219.1},{"x":669.72,"y":219.89},{"x":670.07,"y":220.84},{"x":670.36,"y":221.01},{"x":671.19,"y":222.26},{"x":671.55,"y":222.55},{"x":671.9,"y":222.07},{"x":672.3,"y":222.11},{"x":672.9,"y":221.69},{"x":673.65,"y":221.62},{"x":674.39,"y":221.09},{"x":675.68,"y":220.97},{"x":677.51,"y":221.33},{"x":677.85,"y":220.89},{"x":678.6,"y":220.39},{"x":679.03,"y":219.79},{"x":681.31,"y":218.71},{"x":681.6,"y":217.98},{"x":681.8,"y":217.85},{"x":682.62,"y":218.16},{"x":683.68,"y":217.45},{"x":686.87,"y":217.67},{"x":687.49,"y":217.59},{"x":688.81,"y":218.15},{"x":690.62,"y":218.21},{"x":695.25,"y":219.15},{"x":696.58,"y":218.76},{"x":697.68,"y":218.83},{"x":699.34,"y":218.53},{"x":699.44,"y":218.09},{"x":700.64,"y":217.98},{"x":701.01,"y":217.32},{"x":700.98,"y":216.37},{"x":701.16,"y":215.87},{"x":702.86,"y":214.71},{"x":703.12,"y":214.36},{"x":707.1,"y":215.09},{"x":707.62,"y":214.92},{"x":709.34,"y":215.08},{"x":709.97,"y":215.36},{"x":710.42,"y":215.78},{"x":712.26,"y":215.87},{"x":713.11,"y":215.63},{"x":713.67,"y":215.25},{"x":714.04,"y":215.23},{"x":714.79,"y":214.47},{"x":715.81,"y":214.36},{"x":717.26,"y":213.55},{"x":717.92,"y":213.57},{"x":718.67,"y":213.28},{"x":721.25,"y":212.98},{"x":721.49,"y":212.81},{"x":721.76,"y":213.15},{"x":723.17,"y":213.29},{"x":723.44,"y":214},{"x":724.02,"y":214.27},{"x":726.71,"y":213.43},{"x":726.88,"y":213.52},{"x":727.13,"y":213.32},{"x":727.28,"y":213.43},{"x":727.81,"y":213.36},{"x":728.05,"y":213.1},{"x":728.07,"y":211.23},{"x":728.78,"y":210.03},{"x":729.98,"y":208.73},{"x":730.99,"y":208.38},{"x":732.01,"y":208.25},{"x":733.02,"y":207.73},{"x":733.8,"y":208.35},{"x":735.32,"y":208.2},{"x":735.9,"y":207.87},{"x":737.28,"y":206.1},{"x":737.56,"y":205.95},{"x":737.78,"y":206.1},{"x":737.69,"y":205.78},{"x":738.66,"y":205.44},{"x":738.96,"y":204.97},{"x":739.94,"y":204.77},{"x":742.94,"y":204.7},{"x":743.39,"y":204.86},{"x":744.12,"y":205.44},{"x":745.4,"y":205.53},{"x":746.71,"y":205.36},{"x":747.72,"y":204.96},{"x":747.93,"y":204.54},{"x":748.7,"y":204.81},{"x":749.82,"y":204.91},{"x":750.6,"y":205.38},{"x":751.17,"y":205.32},{"x":751.64,"y":205.58},{"x":751.78,"y":205.93},{"x":753.07,"y":206.02},{"x":754.04,"y":206.39},{"x":754.36,"y":206.67},{"x":755.78,"y":206.77},{"x":756.67,"y":206.5},{"x":756.99,"y":206.68},{"x":758.49,"y":206.49},{"x":759.99,"y":206.84},{"x":760.57,"y":206.82},{"x":761.03,"y":207.05},{"x":762.69,"y":207.01},{"x":763.05,"y":207.31},{"x":763.56,"y":207.32},{"x":764.71,"y":207.68},{"x":765.3,"y":207.74},{"x":765.97,"y":207.51},{"x":767.35,"y":208.01},{"x":767.71,"y":207.96},{"x":769.98,"y":208.42},{"x":771.92,"y":209.93},{"x":773.43,"y":210.6},{"x":773.77,"y":211.31},{"x":773.63,"y":211.74},{"x":773.94,"y":212.21},{"x":774.16,"y":212.25},{"x":774.26,"y":212.59},{"x":775.22,"y":212.7},{"x":776.36,"y":213.25},{"x":777.16,"y":214.24},{"x":777.95,"y":214.82},{"x":778.4,"y":214.87},{"x":778.64,"y":215.14},{"x":778.66,"y":215.48},{"x":779.21,"y":215.85},{"x":779.6,"y":216.87},{"x":780.98,"y":217.05},{"x":781.53,"y":217.41},{"x":782.83,"y":217.49},{"x":784.2,"y":218.16},{"x":785.44,"y":218.23},{"x":785.78,"y":218.02},{"x":787.96,"y":218.51},{"x":789.45,"y":218.36},{"x":789.93,"y":217.8},{"x":792.07,"y":217.27},{"x":793.31,"y":216.27},{"x":794.3,"y":215.97},{"x":796.24,"y":214.79},{"x":797.09,"y":214.55},{"x":797.67,"y":214.73},{"x":798.01,"y":214.61},{"x":798.25,"y":214.7},{"x":799.15,"y":214.29},{"x":800.24,"y":214.62},{"x":800.4,"y":215.1},{"x":801.04,"y":215.54},{"x":802.54,"y":215.57},{"x":803.32,"y":216.22},{"x":808.09,"y":218.4},{"x":808.83,"y":218.91},{"x":809.39,"y":218.95},{"x":810.53,"y":219.73},{"x":811.64,"y":221},{"x":811.65,"y":222.65},{"x":813.64,"y":224.71},{"x":815.18,"y":225.97},{"x":815.43,"y":225.97},{"x":816.14,"y":226.61},{"x":816.68,"y":226.79},{"x":817.06,"y":226.68},{"x":817.19,"y":226.82},{"x":817.85,"y":228.24},{"x":818.19,"y":228.64},{"x":818.6,"y":231.56},{"x":819.14,"y":232.38},{"x":819.1,"y":232.81},{"x":819.87,"y":233.97},{"x":820.77,"y":236.17},{"x":821.54,"y":236.39},{"x":823.92,"y":236.03},{"x":827.23,"y":236.16},{"x":827.53,"y":236.42},{"x":828.36,"y":238.42},{"x":829.89,"y":239.89},{"x":832.6,"y":241.26},{"x":834.54,"y":241.96},{"x":835.07,"y":241.88},{"x":835.18,"y":242.14},{"x":835.58,"y":242.13},{"x":836.17,"y":242.51},{"x":836.78,"y":242.66},{"x":837.53,"y":243.4},{"x":838.37,"y":243.88},{"x":838.43,"y":243.5},{"x":838.66,"y":243.57},{"x":839.04,"y":244.12},{"x":839.22,"y":244.92},{"x":841.21,"y":245.84},{"x":841.83,"y":246.04},{"x":842.04,"y":245.77},{"x":842.41,"y":245.75},{"x":843.26,"y":245.27},{"x":844.24,"y":245.57},{"x":845.03,"y":246.39},{"x":845.85,"y":246.6},{"x":847,"y":247.64},{"x":847.34,"y":247.73},{"x":847.41,"y":248.18},{"x":848.42,"y":248.13},{"x":849.7,"y":248.92},{"x":851,"y":248.94},{"x":851.44,"y":249.29},{"x":852.08,"y":250.28},{"x":852.61,"y":250.7},{"x":852.83,"y":251.42},{"x":854.06,"y":252.12},{"x":854.8,"y":252.81},{"x":856.59,"y":253.4},{"x":858.68,"y":254.64},{"x":859.5,"y":255.39},{"x":859.88,"y":255.49},{"x":860.33,"y":256.75},{"x":861.17,"y":257.75},{"x":861.43,"y":258.74},{"x":861.26,"y":259.2},{"x":861.57,"y":259.34},{"x":860.95,"y":260.82},{"x":862.67,"y":262.25},{"x":862.85,"y":262.88},{"x":863.1,"y":263.15},{"x":863.12,"y":263.53},{"x":864.01,"y":265},{"x":864.49,"y":267.98},{"x":864.76,"y":268.06},{"x":865.21,"y":268.53},{"x":865.02,"y":269.11},{"x":864.37,"y":268.85},{"x":864.15,"y":269.33},{"x":863.73,"y":269.69},{"x":863.78,"y":269.93},{"x":863.88,"y":269.85},{"x":864.53,"y":270.31},{"x":864.3,"y":270.94},{"x":864.43,"y":271.25},{"x":864.29,"y":271.5},{"x":863.59,"y":271.56},{"x":863.07,"y":272.03},{"x":863.14,"y":272.21},{"x":861.6,"y":273.31},{"x":861.47,"y":273.58},{"x":860.76,"y":273.83},{"x":860.64,"y":274.09},{"x":860.96,"y":274.52},{"x":860.93,"y":274.95},{"x":861.15,"y":275.41},{"x":861.42,"y":275.58},{"x":861.54,"y":276.09},{"x":861.18,"y":276.87},{"x":860.91,"y":276.89},{"x":861.03,"y":277.41},{"x":860.24,"y":277.5},{"x":859.28,"y":278.03},{"x":858.98,"y":278.5},{"x":858.91,"y":279.15},{"x":858.01,"y":279.83},{"x":857.95,"y":280.3},{"x":858.02,"y":280.95},{"x":858.56,"y":281.61},{"x":859.44,"y":281.91},{"x":859.85,"y":282.31},{"x":860.42,"y":282.4},{"x":860.41,"y":282.97},{"x":861.29,"y":283.62},{"x":861.73,"y":284.46},{"x":861.78,"y":285.25},{"x":861.6,"y":285.89},{"x":862.09,"y":286.16},{"x":862.38,"y":285.9},{"x":862.55,"y":285.95},{"x":862.9,"y":286.61},{"x":863.29,"y":288.07},{"x":863.36,"y":288.97},{"x":863.98,"y":289.4},{"x":863.94,"y":290.43},{"x":864.45,"y":290.42},{"x":864.57,"y":290.73},{"x":864.91,"y":290.59},{"x":865.21,"y":291.29},{"x":865.48,"y":291.45},{"x":865.32,"y":292.52},{"x":865.63,"y":293.4},{"x":866.1,"y":294.07},{"x":866.06,"y":294.62},{"x":866.32,"y":295.2},{"x":866.04,"y":296.21},{"x":865.82,"y":296.36},{"x":865.78,"y":297.21},{"x":866.12,"y":298.04},{"x":866.61,"y":298.23},{"x":866.81,"y":298.66},{"x":865.76,"y":299.92},{"x":865.06,"y":300.33},{"x":864.58,"y":301.43},{"x":864.79,"y":302},{"x":864.68,"y":302.71},{"x":865.32,"y":303.37},{"x":865.35,"y":303.62},{"x":865.46,"y":303.68},{"x":865.63,"y":303.49},{"x":866.81,"y":304.67},{"x":867.29,"y":304.96},{"x":867.33,"y":305.89},{"x":867.79,"y":306.17},{"x":866.43,"y":308.08},{"x":865.7,"y":308.15},{"x":864.81,"y":308.75},{"x":864.24,"y":308.72},{"x":863.18,"y":308.96},{"x":862.52,"y":309.54},{"x":861.87,"y":309.86},{"x":861.49,"y":310.42},{"x":861.54,"y":310.76},{"x":861.2,"y":311.37},{"x":860.66,"y":311.38},{"x":860.43,"y":311.04},{"x":859.87,"y":311.37},{"x":859.84,"y":311.72},{"x":859.7,"y":311.8},{"x":859.89,"y":312.99},{"x":859.71,"y":313.68},{"x":860.08,"y":314.35},{"x":859.84,"y":314.22},{"x":859.59,"y":314.42},{"x":859.41,"y":314.31},{"x":859.35,"y":314.56},{"x":859.05,"y":314.76},{"x":858.87,"y":314.68},{"x":858.29,"y":314.94},{"x":858.49,"y":315.35},{"x":858.19,"y":315.6},{"x":858.2,"y":316.09},{"x":857.97,"y":316.42},{"x":857.99,"y":317.18},{"x":857.71,"y":317.99},{"x":857.81,"y":318.45},{"x":857.63,"y":318.77},{"x":857.65,"y":319.12},{"x":857.32,"y":319.49},{"x":857.37,"y":320.92},{"x":857.23,"y":321.32},{"x":857.23,"y":322.66},{"x":857.44,"y":324.03},{"x":857.34,"y":326.69},{"x":858.08,"y":327.3},{"x":858.1,"y":327.6},{"x":857.59,"y":328.6},{"x":857.21,"y":328.98},{"x":856.81,"y":330.34},{"x":856.37,"y":330.51},{"x":855.98,"y":330.93},{"x":855.95,"y":331.89},{"x":855.36,"y":332.13},{"x":855.38,"y":332.51},{"x":855.06,"y":332.61},{"x":854.91,"y":333.44},{"x":855.21,"y":334.74},{"x":854.57,"y":335.21},{"x":854.54,"y":335.4},{"x":855.01,"y":336.06},{"x":855,"y":336.45},{"x":855.28,"y":336.79},{"x":855.8,"y":338.6},{"x":856.14,"y":338.6},{"x":856.23,"y":338.86},{"x":856.35,"y":338.63},{"x":856.71,"y":338.94},{"x":857.05,"y":338.89},{"x":857.23,"y":338.64},{"x":858.07,"y":338.79},{"x":858.2,"y":338.94},{"x":858.92,"y":338.57},{"x":859.11,"y":338.89},{"x":858.81,"y":339.55},{"x":858.92,"y":340.41},{"x":859.53,"y":340.69},{"x":859.84,"y":341.04},{"x":860.07,"y":341.37},{"x":860.06,"y":341.83},{"x":860.66,"y":342.03},{"x":860.92,"y":343},{"x":860.55,"y":343.73},{"x":859.97,"y":344.14},{"x":859.58,"y":344.7},{"x":858.97,"y":346.97},{"x":858.43,"y":347.23},{"x":857.95,"y":347.79},{"x":857.37,"y":348.06},{"x":857.06,"y":348.95},{"x":856.76,"y":349.12},{"x":856.84,"y":349.26},{"x":856.38,"y":349.83},{"x":856.43,"y":350.15},{"x":856.12,"y":350.24},{"x":856,"y":350.57},{"x":855.55,"y":350.42},{"x":855.29,"y":350.5},{"x":854.9,"y":351.05},{"x":854.52,"y":351.3},{"x":854.44,"y":351.92},{"x":854.11,"y":351.83},{"x":853.89,"y":352.24},{"x":853.66,"y":352.25},{"x":853.37,"y":352.65},{"x":852.5,"y":352.57},{"x":852.42,"y":353.03},{"x":852.19,"y":352.87},{"x":851.42,"y":352.96},{"x":851.41,"y":353.57},{"x":850.85,"y":354.08},{"x":850.76,"y":354.94},{"x":850.88,"y":355.32},{"x":850.21,"y":356.07},{"x":850.17,"y":356.49},{"x":850.62,"y":356.9},{"x":851.06,"y":357.75},{"x":850.59,"y":357.96},{"x":850.56,"y":358.47},{"x":849.95,"y":359.08},{"x":849.84,"y":359.59},{"x":850.11,"y":360.29},{"x":849.92,"y":360.43},{"x":850.33,"y":360.49},{"x":851.07,"y":361.18},{"x":852.05,"y":361.17},{"x":852.13,"y":361.59},{"x":852.71,"y":362.1},{"x":852.73,"y":362.8},{"x":853.19,"y":363},{"x":853.47,"y":363.67},{"x":853.87,"y":363.76},{"x":853.9,"y":364.28},{"x":854.42,"y":364.29},{"x":854.65,"y":365.14},{"x":854.56,"y":365.53},{"x":854.16,"y":366.23},{"x":854.24,"y":366.42},{"x":853.84,"y":366.47},{"x":852.39,"y":367.52},{"x":851.57,"y":368.38},{"x":850.93,"y":368.68},{"x":851.06,"y":369},{"x":850.93,"y":369.23},{"x":850.46,"y":369.51},{"x":849.74,"y":370.38},{"x":849.06,"y":370.71},{"x":848.5,"y":370.69},{"x":848.23,"y":370.49},{"x":847.4,"y":371.33},{"x":847.14,"y":371.16},{"x":846.94,"y":370.7},{"x":846.18,"y":371.02},{"x":845.71,"y":371.5},{"x":845.04,"y":371.11},{"x":844.09,"y":371.89},{"x":844.19,"y":372.58},{"x":844.02,"y":373.35},{"x":843.52,"y":373.95},{"x":843.27,"y":374.55},{"x":843.51,"y":376.21},{"x":843.82,"y":376.83},{"x":843.72,"y":377.01},{"x":843.96,"y":377.62},{"x":843.94,"y":378.01},{"x":844.01,"y":378.16},{"x":844.38,"y":378.03},{"x":844.52,"y":378.57},{"x":844.31,"y":378.85},{"x":844.75,"y":380.44},{"x":843.74,"y":382.15},{"x":843.46,"y":382.35},{"x":842.91,"y":382.37},{"x":841.52,"y":383.67},{"x":841.12,"y":385.66},{"x":840.87,"y":385.75},{"x":840.51,"y":386.39},{"x":840.63,"y":386.95},{"x":840.12,"y":388.01},{"x":839.9,"y":389.41},{"x":839.99,"y":389.78},{"x":839.57,"y":390.4},{"x":839.94,"y":390.99},{"x":839.86,"y":391.33},{"x":839.99,"y":391.65},{"x":839.87,"y":391.82},{"x":840.73,"y":392.78},{"x":841.69,"y":393.3},{"x":842.18,"y":394.49},{"x":842.93,"y":394.88},{"x":843.07,"y":395.1},{"x":843.39,"y":396.4},{"x":844.27,"y":397.32},{"x":844.69,"y":398.01},{"x":845.22,"y":398.44},{"x":845.22,"y":398.71},{"x":845.59,"y":399.05},{"x":845.73,"y":400.37},{"x":846.1,"y":401.41},{"x":847.39,"y":403.44},{"x":847.56,"y":405.01},{"x":847.98,"y":405.98},{"x":848.35,"y":406.33},{"x":848.4,"y":407.55},{"x":847.99,"y":407.71},{"x":847.46,"y":408.34},{"x":847.21,"y":409.09},{"x":847.21,"y":410.25},{"x":846.4,"y":410.25},{"x":845.98,"y":409.99},{"x":845.81,"y":409.69},{"x":844.62,"y":409.75},{"x":843.99,"y":410.77},{"x":843.92,"y":411.16},{"x":843.71,"y":411.3},{"x":843.95,"y":413.34},{"x":844.59,"y":413.95},{"x":844.31,"y":414.5},{"x":844.57,"y":415.53},{"x":844.47,"y":415.98},{"x":844.08,"y":416.54},{"x":844.46,"y":417.78},{"x":844.25,"y":418.04},{"x":844,"y":419.22},{"x":844.09,"y":419.88},{"x":843.69,"y":420.87},{"x":843.57,"y":421.64},{"x":843.09,"y":422.17},{"x":842.62,"y":423.24},{"x":842.18,"y":423.58},{"x":841.69,"y":424.45},{"x":841.31,"y":425.32},{"x":841.28,"y":426.07},{"x":840.43,"y":426.98},{"x":840.28,"y":427.27},{"x":840.35,"y":427.98},{"x":840.13,"y":428.36},{"x":839.85,"y":428.43},{"x":839.94,"y":429.62},{"x":839.66,"y":430.25},{"x":839.76,"y":430.97},{"x":839.51,"y":432.76},{"x":839.78,"y":433.31},{"x":840.19,"y":435.49},{"x":839.97,"y":436.57},{"x":840.18,"y":437.41},{"x":840.88,"y":438.25},{"x":841.33,"y":441.04},{"x":842.75,"y":442.31},{"x":843.89,"y":442.49},{"x":844.23,"y":442.69},{"x":844.56,"y":444.33},{"x":845.21,"y":445.61},{"x":845.11,"y":445.98},{"x":845.26,"y":446.13},{"x":845.25,"y":446.61},{"x":845.51,"y":446.83},{"x":845.92,"y":447.72},{"x":846.54,"y":448.23},{"x":846.22,"y":448.39},{"x":846.58,"y":449.03},{"x":846.85,"y":449.22},{"x":847.26,"y":449.12},{"x":847.62,"y":449.22},{"x":847.22,"y":451.51},{"x":847.37,"y":453.41},{"x":847.06,"y":454.37},{"x":847.52,"y":455.19},{"x":847.87,"y":456.51},{"x":847.8,"y":456.93},{"x":847.37,"y":457.36},{"x":847.16,"y":458.44},{"x":847.35,"y":458.58},{"x":847.82,"y":459.76},{"x":848.54,"y":460.28},{"x":848.79,"y":461.67},{"x":849.1,"y":461.82},{"x":850.01,"y":461.85},{"x":850.38,"y":462.26},{"x":850.7,"y":462.24},{"x":851.38,"y":462.79},{"x":851.35,"y":463.26},{"x":851.9,"y":464.12},{"x":851.99,"y":464.81},{"x":852.29,"y":465.31},{"x":852.39,"y":466.28},{"x":853.62,"y":468.27},{"x":853.52,"y":468.55},{"x":853.77,"y":469.76},{"x":853.68,"y":470.22},{"x":854,"y":470.91},{"x":853.97,"y":471.15},{"x":854.32,"y":471.15},{"x":854.55,"y":471.34},{"x":855.21,"y":473.19},{"x":856.05,"y":473.73},{"x":856.86,"y":474.89},{"x":857.4,"y":475.11},{"x":857.89,"y":475.79},{"x":859.65,"y":476.31},{"x":860.05,"y":476.74},{"x":860.69,"y":476.85},{"x":861.3,"y":477.2},{"x":861.65,"y":477.05},{"x":862.23,"y":477.64},{"x":862.5,"y":477.67},{"x":863.43,"y":478.32},{"x":863.96,"y":478.96},{"x":865.71,"y":480.02},{"x":865.75,"y":480.29},{"x":866.36,"y":480.77}] 2 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | var points = [ 2 | {x:224.55,y:250.15},{x:226.91,y:244.19},{x:233.31,y:241.45},{x:234.98,y:236.06}, 3 | {x:244.21,y:232.76},{x:262.59,y:215.31},{x:267.76,y:213.81},{x:273.57,y:201.84}, 4 | {x:273.12,y:192.16},{x:277.62,y:189.03},{x:280.36,y:181.41},{x:286.51,y:177.74}, 5 | {x:292.41,y:159.37},{x:296.91,y:155.64},{x:314.95,y:151.37},{x:319.75,y:145.16}, 6 | {x:330.33,y:137.57},{x:341.48,y:139.96},{x:369.98,y:137.89},{x:387.39,y:142.51}, 7 | {x:391.28,y:139.39},{x:409.52,y:141.14},{x:414.82,y:139.75},{x:427.72,y:127.30}, 8 | {x:439.60,y:119.74},{x:474.93,y:107.87},{x:486.51,y:106.75},{x:489.20,y:109.45}, 9 | {x:493.79,y:108.63},{x:504.74,y:119.66},{x:512.96,y:122.35},{x:518.63,y:120.89}, 10 | {x:524.09,y:126.88},{x:529.57,y:127.86},{x:534.21,y:140.93},{x:539.27,y:147.24}, 11 | {x:567.69,y:148.91},{x:575.25,y:157.26},{x:580.62,y:158.15},{x:601.53,y:156.85}, 12 | {x:617.74,y:159.86},{x:622.00,y:167.04},{x:629.55,y:194.60},{x:638.90,y:195.61}, 13 | {x:641.26,y:200.81},{x:651.77,y:204.56},{x:671.55,y:222.55},{x:683.68,y:217.45}, 14 | {x:695.25,y:219.15},{x:700.64,y:217.98},{x:703.12,y:214.36},{x:712.26,y:215.87}, 15 | {x:721.49,y:212.81},{x:727.81,y:213.36},{x:729.98,y:208.73},{x:735.32,y:208.20}, 16 | {x:739.94,y:204.77},{x:769.98,y:208.42},{x:779.60,y:216.87},{x:784.20,y:218.16}, 17 | {x:800.24,y:214.62},{x:810.53,y:219.73},{x:817.19,y:226.82},{x:820.77,y:236.17}, 18 | {x:827.23,y:236.16},{x:829.89,y:239.89},{x:851.00,y:248.94},{x:859.88,y:255.49}, 19 | {x:865.21,y:268.53},{x:857.95,y:280.30},{x:865.48,y:291.45},{x:866.81,y:298.66}, 20 | {x:864.68,y:302.71},{x:867.79,y:306.17},{x:859.87,y:311.37},{x:860.08,y:314.35}, 21 | {x:858.29,y:314.94},{x:858.10,y:327.60},{x:854.54,y:335.40},{x:860.92,y:343.00}, 22 | {x:856.43,y:350.15},{x:851.42,y:352.96},{x:849.84,y:359.59},{x:854.56,y:365.53}, 23 | {x:849.74,y:370.38},{x:844.09,y:371.89},{x:844.75,y:380.44},{x:841.52,y:383.67}, 24 | {x:839.57,y:390.40},{x:845.59,y:399.05},{x:848.40,y:407.55},{x:843.71,y:411.30}, 25 | {x:844.09,y:419.88},{x:839.51,y:432.76},{x:841.33,y:441.04},{x:847.62,y:449.22}, 26 | {x:847.16,y:458.44},{x:851.38,y:462.79},{x:853.97,y:471.15},{x:866.36,y:480.77} 27 | ]; 28 | 29 | var simplified = [ 30 | {x:224.55,y:250.15},{x:267.76,y:213.81},{x:296.91,y:155.64},{x:330.33,y:137.57}, 31 | {x:409.52,y:141.14},{x:439.60,y:119.74},{x:486.51,y:106.75},{x:529.57,y:127.86}, 32 | {x:539.27,y:147.24},{x:617.74,y:159.86},{x:629.55,y:194.60},{x:671.55,y:222.55}, 33 | {x:727.81,y:213.36},{x:739.94,y:204.77},{x:769.98,y:208.42},{x:779.60,y:216.87}, 34 | {x:800.24,y:214.62},{x:820.77,y:236.17},{x:859.88,y:255.49},{x:865.21,y:268.53}, 35 | {x:857.95,y:280.30},{x:867.79,y:306.17},{x:859.87,y:311.37},{x:854.54,y:335.40}, 36 | {x:860.92,y:343.00},{x:849.84,y:359.59},{x:854.56,y:365.53},{x:844.09,y:371.89}, 37 | {x:839.57,y:390.40},{x:848.40,y:407.55},{x:839.51,y:432.76},{x:853.97,y:471.15}, 38 | {x:866.36,y:480.77} 39 | ]; 40 | 41 | var simplify = require('../simplify'), 42 | t = require('tape'); 43 | 44 | t('simplifies points correctly with the given tolerance', function (t) { 45 | var result = simplify(points, 5); 46 | t.same(result, simplified); 47 | t.end(); 48 | }); 49 | 50 | t('just return the points if it has only one point', function(t){ 51 | var result = simplify([{x:1, y:2}]); 52 | t.same(result, [{x:1, y:2}]); 53 | t.end(); 54 | }); 55 | 56 | t('just return the points if it has no points', function(t){ 57 | var result = simplify([]); 58 | t.same(result, []); 59 | t.end(); 60 | }); 61 | --------------------------------------------------------------------------------