Published
Edited
Sep 1, 2019
2 forks
Importers
2 stars
Insert cell
Insert cell
simplifyPath = (pathString) => {
const makerModel = makerjs.importer.fromSVGPathData(pathString);
makerjs.model.originate(makerModel);
makerjs.model.simplify(makerModel);
const svg = html`${makerjs.exporter.toSVG(makerModel)}`;
return svg.querySelector('path').getAttribute('d');
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
exampleOutput = simplifyPath(examplePathInput)
Insert cell
Insert cell
Insert cell
makerjs = require("https://bundle.run/makerjs@0.17.0")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more