-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking - I have no idea what I have done
- Loading branch information
Showing
6 changed files
with
155 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
<a href="/">Home</a> | ||
<a href="/map">Map</a> | ||
</nav> | ||
<StatusText /> | ||
|
||
</section> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<script> | ||
import { WebglPlot, WebglPolar , ColorRGBA } from 'webgl-plot'; | ||
let bInitialised = false; | ||
export let anAngles_deg; | ||
export let strChartID; | ||
let Chart = undefined; | ||
let ChartLines = undefined; | ||
let WebGLPlot = undefined; | ||
let LineColor = undefined; | ||
function InitCanvas() { | ||
// Ensure HMTL is loaded in | ||
if (!document.getElementById(strChartID)) { | ||
return; | ||
} | ||
// Ensure we processed some data (therefore var set) | ||
if (!anAngles_deg.length) { | ||
return; | ||
} | ||
// Create the "class" wise context only once | ||
if (!WebGLPlot) { | ||
ChartLines = []; | ||
Chart = document.getElementById(strChartID); | ||
WebGLPlot = new WebglPlot(Chart); | ||
} | ||
bInitialised = true; | ||
} | ||
$: { | ||
if (!bInitialised) { | ||
InitCanvas(); | ||
} | ||
if (WebGLPlot && ChartLines) { | ||
WebGLPlot.removeDataLines() | ||
for (let i = 0; i < anAngles_deg.length; i++) { | ||
LineColor = new ColorRGBA(0, 0, 0, 1); | ||
let line = new WebglPolar(LineColor, 10); | ||
line.setRtheta(0, 0, 0); | ||
line.setRtheta(1, anAngles_deg[i], 10) | ||
WebGLPlot.addLine(line); | ||
} | ||
WebGLPlot.update(); | ||
} | ||
} | ||
</script> | ||
|
||
<canvas class="canvas" id={strChartID} bind:this={Chart} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters