Files
Housekeeping-web-admin/node_modules/d3-shape/src/symbol/triangle.js
T
2026-06-24 09:48:54 +02:00

14 lines
273 B
JavaScript

import {sqrt} from "../math.js";
const sqrt3 = sqrt(3);
export default {
draw(context, size) {
const y = -sqrt(size / (sqrt3 * 3));
context.moveTo(0, y * 2);
context.lineTo(-sqrt3 * y, -y);
context.lineTo(sqrt3 * y, -y);
context.closePath();
}
};