sigma
Version:
A JavaScript library dedicated to graph drawing.
36 lines (35 loc) • 1.4 kB
TypeScript
/**
* Sigma.js WebGL Renderer Edge Program
* =====================================
*
* Program rendering edges as thick lines but with a twist: the end of edge
* does not sit in the middle of target node but instead stays by some margin.
*
* This is useful when combined with arrows to draw directed edges.
* @module
*/
import { EdgeAttributes, NodeAttributes } from "../../../types";
import { AbstractEdgeProgram, RenderEdgeParams } from "./common/edge";
export default class EdgeClampedProgram extends AbstractEdgeProgram {
IndicesArray: Uint32ArrayConstructor | Uint16ArrayConstructor;
indicesArray: Uint32Array | Uint16Array;
indicesBuffer: WebGLBuffer;
indicesType: GLenum;
positionLocation: GLint;
colorLocation: GLint;
normalLocation: GLint;
thicknessLocation: GLint;
radiusLocation: GLint;
scaleLocation: WebGLUniformLocation;
matrixLocation: WebGLUniformLocation;
cameraRatioLocation: WebGLUniformLocation;
viewportRatioLocation: WebGLUniformLocation;
thicknessRatioLocation: WebGLUniformLocation;
canUse32BitsIndices: boolean;
constructor(gl: WebGLRenderingContext);
bind(): void;
process(sourceData: NodeAttributes, targetData: NodeAttributes, data: EdgeAttributes, hidden: boolean, offset: number): void;
computeIndices(): void;
bufferData(): void;
render(params: RenderEdgeParams): void;
}