Module: sigma/src/rendering
Classes
- AbstractEdgeProgram
- AbstractNodeProgram
- AbstractProgram
- EdgeArrowHeadProgram
- EdgeClampedProgram
- EdgeLineProgram
- EdgeProgram
- EdgeRectangleProgram
- EdgeTriangleProgram
- NodeCircleProgram
- NodePointProgram
- NodeProgram
- Program
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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Type declaration
▸ (context
, edgeData
, sourceData
, targetData
, settings
): void
Parameters
Name | Type |
---|---|
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 > |
Returns
void
Defined in
sigma/src/rendering/edge-labels.ts:6
EdgeProgramType
Ƭ EdgeProgramType<N
, E
, G
>: typeof EdgeImageClass
Type parameters
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends 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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Type declaration
▸ (context
, data
, settings
): void
Parameters
Name | Type |
---|---|
context | CanvasRenderingContext2D |
data | PartialButFor <NodeDisplayData , "x" | "y" | "size" | "label" | "color" > |
settings | Settings <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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Type declaration
▸ (context
, data
, settings
): void
Parameters
Name | Type |
---|---|
context | CanvasRenderingContext2D |
data | PartialButFor <NodeDisplayData , "x" | "y" | "size" | "label" | "color" > |
settings | Settings <N , E , G > |
Returns
void
Defined in
sigma/src/rendering/node-labels.ts:6
NodeProgramType
Ƭ NodeProgramType<N
, E
, G
>: typeof NodeImageClass
Type parameters
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends 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
Name | Type |
---|---|
_gl | WebGLRenderingContext |
_pickingBuffer | null | WebGLFramebuffer |
_renderer | Sigma <Attributes , Attributes , Attributes > |
Returns
EdgeImageClass
<Attributes
, Attributes
, Attributes
>
Type declaration
Name | Type |
---|---|
prototype | EdgeImageClass <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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type | Description |
---|---|---|
programClasses | NonEmptyArray <(_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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
context | CanvasRenderingContext2D |
data | PartialButFor <NodeDisplayData , "x" | "y" | "label" | "color" | "size" > |
settings | Settings <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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
context | CanvasRenderingContext2D |
data | PartialButFor <NodeDisplayData , "x" | "y" | "label" | "color" | "size" > |
settings | Settings <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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
context | CanvasRenderingContext2D |
edgeData | PartialButFor <DisplayData , "label" | "color" | "size" > |
sourceData | PartialButFor <NodeDisplayData , "x" | "y" | "size" > |
targetData | PartialButFor <NodeDisplayData , "x" | "y" | "size" > |
settings | Settings <N , E , G > |
Returns
void
Defined in
sigma/src/rendering/edge-labels.ts:18
loadFragmentShader
▸ loadFragmentShader(gl
, source
): WebGLShader
Parameters
Name | Type |
---|---|
gl | WebGLRenderingContext |
source | string |
Returns
WebGLShader
Defined in
sigma/src/rendering/utils.ts:44
loadProgram
▸ loadProgram(gl
, shaders
): WebGLProgram
Function used to load a program.
Parameters
Name | Type |
---|---|
gl | WebGLRenderingContext |
shaders | WebGLShader [] |
Returns
WebGLProgram
Defined in
sigma/src/rendering/utils.ts:51
loadVertexShader
▸ loadVertexShader(gl
, source
): WebGLShader
Parameters
Name | Type |
---|---|
gl | WebGLRenderingContext |
source | string |
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
Name | Type |
---|---|
n | number |
Returns
string