From f606499ae8d8a85d0b9f837b9abdc2bbb854ceb8 Mon Sep 17 00:00:00 2001 From: Tuan Cao Date: Sun, 17 Apr 2022 21:01:13 +0700 Subject: [PATCH] Fix bug: Title not shown in Graph view --- components/Graph.js | 6 +++--- lib/utils.js | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/Graph.js b/components/Graph.js index 978dc9b..8563476 100644 --- a/components/Graph.js +++ b/components/Graph.js @@ -1,4 +1,4 @@ -import React, {useEffect, useRef, useState} from 'react'; +import React, {useState} from 'react'; // import cytoscape from 'cytoscape'; // import cola from 'cytoscape-cola'; @@ -36,8 +36,8 @@ const styleSheet = [{ "background-color": "#666", "font-size": "10px", "width": "20px", - "height": "20px" - //"label": el => el.data("id") === current ? "" : el.data('title') ? el.data("title").slice(0,16) : el.data("id") + "height": "20px", + "label":"data(label)" } }, { selector: "label", diff --git a/lib/utils.js b/lib/utils.js index 437d724..b8e1269 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -126,8 +126,7 @@ export function getGraphData(currentNodeId) { { data: { id: aNode.slug.toString(), - label: aNode.slug.toString(), - type: "ip" + label: Transformer.parseFileNameFromPath(toFilePath(aNode.slug)), } } )) @@ -136,7 +135,6 @@ export function getGraphData(currentNodeId) { data: { source: anEdge.source, target: anEdge.target, - // label: anEdge.source + " => " + anEdge.target } }))