How can I apply simplify.js in this code?

  contour, d3.js, javascript, observablehq, simplify

https://observablehq.com/@heydahyun/imagetracer-tracedata/3

On this notebook (Observablehq) I extracted contour lines (d3) from the posterized image.
And now I want to simplify the lines with limited(specific) number of the points on the polygon.

How can I apply the simplify.js like the reference links below?

https://mourner.github.io/simplify-js/

https://observablehq.com/@pierreleripoll/hello-simplify-js

Source: Ask Javascript Questions

LEAVE A COMMENT