11import { WebglPlot } from "../src/webglplot" ;
2- import { WbglPolygonPlot , PolygonConfig } from "../src/WbglPolygonPlot " ;
3- import { WebglLinePlot , LineConfig } from "../src/WbglLinePlot " ; // Corrected import name
2+ import { WebglPolygonPlot , PolygonConfig } from "../src/WebglPolygonPlot " ;
3+ import { WebglLinePlot , LineConfig } from "../src/WebglLinePlot " ; // Corrected import name
44
55document . addEventListener ( "DOMContentLoaded" , ( ) => {
66 const canvas = document . getElementById ( "my_canvas" ) as HTMLCanvasElement ; // Updated ID
@@ -13,7 +13,7 @@ document.addEventListener("DOMContentLoaded", () => {
1313 const wglp = new WebglPlot ( canvas ) ;
1414
1515 // Initialize WbglPolygonPlot
16- const polygonPlot = new WbglPolygonPlot ( wglp ) ;
16+ const polygonPlot = new WebglPolygonPlot ( wglp ) ;
1717
1818 // Initialize WbglLinePlot
1919 const linePlot = new WebglLinePlot ( wglp , 2 ) ; // Corrected class name
@@ -23,7 +23,7 @@ document.addEventListener("DOMContentLoaded", () => {
2323
2424 // Triangle examples
2525 polygonConfigs . push (
26- WbglPolygonPlot . createTriangle ( {
26+ WebglPolygonPlot . createTriangle ( {
2727 center : [ - 0.8 , 0.7 ] ,
2828 radius : 0.1 ,
2929 fillColor : [ 1 , 0 , 0 , 0.5 ] , // Red, semi-transparent
@@ -35,7 +35,7 @@ document.addEventListener("DOMContentLoaded", () => {
3535 ) ;
3636
3737 polygonConfigs . push (
38- WbglPolygonPlot . createTriangle ( {
38+ WebglPolygonPlot . createTriangle ( {
3939 center : [ - 0.6 , 0.7 ] ,
4040 radius : 0.08 ,
4141 rotation : Math . PI / 4 , // 45 degrees
@@ -48,7 +48,7 @@ document.addEventListener("DOMContentLoaded", () => {
4848
4949 // Square examples
5050 polygonConfigs . push (
51- WbglPolygonPlot . createSquare ( {
51+ WebglPolygonPlot . createSquare ( {
5252 center : [ - 0.2 , 0.5 ] ,
5353 size : 0.2 ,
5454 fillColor : [ 0 , 1 , 0 , 0.6 ] , // Green
@@ -60,7 +60,7 @@ document.addEventListener("DOMContentLoaded", () => {
6060 ) ;
6161
6262 polygonConfigs . push (
63- WbglPolygonPlot . createSquare ( {
63+ WebglPolygonPlot . createSquare ( {
6464 center : [ 0.1 , 0.5 ] ,
6565 size : 0.15 ,
6666 rotation : Math . PI / 6 , // 30 degrees
@@ -74,19 +74,19 @@ document.addEventListener("DOMContentLoaded", () => {
7474
7575 // Circle examples
7676 polygonConfigs . push (
77- WbglPolygonPlot . createCircle ( {
77+ WebglPolygonPlot . createCircle ( {
7878 center : [ 0.5 , 0.6 ] ,
7979 radius : 0.1 ,
8080 fillColor : [ 1 , 0 , 1 , 0.7 ] , // Magenta
81- isFilled : true ,
81+ isFilled : false ,
8282 isStroked : true ,
83- strokeColor : [ 0.2 , 0.2 , 0.2 , 1 ] ,
84- strokeWeight : 1 ,
83+ strokeColor : [ 0.8 , 0.2 , 0.2 , 1 ] ,
84+ strokeWeight : 10 ,
8585 } )
8686 ) ;
8787
8888 polygonConfigs . push (
89- WbglPolygonPlot . createCircle ( {
89+ WebglPolygonPlot . createCircle ( {
9090 center : [ 0.8 , 0.6 ] ,
9191 radius : 0.07 ,
9292 segments : 8 , // Octagon
0 commit comments