83 lines
2.0 KiB
HTML
83 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Triangle and Inverted Triangle Spider Graphs</title>
|
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
<script src="./drawtriangle.js"></script>
|
|
<script src="./drawtriangleinverted.js"></script>
|
|
<style>
|
|
body {
|
|
font-family: sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
background-color: white;
|
|
}
|
|
|
|
svg {
|
|
background: white;
|
|
display: block;
|
|
margin: auto;
|
|
}
|
|
|
|
.axis line {
|
|
stroke: black;
|
|
stroke-width: 1.5px;
|
|
}
|
|
|
|
line.tick {
|
|
stroke: black;
|
|
stroke-width: 1;
|
|
}
|
|
|
|
polygon.grid {
|
|
fill: none;
|
|
stroke: rgba(200, 200, 200, 0.5); /* light grey with 50% opacity */
|
|
stroke-dasharray: 2,2;
|
|
}
|
|
|
|
.area {
|
|
fill: rgba(70, 130, 180, 0.3); /* steelblue with transparency */
|
|
stroke: rgba(70, 130, 180, 0.6);
|
|
stroke-width: 2;
|
|
}
|
|
|
|
.label {
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
text-anchor: middle;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body onload="drawtriangles()">
|
|
<h1>Single Triangle</h1>
|
|
<svg id="svg1" width="600" height="600"></svg>
|
|
<h1>Pyramid</h1>
|
|
<svg id="svg2" width="1000" height="1000"></svg>
|
|
|
|
<script>
|
|
|
|
function drawtriangles() {
|
|
//doLittleWhiteTriangle('svg1');
|
|
//drawtriangle(<svg ID>,<text>,<colour>,[<val1>,<val2>,<val3>],RAGGED(<average>), { x: <x offset>, y: <y offset>},<number>;
|
|
//
|
|
drawtriangle('#svg1','Roles','#008845',[0.9,0.9,0.9],0.1, { x: 0, y: 100 },1.3);
|
|
|
|
//Can also be used to draw a 4 triangle pyramid:
|
|
//doBigWhiteTriangle('svg_pyramid');
|
|
drawtriangle('#svg2','Roles','#008845',[0.1,0.3,0.8],'', { x: 0, y: 350 },0.5);
|
|
drawtriangle('#svg2','Actions','#b2c8c4',[0.1,0.3,0.8],'',{ x: 370, y: 350 },0.4);
|
|
drawtriangle('#svg2','Approach','#ed4c0c',[0.1,0.3,0.8],'',{ x: 185, y: 30 },0.3);
|
|
drawtriangleinverted('#svg2','Results','#74469c',[0.1,0.3,0.8],'',{ x: 185, y: 243},0.2);
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|