Skip to content

Commit 96dfc38

Browse files
color changes
1 parent 92231b2 commit 96dfc38

File tree

3 files changed

+44
-38
lines changed

3 files changed

+44
-38
lines changed

frontend/src/App.css

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,26 @@
192192
justify-content: center;
193193
}
194194

195-
.legend{
196-
display: inline-block;
197-
min-width: 0px;
198-
cursor: pointer;
199-
border-radius: 12px;
200-
padding: 2px 8px;
201-
font-size: var(--font-size-label);
202-
font-weight: var(--font-weight-bold);
203-
letter-spacing: 0;
204-
line-height: 1.25rem;
205-
width:max-content;
206-
height:30px
195+
.legend_div {
196+
display: flex;
197+
flex: 0.2;
198+
flex-wrap: wrap;
199+
padding: 15px;
200+
gap: 8px;
201+
background-color: #ffff;
202+
height: max-content
203+
}
204+
205+
.legend {
206+
display: inline-block;
207+
min-width: 0px;
208+
cursor: pointer;
209+
border-radius: 12px;
210+
padding: 2px 8px;
211+
font-size: var(--font-size-label);
212+
font-weight: var(--font-weight-bold);
213+
letter-spacing: 0;
214+
line-height: 1.25rem;
215+
width: max-content;
216+
height: 30px
207217
}

frontend/src/components/GraphViewModal.tsx

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { useEffect, useRef, useState } from 'react';
1212
import { GraphType, GraphViewModalProps } from '../types';
1313
import { InteractiveNvlWrapper } from '@neo4j-nvl/react';
1414
import NVL, { NvlOptions } from '@neo4j-nvl/core';
15-
// import { driver } from '../utils/Driver';
1615
import type { Node, Relationship } from '@neo4j-nvl/core';
1716

1817
import {
@@ -109,27 +108,27 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
109108
graphType.length === 3
110109
? queryMap.DocChunkEntities
111110
: graphType.includes('Entities') && graphType.includes('Chunks')
112-
? queryMap.ChunksEntities
113-
: graphType.includes('Entities') && graphType.includes('Document')
114-
? queryMap.DocEntities
115-
: graphType.includes('Document') && graphType.includes('Chunks')
116-
? queryMap.DocChunks
117-
: graphType.includes('Entities') && graphType.length === 1
118-
? queryMap.Entities
119-
: graphType.includes('Chunks') && graphType.length === 1
120-
? queryMap.Chunks
121-
: queryMap.Document;
111+
? queryMap.ChunksEntities
112+
: graphType.includes('Entities') && graphType.includes('Document')
113+
? queryMap.DocEntities
114+
: graphType.includes('Document') && graphType.includes('Chunks')
115+
? queryMap.DocChunks
116+
: graphType.includes('Entities') && graphType.length === 1
117+
? queryMap.Entities
118+
: graphType.includes('Chunks') && graphType.length === 1
119+
? queryMap.Chunks
120+
: queryMap.Document;
122121
if (viewPoint === 'showGraphView') {
123122
queryToRun = constructQuery(newCheck, documentNo);
124-
console.log('inside If QueryToRun', queryToRun);
123+
console.log('showGraph', queryToRun);
125124
} else {
126125
queryToRun = constructDocQuery(newCheck);
127-
console.log('outside QueryToRun', queryToRun);
126+
console.log('table', queryToRun);
128127
}
129128
const session = driver?.session();
130129
setLoading(true);
131130
session
132-
?.run(queryToRun, { 'document_name': inspectedName })
131+
?.run(queryToRun, { document_name: inspectedName })
133132
.then((results) => {
134133
if (results.records && results.records.length > 0) {
135134
// @ts-ignore
@@ -159,7 +158,7 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
159158
iconAlign: 'bottom',
160159
captionHtml: <b>Test</b>,
161160
caption: `${g.labels}: ${getNodeCaption(g)}`,
162-
color: scheme[g.labels],
161+
color: scheme[g.labels[0]],
163162
icon: getIcon(g),
164163
};
165164
});
@@ -239,11 +238,11 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
239238
nvlRef.current?.setZoom(nvlRef.current.getScale() * 0.7);
240239
};
241240

242-
const onClose=()=>{
241+
const onClose = () => {
243242
setStatus('unknown');
244243
setStatusMessage('');
245-
setGraphViewOpen(false)
246-
}
244+
setGraphViewOpen(false);
245+
};
247246

248247
return (
249248
<>
@@ -316,16 +315,10 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
316315
</div>
317316
) : (
318317
<>
319-
<Flex
320-
flexDirection='row'
321-
justifyContent='space-between'
322-
style={{ height: '100%', padding: '20px' }}
323-
324-
>
325-
<div style={{ display: 'flex', flex: '0.2', flexWrap: 'wrap', padding: '15px', gap: '8px', backgroundColor: 'white', height: 'max-content' }}>
318+
<Flex flexDirection='row' justifyContent='space-between' style={{ height: '100%', padding: '20px' }}>
319+
<div className='legend_div'>
326320
{Object.keys(scheme).map((key) => (
327321
<div className='legend' key={scheme.key} style={{ backgroundColor: `${scheme[key]}` }}>
328-
{scheme.key}
329322
{key}
330323
</div>
331324
))}

frontend/src/utils/Constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export const colors = [
3939
'#d9ad7c',
4040
'#a2836e',
4141
'#674d3c',
42+
'#d7b69f',
43+
'#00ffff',
44+
'##8eb9ff',
4245
];
4346
export const llms =
4447
process.env?.LLM_MODELS?.trim() != ''

0 commit comments

Comments
 (0)