Skip to content

Commit

Permalink
slightly changed font-size treatment of dagre and sankey graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Feb 10, 2022
1 parent 6b6fda1 commit 30d7dbf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions daliuge-translator/dlg/dropmake/web/graph_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function graphInit(type) {
var nodeCatgShape = { 'Data': 'path://M 300 100 L 1000 100 L 800 200 L 100 200 z', 'Component': 'rect' }
var nodeCount = 0
var renderer = 'canvas'
var fontSize = 10
data.nodeDataArray.forEach(element => {
nodeCount++
})
Expand All @@ -69,6 +70,9 @@ function graphInit(type) {
} else if (nodeCount > 150) {
$(".graphChanger").hide();
}
if (nodeCount > 80) {
fontSize = 9
}
console.log(type)
data.nodeDataArray.forEach(element => {
newElement = {};
Expand All @@ -81,7 +85,7 @@ function graphInit(type) {
if (type === "sankey") {
newElement.label = {
'rotate': 45,
'fontSize': 10,
'fontSize': fontSize,
'offset': [-20, -20],
'fontWeight': 400,
'color': element.group.toString(),
Expand All @@ -91,9 +95,8 @@ function graphInit(type) {
};
} else {
newElement.label = {
'fontSize': 10,
'fontWeight': 900,
'fontStyle': 'bold',
'fontSize': fontSize,
'fontWeight': 400,
'color': element.group,
"position": "inside",
// 'textBorderColor':'black',
Expand Down

0 comments on commit 30d7dbf

Please sign in to comment.