UNPKG
@nepwork/dashboards
Version:
latest (0.0.2)
0.0.2
Dashboards for emergencies and monitoring
github.com/nepwork/admin-ui
nepwork/admin-ui
@nepwork/dashboards
/
hgraph
/
node_modules
/
d3-shape
/
src
/
symbol
/
diamond.js
15 lines
(13 loc)
•
307 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var
tan30 =
Math
.
sqrt
(
1
/
3
), tan30_2 = tan30 *
2
;
export
default
{
draw
:
function
(
context, size
) {
var
y =
Math
.
sqrt
(size / tan30_2), x = y * tan30; context.
moveTo
(
0
, -y); context.
lineTo
(x,
0
); context.
lineTo
(
0
, y); context.
lineTo
(-x,
0
); context.
closePath
(); } };