mountain-generator
Version:
A package for generating svg mountains.
13 lines (12 loc) • 446 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(width, height, pointsArray) {
const staringPoint = pointsArray.shift();
let svgPath = `M ${staringPoint[0]} ${staringPoint[1]}`;
pointsArray.forEach((point) => {
svgPath += ` L ${point[0]} ${point[1]}`;
});
svgPath += ` L ${width} ${height} L 0 ${height} Z`;
return svgPath;
}
exports.default = default_1;