diff --git a/src/components/Details/DetailsComponent.tsx b/src/components/Details/DetailsComponent.tsx index e105060..6990a55 100644 --- a/src/components/Details/DetailsComponent.tsx +++ b/src/components/Details/DetailsComponent.tsx @@ -89,7 +89,12 @@ export const DetailsComponent = () => { */ function getRows(data: any) { if (data == null) return; - return Object.entries(data).sort().map(e => { + const rows = Object.entries(data); + const nameRow = rows.find(([key]) => key === 'name'); + const otherRows = rows.filter(([key]) => key !== 'name'); + const sortedRows = otherRows.sort((a, b) => a[0].localeCompare(b[0])); + const finalRows = nameRow ? [nameRow, ...sortedRows] : sortedRows; + return finalRows.map(e => { return {String(e[0])} diff --git a/src/components/Details/QueryComponent.tsx b/src/components/Details/QueryComponent.tsx index 3e9fbd9..99ec9e4 100644 --- a/src/components/Details/QueryComponent.tsx +++ b/src/components/Details/QueryComponent.tsx @@ -8,7 +8,7 @@ import axios from "axios"; import { COMMON_GREMLIN_ERROR, QUERY_ENDPOINT } from "../../constants"; import { onFetchQuery } from "../../logics/actionHelper"; import { RootState } from "../../app/store"; -import { highlightNodesAndEdges } from "../../logics/graphImpl/visImpl"; +// import { highlightNodesAndEdges } from "../../logics/graphImpl/visImpl"; const Query = ({ }) => { const dispatch = useDispatch() @@ -24,7 +24,7 @@ const Query = ({ }) => { function sendQuery() { dispatch(setError(null)); - highlightNodesAndEdges(null, null); + // highlightNodesAndEdges(null, null); axios .post( QUERY_ENDPOINT, diff --git a/src/logics/graphImpl/cytoImpl.ts b/src/logics/graphImpl/cytoImpl.ts index 184566c..76874ee 100644 --- a/src/logics/graphImpl/cytoImpl.ts +++ b/src/logics/graphImpl/cytoImpl.ts @@ -60,7 +60,8 @@ function toCyNode(n: NodeData): cy.NodeDefinition { 'background-opacity': 0, 'background-image': getIcon(n.type), 'background-fit': 'contain', - 'text-max-width' : '100px', + //'font-size': '0px', + 'text-max-width' : '80px', 'text-wrap': 'wrap', 'text-valign': 'bottom' }, @@ -112,6 +113,7 @@ export function getCytoGraph(container?: HTMLElement, data?: GraphData, options? width: 1, "curve-style": "bezier", "target-arrow-shape": 'triangle', + //"font-size": "0px", "text-rotation": "autorotate", "label": "data(label)" }