You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by hb...@apache.org on 2022/11/19 08:38:27 UTC

[age-viewer] branch main updated: highlight node (#68)

This is an automated email from the ASF dual-hosted git repository.

hbshin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/age-viewer.git


The following commit(s) were added to refs/heads/main by this push:
     new f81720f  highlight node (#68)
f81720f is described below

commit f81720f652ddee183f7799525b285dcae8149963
Author: MJinH <97...@users.noreply.github.com>
AuthorDate: Sat Nov 19 00:38:22 2022 -0800

    highlight node (#68)
    
    Co-authored-by: moon19960501@gmail.com <we...@gmail.com>
---
 .../cytoscape/CypherResultCytoscapeChart.jsx       | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/frontend/src/components/cytoscape/CypherResultCytoscapeChart.jsx b/frontend/src/components/cytoscape/CypherResultCytoscapeChart.jsx
index 4477d86..0f15d52 100644
--- a/frontend/src/components/cytoscape/CypherResultCytoscapeChart.jsx
+++ b/frontend/src/components/cytoscape/CypherResultCytoscapeChart.jsx
@@ -34,6 +34,7 @@ import {
   faLockOpen,
   faProjectDiagram,
   faWindowClose,
+  faHighlighter,
 } from '@fortawesome/free-solid-svg-icons';
 import cxtmenu from '../../lib/cytoscape-cxtmenu';
 import { initLocation, seletableLayouts } from './CytoscapeLayouts';
@@ -211,6 +212,27 @@ const CypherResultCytoscapeCharts = ({
             select() {
             },
           },
+
+          {
+            content: ReactDOMServer.renderToString(
+              (<FontAwesomeIcon icon={faHighlighter} size="lg" />),
+            ),
+            select(ele) {
+              if (ele.style().borderColor === 'rgb(232,228,6)') {
+                let border;
+                elements.nodes.forEach((e) => {
+                  if (e.data.id === ele.id()) border = e.data.borderColor;
+                });
+                ele.style('borderColor', border);
+                ele.style('borderWidth', '3px');
+                ele.style('borderOpacity', '0.6');
+              } else {
+                ele.style('borderColor', '#e8e406');
+                ele.style('borderWidth', '10px');
+                ele.style('borderOpacity', '1');
+              }
+            },
+          },
         ],
         fillColor: 'rgba(210, 213, 218, 1)',
         activeFillColor: 'rgba(166, 166, 166, 1)',