Skip to content

Commit 557c7ff

Browse files
committed
fix (KnowledgeGraph.js): make page node font size configurable
- Replaced hardcoded font size for page nodes with configurable `size` from KnowledgeGraphOptions
1 parent 0e0c3f5 commit 557c7ff

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

resources/KnowledgeGraph.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ KnowledgeGraph = function () {
227227
? cleanLabel
228228
: cleanLabel.substring(0, maxPropValueLength) + '…',
229229
shape: 'box',
230-
font: { size: 30 },
230+
font: jQuery.extend(
231+
{},
232+
Config.graphOptions.nodes.font,
233+
{ size: Config.graphOptions.nodes.font.size || 30 }
234+
),
231235
typeID: typeID || 9,
232236

233237
// https://visjs.github.io/vis-network/examples/network/other/popups.html
@@ -1147,7 +1151,11 @@ ${propertyOptions}|show-property-type=true
11471151
};
11481152
if (typeID === 9) {
11491153
nodeConfig.shape = 'box';
1150-
nodeConfig.font = { size: 30 };
1154+
nodeConfig.font = jQuery.extend(
1155+
{},
1156+
Config.graphOptions.nodes.font,
1157+
{ size: Config.graphOptions.nodes.font.size || 30 }
1158+
);
11511159

11521160
if (!Data[nodeId]) {
11531161
let dataKey = nodeId.split('_')[0];

0 commit comments

Comments
 (0)