0.1.3 • Published 4 years ago

@tomgp/line-simplification v0.1.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

What it is?

A simplified path generator for D3, more or less a drop in replacement for d3.line with the added ability to specify a tolerance.

Usage

Install and use via npm npm install --save @tomgp/simplify-line

const { simplifiedLine } = require('simplify-line');

const simple = simplePath()
	.tolerance(3)
	.x(function(d){ return dateScale(d.date); })
	.y(function(d){ return valueScale(d.value); })

Based on Simplify.js a tiny high-performance JavaScript polyline simplification library by Vladimir Agafonkin, extracted from Leaflet, a JS interactive maps library by the same author.

It uses a combination of Douglas-Peucker and Radial Distance algorithms.

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago