Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat(app): introduce nodeWeightMultiplierSize graph setting

dextmorgna06da56c23f6
diff --git a/flowsint-app/src/components/sketches/graph/node-renderer.ts b/flowsint-app/src/components/sketches/graph/node-renderer.ts
index e7d7127f..ef73ce62 100644
--- a/flowsint-app/src/components/sketches/graph/node-renderer.ts
+++ b/flowsint-app/src/components/sketches/graph/node-renderer.ts
@@ -55,7 +55,8 @@ export const renderNode = ({
if (!inViewport) return
const sizeMultiplier = forceSettings.nodeSize.value / 100 + 0.2
- const neighborBonus = Math.min(node.neighbors.length / 5, 5)
+ const neighborBonus =
+ Math.min(node.neighbors.length / 5, 8) * forceSettings.nodeWeightMultiplierSize.value
const baseSize = (node.nodeSize + neighborBonus) * sizeMultiplier
const shouldRenderDetails = globalScale > CONSTANTS.ZOOM_NODE_DETAIL_THRESHOLD
@@ -142,9 +143,7 @@ export const renderNode = ({
if (showIcons && node.nodeType) {
// In outlined mode: white for dark theme, black for light theme
// In filled mode: always white
- const iconColor = isOutlined
- ? (theme === 'dark' ? '#FFFFFF' : '#000000')
- : '#FFFFFF'
+ const iconColor = isOutlined ? (theme === 'dark' ? '#FFFFFF' : '#000000') : '#FFFFFF'
const cachedImage = getCachedImage(node.nodeType, iconColor)
if (cachedImage && cachedImage.complete) {
try {
diff --git a/flowsint-app/src/stores/graph-settings-store.ts b/flowsint-app/src/stores/graph-settings-store.ts
index 62528c27..8ab617a9 100644
--- a/flowsint-app/src/stores/graph-settings-store.ts
+++ b/flowsint-app/src/stores/graph-settings-store.ts
@@ -40,6 +40,15 @@ const DEFAULT_SETTINGS = {
step: 0.1,
description: 'Defines the width of the link between two nodes.'
},
+ nodeWeightMultiplierSize: {
+ name: 'Node Weight Multiplier',
+ type: 'number',
+ value: 1.5,
+ min: 1.0,
+ max: 8.0,
+ step: 0.01,
+ description: 'Defines how a node size varies depending on the weight (number of relations).'
+ },
linkWidth: {
name: 'Link Width',
type: 'number',
@@ -121,7 +130,7 @@ const DEFAULT_SETTINGS = {
linkDirectionalArrowLength: {
name: 'Arrow Length',
type: 'number',
- value: 1,
+ value: 2,
min: 1,
max: 10,
step: 0.1,
@@ -374,7 +383,7 @@ type GraphGeneralSettingsStore = {
}
// Storage version - increment this whenever you make breaking changes to DEFAULT_SETTINGS
-const STORAGE_VERSION = 3
+const STORAGE_VERSION = 4
export const useGraphSettingsStore = create<GraphGeneralSettingsStore>()(
persist(