Skip to main content

Module: sigma/src/rendering

Classes

Interfaces

Type Aliases

CreateEdgeArrowHeadProgramOptions

Ƭ CreateEdgeArrowHeadProgramOptions: Object

Type declaration

NameType
lengthToThicknessRationumber
widenessToThicknessRationumber

Defined in

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


CreateEdgeClampedProgramOptions

Ƭ CreateEdgeClampedProgramOptions: Pick<CreateEdgeArrowHeadProgramOptions, "lengthToThicknessRatio">

Defined in

sigma/src/rendering/programs/edge-clamped/index.ts:24


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 EdgeProgramClass

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 NodeProgramClass

Type parameters

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

Defined in

sigma/src/rendering/node.ts:83


ProgramType

Ƭ ProgramType<Uniform, N, E, G>: typeof ProgramClass

Type parameters

NameType
Uniformextends string = string
Nextends Attributes = Attributes
Eextends Attributes = Attributes
Gextends Attributes = Attributes

Defined in

sigma/src/rendering/program.ts:385

Variables

DEFAULT_EDGE_ARROW_HEAD_PROGRAM_OPTIONS

Const DEFAULT_EDGE_ARROW_HEAD_PROGRAM_OPTIONS: CreateEdgeArrowHeadProgramOptions

Defined in

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


DEFAULT_EDGE_CLAMPED_PROGRAM_OPTIONS

Const DEFAULT_EDGE_CLAMPED_PROGRAM_OPTIONS: CreateEdgeClampedProgramOptions

Defined in

sigma/src/rendering/programs/edge-clamped/index.ts:26


EdgeArrowProgram

Const EdgeArrowProgram: EdgeProgramType<Attributes, Attributes, Attributes>

Defined in

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

Functions

createEdgeArrowHeadProgram

createEdgeArrowHeadProgram<N, E, G>(inputOptions?): EdgeProgramType<N, E, G>

Type parameters

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

Parameters

NameType
inputOptions?Partial<CreateEdgeArrowHeadProgramOptions>

Returns

EdgeProgramType<N, E, G>

Defined in

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


createEdgeArrowProgram

createEdgeArrowProgram<N, E, G>(inputOptions?): EdgeProgramType<N, E, G>

Type parameters

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

Parameters

NameType
inputOptions?Partial<CreateEdgeArrowHeadProgramOptions>

Returns

EdgeProgramType<N, E, G>

Defined in

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


createEdgeClampedProgram

createEdgeClampedProgram<N, E, G>(inputOptions?): EdgeProgramType<N, E, G>

Type parameters

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

Parameters

NameType
inputOptions?Partial<CreateEdgeClampedProgramOptions>

Returns

EdgeProgramType<N, E, G>

Defined in

sigma/src/rendering/programs/edge-clamped/index.ts:30


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>) => EdgeProgramClass<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>) => NodeProgramClass<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


getAttributeItemsCount

getAttributeItemsCount(attr): number

Parameters

NameType
attrProgramAttributeSpecification

Returns

number

Defined in

sigma/src/rendering/utils.ts:1


getAttributesItemsCount

getAttributesItemsCount(attrs): number

Parameters

NameType
attrsProgramAttributeSpecification[]

Returns

number

Defined in

sigma/src/rendering/utils.ts:4


killProgram

killProgram(«destructured»): void

Parameters

NameType
«destructured»ProgramInfo<string>

Returns

void

Defined in

sigma/src/rendering/utils.ts:108


loadFragmentShader

loadFragmentShader(gl, source): WebGLShader

Parameters

NameType
glWebGLRenderingContext
sourcestring

Returns

WebGLShader

Defined in

sigma/src/rendering/utils.ts:77


loadProgram

loadProgram(gl, shaders): WebGLProgram

Function used to load a program.

Parameters

NameType
glWebGLRenderingContext
shadersWebGLShader[]

Returns

WebGLProgram

Defined in

sigma/src/rendering/utils.ts:84


loadVertexShader

loadVertexShader(gl, source): WebGLShader

Parameters

NameType
glWebGLRenderingContext
sourcestring

Returns

WebGLShader

Defined in

sigma/src/rendering/utils.ts:74


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:118