alecmce-primitivesjs
Version:
A small library for visualizing the prime factor decomposition of numbers.
22 lines (21 loc) • 851 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var svg_1 = require("./svg");
function makeCircle(lineWidth) {
return function draw(_a) {
var container = _a.container, x = _a.x, y = _a.y, radius = _a.radius, color = _a.color, stroke = _a.stroke;
var translate = "translate(" + (x || 0) + "," + (y || 0) + ")";
var group = new svg_1.Svg('g')
.appendTo(container.element)
.setAttribute('transform', translate);
var circle = new svg_1.Svg('circle')
.appendTo(group.element)
.setAttribute('r', this.radius)
.setAttribute('fill', color);
stroke && circle
.setAttribute('stroke', 'black')
.setAttribute('stroke-width', "" + lineWidth);
return group;
};
}
exports.makeCircle = makeCircle;