ForceDirected
Name: Force Directed
Description: Force-directed relationship graph drawn with d3-force
params$
Type:
DeepPartial<ForceDirectedParams>Fields:
Name Description Type dot Dot settings ObjectdotLabel Dot label settings Objectarrow Arrow settings ObjectarrowLabel Arrow label settings Objectforce d3-force settings Objectzoomable Zoom In/Out/Drag (mouse operation) booleantransform Transform settings ObjectscaleExtent Zoom In/Out min/max values Objectparams.dotName Description Type radius Radius numberfillColorType Background color type ColorTypestrokeColorType Border color type ColorTypestrokeWidth Border width numberstyleFn Node style function (node: ComputedNode) => stringparams.dotLabelName Description Type colorType Color type ColorTypesizeFixed Whether the size is fixed (not affected by Zoom In/Out) booleanstyleFn Node label style function (node: ComputedNode) => stringparams.arrowName Description Type colorType Radius ColorTypestrokeWidth Border width numberpointerWidth Arrow width numberpointerHeight Arrow height numberstyleFn Arrow style function (node: ComputedEdge) => stringparams.arrowLabelName Description Type colorType Radius ColorTypesizeFixed Whether the size is fixed (not affected by Zoom In/Out) booleanstyleFn Edge label style function (node: ComputedEdge) => stringparams.forceName Description Type nodeStrength Node strength numberlinkDistance Link distance numbervelocityDecay Velocity decay numberalphaDecay Alpha decay numberparams.transformName Description Type x x offset numbery y offset numberk Scale factor numberparams.scaleExtentName Description Type min Minimum zoom value, if 0can zoom out infinitelynumbermax Maximum zoom value, if Infinitycan zoom in infinitelynumber
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
interface ComputedNode {
id: string
index: number
label: string
visible: boolean
data: any
value: number | null
color: string
categoryIndex: number
categoryLabel: string
}
interface ComputedEdge {
id: string
index: number
label: string
visible: boolean
data: any
value: number | null
color: string
categoryIndex: number
categoryLabel: string
startNode: ComputedNode
endNode: ComputedNode
}
- Default values:
{
dot: {
radius: 10,
fillColorType: 'label',
strokeColorType: 'label',
strokeWidth: 1,
styleFn: (node) => '',
},
dotLabel: {
colorType: 'primary',
sizeFixed: false,
styleFn: (node) => 'text-shadow:0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff'
},
arrow: {
colorType: 'primary',
strokeWidth: 1.5,
pointerWidth: 5,
pointerHeight: 5,
styleFn: (edge) => '',
},
arrowLabel: {
colorType: 'primary',
sizeFixed: false,
styleFn: (edge) => ''
},
force: {
nodeStrength: -500,
linkDistance: 100,
velocityDecay: 0.1,
alphaDecay: 0.05
},
zoomable: true,
transform: {
x: 0,
y: 0,
k: 1
},
scaleExtent: {
min: 0,
max: Infinity
}
}