Fix bug: Title not shown in Graph view

This commit is contained in:
Tuan Cao 2022-04-17 21:01:13 +07:00
parent 6f027aeb8e
commit f606499ae8
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import React, {useEffect, useRef, useState} from 'react'; import React, {useState} from 'react';
// import cytoscape from 'cytoscape'; // import cytoscape from 'cytoscape';
// import cola from 'cytoscape-cola'; // import cola from 'cytoscape-cola';
@ -36,8 +36,8 @@ const styleSheet = [{
"background-color": "#666", "background-color": "#666",
"font-size": "10px", "font-size": "10px",
"width": "20px", "width": "20px",
"height": "20px" "height": "20px",
//"label": el => el.data("id") === current ? "" : el.data('title') ? el.data("title").slice(0,16) : el.data("id") "label":"data(label)"
} }
}, { }, {
selector: "label", selector: "label",

View File

@ -126,8 +126,7 @@ export function getGraphData(currentNodeId) {
{ {
data: { data: {
id: aNode.slug.toString(), id: aNode.slug.toString(),
label: aNode.slug.toString(), label: Transformer.parseFileNameFromPath(toFilePath(aNode.slug)),
type: "ip"
} }
} }
)) ))
@ -136,7 +135,6 @@ export function getGraphData(currentNodeId) {
data: { data: {
source: anEdge.source, source: anEdge.source,
target: anEdge.target, target: anEdge.target,
// label: anEdge.source + " => " + anEdge.target
} }
})) }))