source: node_modules/victory-vendor/lib-vendor/d3-shape/src/symbol/diamond.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 474 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7var _math = require("../math.js");
8const tan30 = (0, _math.sqrt)(1 / 3);
9const tan30_2 = tan30 * 2;
10var _default = exports.default = {
11 draw(context, size) {
12 const y = (0, _math.sqrt)(size / tan30_2);
13 const x = y * tan30;
14 context.moveTo(0, -y);
15 context.lineTo(x, 0);
16 context.lineTo(0, y);
17 context.lineTo(-x, 0);
18 context.closePath();
19 }
20};
Note: See TracBrowser for help on using the repository browser.