Skip to main content

Module: sigma/src/rendering

Classes

Interfaces

Type Aliases

EdgeLabelDrawingFunction

Ƭ EdgeLabelDrawingFunction<N, E, G>: (context: CanvasRenderingContext2D, edgeData: PartialButFor<EdgeDisplayData, "label" | "color" | "size">, sourceData: PartialButFor<NodeDisplayData, "x" | "y" | "size">, targetData: PartialButFor<NodeDisplayData, "x" | "y" | "size">, settings: Settings<N, E, G>) => void

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Type declaration

▸ (context, edgeData, sourceData, targetData, settings): void

Parameters
NameType
contextCanvasRenderingContext2D
edgeDataPartialButFor<EdgeDisplayData, "label" | "color" | "size">
sourceDataPartialButFor<NodeDisplayData, "x" | "y" | "size">
targetDataPartialButFor<NodeDisplayData, "x" | "y" | "size">
settingsSettings<N, E, G>
Returns

void

Defined in

sigma/src/rendering/edge-labels.ts:6


EdgeProgramType

Ƭ EdgeProgramType<N, E, G>: typeof EdgeImageClass

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Defined in

sigma/src/rendering/edge.ts:105


NodeHoverDrawingFunction

Ƭ NodeHoverDrawingFunction<N, E, G>: (context: CanvasRenderingContext2D, data: PartialButFor<NodeDisplayData, "x" | "y" | "size" | "label" | "color">, settings: Settings<N, E, G>) => void

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Type declaration

▸ (context, data, settings): void

Parameters
NameType
contextCanvasRenderingContext2D
dataPartialButFor<NodeDisplayData, "x" | "y" | "size" | "label" | "color">
settingsSettings<N, E, G>
Returns

void

Defined in

sigma/src/rendering/node-hover.ts:7


NodeLabelDrawingFunction

Ƭ NodeLabelDrawingFunction<N, E, G>: (context: CanvasRenderingContext2D, data: PartialButFor<NodeDisplayData, "x" | "y" | "size" | "label" | "color">, settings: Settings<N, E, G>) => void

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Type declaration

▸ (context, data, settings): void

Parameters
NameType
contextCanvasRenderingContext2D
dataPartialButFor<NodeDisplayData, "x" | "y" | "size" | "label" | "color">
settingsSettings<N, E, G>
Returns

void

Defined in

sigma/src/rendering/node-labels.ts:6


NodeProgramType

Ƭ NodeProgramType<N, E, G>: typeof NodeImageClass

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Defined in

sigma/src/rendering/node.ts:83

Variables

EdgeArrowProgram

Const EdgeArrowProgram: Object

Call signature

new EdgeArrowProgram(_gl, _pickingBuffer, _renderer): EdgeImageClass<Attributes, Attributes, Attributes>

Parameters
NameType
_glWebGLRenderingContext
_pickingBuffernull | WebGLFramebuffer
_rendererSigma<Attributes, Attributes, Attributes>
Returns

EdgeImageClass<Attributes, Attributes, Attributes>

Type declaration

NameType
prototypeEdgeImageClass<any, any, any>

Defined in

sigma/src/rendering/programs/edge-arrow/index.ts:12

Functions

createEdgeCompoundProgram

createEdgeCompoundProgram<N, E, G>(programClasses, drawLabel?): EdgeProgramType<N, E, G>

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.

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Parameters

NameTypeDescription
programClasses(_gl: WebGLRenderingContext, _pickingBuffer: null | WebGLFramebuffer, _renderer: Sigma<N, E, G>) => EdgeImageClass<N, E, G>[]Program classes to combine.
drawLabel?EdgeLabelDrawingFunction<N, E, G>An optional edge "draw label" function.

Returns

EdgeProgramType<N, E, G>

Defined in

sigma/src/rendering/edge.ts:120


createNodeCompoundProgram

createNodeCompoundProgram<N, E, G>(programClasses, drawLabel?, drawHover?): NodeProgramType<N, E, G>

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.

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Parameters

NameTypeDescription
programClassesNonEmptyArray<(_gl: WebGLRenderingContext, _pickingBuffer: null | WebGLFramebuffer, _renderer: Sigma<N, E, G>) => NodeImageClass<N, E, G>>Program classes to combine.
drawLabel?NodeLabelDrawingFunction<N, E, G>An optional node "draw label" function.
drawHover?NodeLabelDrawingFunction<N, E, G>An optional node "draw hover" function.

Returns

NodeProgramType<N, E, G>

Defined in

sigma/src/rendering/node.ts:99


drawDiscNodeHover

drawDiscNodeHover<N, E, G>(context, data, settings): void

Draw an hovered node.

  • if there is no label => display a shadow on the node
  • if the label box is bigger than node size => display a label box that contains the node with a shadow
  • else node with shadow and the label box

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Parameters

NameType
contextCanvasRenderingContext2D
dataPartialButFor<NodeDisplayData, "x" | "y" | "label" | "color" | "size">
settingsSettings<N, E, G>

Returns

void

Defined in

sigma/src/rendering/node-hover.ts:23


drawDiscNodeLabel

drawDiscNodeLabel<N, E, G>(context, data, settings): void

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Parameters

NameType
contextCanvasRenderingContext2D
dataPartialButFor<NodeDisplayData, "x" | "y" | "label" | "color" | "size">
settingsSettings<N, E, G>

Returns

void

Defined in

sigma/src/rendering/node-labels.ts:16


drawStraightEdgeLabel

drawStraightEdgeLabel<N, E, G>(context, edgeData, sourceData, targetData, settings): void

Type parameters

NameType
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Parameters

NameType
contextCanvasRenderingContext2D
edgeDataPartialButFor<DisplayData, "label" | "color" | "size">
sourceDataPartialButFor<NodeDisplayData, "x" | "y" | "size">
targetDataPartialButFor<NodeDisplayData, "x" | "y" | "size">
settingsSettings<N, E, G>

Returns

void

Defined in

sigma/src/rendering/edge-labels.ts:18


loadFragmentShader

loadFragmentShader(gl, source): WebGLShader

Parameters

NameType
glWebGLRenderingContext
sourcestring

Returns

WebGLShader

Defined in

sigma/src/rendering/utils.ts:44


loadProgram

loadProgram(gl, shaders): WebGLProgram

Function used to load a program.

Parameters

NameType
glWebGLRenderingContext
shadersWebGLShader[]

Returns

WebGLProgram

Defined in

sigma/src/rendering/utils.ts:51


loadVertexShader

loadVertexShader(gl, source): WebGLShader

Parameters

NameType
glWebGLRenderingContext
sourcestring

Returns

WebGLShader

Defined in

sigma/src/rendering/utils.ts:41


numberToGLSLFloat

numberToGLSLFloat(n): string

Function use to print a float for inserting in a GLSL program.

Parameters

NameType
nnumber

Returns

string

Defined in

sigma/src/rendering/utils.ts:78