sigma
Version:
A JavaScript library dedicated to graph drawing.
44 lines (43 loc) • 1.62 kB
TypeScript
/**
* Sigma.js WebGL Abstract Node Program
* =====================================
*
* @module
*/
import { AbstractProgram, IProgram, RenderParams } from "./program";
import { NodeAttributes } from "../../../../types";
export interface RenderNodeParams extends RenderParams {
nodesPowRatio: number;
}
export interface INodeProgram extends IProgram {
process(data: NodeAttributes, hidden: boolean, offset: number): void;
render(params: RenderNodeParams): void;
}
/**
* Node Program class.
*
* @constructor
*/
export declare abstract class AbstractNodeProgram extends AbstractProgram implements INodeProgram {
positionLocation: GLint;
sizeLocation: GLint;
colorLocation: GLint;
matrixLocation: WebGLUniformLocation;
ratioLocation: WebGLUniformLocation;
scaleLocation: WebGLUniformLocation;
constructor(gl: WebGLRenderingContext, vertexShaderSource: string, fragmentShaderSource: string, points: number, attributes: number);
bind(): void;
abstract process(data: NodeAttributes, hidden: boolean, offset: number): void;
}
export interface NodeProgramConstructor {
new (gl: WebGLRenderingContext): INodeProgram;
}
/**
* Helper function combining two or more programs into a single compound one.
* Note that this is more a quick & easy way to combine program than a really
* performant option. More performant programs can be written entirely.
*
* @param {array} programClasses - Program classes to combine.
* @return {function}
*/
export declare function createNodeCompoundProgram(programClasses: Array<NodeProgramConstructor>): NodeProgramConstructor;