Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
major bug fix for single page applications
  • Loading branch information
danchitnis committed Sep 6, 2020
1 parent b4d76b7 commit b445ae1
Show file tree
Hide file tree
Showing 19 changed files with 556 additions and 309 deletions.
4 changes: 2 additions & 2 deletions benchmark/bench1.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ canvas.height = canvas.clientHeight * devicePixelRatio;

const numX = canvas.width;

const wglp = new WebGLplot(canvas);
const wglp = new WebGLplot(canvas, { powerPerformance: "high-performance" });

const createLines = (num) => {
wglp.lines = [];
wglp.removeAllLines();
for (let i = 0; i < num; i++) {
const color = new ColorRGBA(Math.random(), Math.random(), Math.random(), 1);
const line = new WebglLine(color, numX);
Expand Down
2 changes: 1 addition & 1 deletion dist/WbglPolar.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/WbglPolar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/WbglPolar.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions dist/WebglBaseLine.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { ColorRGBA } from "./ColorRGBA";
* Baseline class
*/
export declare class WebglBaseLine {
private static readonly vertCode;
private static readonly fragCode;
private static program;
intensity: number;
visible: boolean;
/**
Expand Down Expand Up @@ -60,14 +57,11 @@ export declare class WebglBaseLine {
* @private
* @internal
*/
_prog: WebGLProgram;
/**
* @private
* @internal
*/
_coord: number;
initProgram(webgl: WebGLRenderingContext): void;
private createProgram;
/**
* @internal
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/WebglBaseLine.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions dist/WebglBaseLine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/WebglBaseLine.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions dist/webglplot.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Author Danial Chitnis 2019
* Author Danial Chitnis 2019-20
*
* inspired by:
* https://codepen.io/AzazelN28
Expand All @@ -11,14 +11,22 @@ import { WebglStep } from "./WbglStep";
import { WebglPolar } from "./WbglPolar";
import { WebglBaseLine } from "./WebglBaseLine";
export { WebglLine, ColorRGBA, WebglStep, WebglPolar };
declare type WebGLPlotConfig = {
antialias?: boolean;
transparent?: boolean;
powerPerformance?: "default" | "high-performance" | "low-power";
deSync?: boolean;
preserveDrawing?: boolean;
debug?: boolean;
};
/**
* The main class for the webgl-plot library
*/
export default class WebGLPlot {
/**
* @private
*/
private webgl;
private readonly webgl;
/**
* Global horizontal scale factor
* @default = 1.0
Expand Down Expand Up @@ -47,7 +55,8 @@ export default class WebGLPlot {
/**
* collection of lines in the plot
*/
lines: WebglBaseLine[];
private _lines;
private progThinLine;
/**
* log debug output
*/
Expand Down Expand Up @@ -90,7 +99,8 @@ export default class WebGLPlot {
* }
* ```
*/
constructor(canvas: HTMLCanvasElement | OffscreenCanvas, debug?: boolean);
constructor(canvas: HTMLCanvasElement | OffscreenCanvas, options?: WebGLPlotConfig);
get lines(): WebglBaseLine[];
/**
* updates and redraws the content of the plot
*/
Expand All @@ -106,11 +116,16 @@ export default class WebGLPlot {
* wglp.addLine(line);
* ```
*/
addLine(line: WebglBaseLine): void;
addLine(line: WebglLine | WebglStep | WebglPolar): void;
private initThinLineProgram;
/**
* remove the last line
*/
popLine(): void;
/**
* remove all the lines
*/
removeAllLines(): void;
/**
* Change the WbGL viewport
* @param a
Expand Down
2 changes: 1 addition & 1 deletion dist/webglplot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b445ae1

Please sign in to comment.