Module: sigma/src/rendering
Classes
- AbstractEdgeProgram
- AbstractNodeProgram
- AbstractProgram
- EdgeLineProgram
- EdgeProgram
- EdgeRectangleProgram
- EdgeTriangleProgram
- NodeCircleProgram
- NodePointProgram
- NodeProgram
- Program
Interfaces
Type Aliases
CreateEdgeArrowHeadProgramOptions
Ƭ CreateEdgeArrowHeadProgramOptions: Object
Type declaration
Name | Type |
---|---|
lengthToThicknessRatio | number |
widenessToThicknessRatio | number |
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
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 EdgeProgramClass
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 NodeProgramClass
Type parameters
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Defined in
sigma/src/rendering/node.ts:83
ProgramType
Ƭ ProgramType<Uniform
, N
, E
, G
>: typeof ProgramClass
Type parameters
Name | Type |
---|---|
Uniform | extends string = string |
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends 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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
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
Name | Type |
---|---|
N | extends Attributes = Attributes |
E | extends Attributes = Attributes |
G | extends Attributes = Attributes |
Parameters
Name | Type |
---|---|
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
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 >) => 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
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 >) => 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
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
getAttributeItemsCount
▸ getAttributeItemsCount(attr
): number
Parameters
Name | Type |
---|---|
attr | ProgramAttributeSpecification |
Returns
number
Defined in
sigma/src/rendering/utils.ts:1
getAttributesItemsCount
▸ getAttributesItemsCount(attrs
): number
Parameters
Name | Type |
---|---|
attrs | ProgramAttributeSpecification [] |
Returns
number
Defined in
sigma/src/rendering/utils.ts:4
killProgram
▸ killProgram(«destructured»
): void
Parameters
Name | Type |
---|---|
«destructured» | ProgramInfo <string > |
Returns
void
Defined in
sigma/src/rendering/utils.ts:108
loadFragmentShader
▸ loadFragmentShader(gl
, source
): WebGLShader
Parameters
Name | Type |
---|---|
gl | WebGLRenderingContext |
source | string |
Returns
WebGLShader
Defined in
sigma/src/rendering/utils.ts:77
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:84
loadVertexShader
▸ loadVertexShader(gl
, source
): WebGLShader
Parameters
Name | Type |
---|---|
gl | WebGLRenderingContext |
source | string |
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
Name | Type |
---|---|
n | number |
Returns
string