Added MIT licence header to the draw triangle js code

This commit is contained in:
2025-05-29 23:21:58 +01:00
parent 6de4c2c282
commit 02cdde08c2
3 changed files with 81 additions and 7 deletions

View File

@@ -2,9 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>3-Axis Radar Chart with Ticks</title>
<title>Triangle and Inverted Triangle Spider Graphs</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="./draw3axis.js"></script>
<script src="./drawtriangle.js"></script>
<script src="./drawtriangleinverted.js"></script>
<style>
body {
font-family: sans-serif;
@@ -48,13 +49,32 @@
}
</style>
</head>
<body onload="drawGraph()">
<h1>Features</h1>
<svg id="Q1" width="400" height="400"></svg>
<h1>Concepts</h1>
<svg id="Q2" width="400" height="400"></svg>
<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>