Added MIT licence header to the draw triangle js code

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

View File

@ -1,3 +1,30 @@
/* This code is copywrite Telos Digital 2025 working for Telos Partners:
https://www.telospartners.com/
It is released under the MIT licence https://opensource.org/license/mit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function drawtriangle(id,text,colour,values,rag,offset,mean)
{

View File

@ -1,3 +1,30 @@
/* This code is copywrite Telos Digital 2025 working for Telos Partners:
https://www.telospartners.com/
It is released under the MIT licence https://opensource.org/license/mit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function drawtriangleinverted(id,text,colour,values,rag,offset,mean)
{

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>