Skip to content

Commit 4220f54

Browse files
Merge pull request #699 from JonanOribe/Font-color-not-changed-in-graph-contextual-popups-when-in-dark-mode
Font-color not changed in graph contextual popups when in dark mode #621
2 parents 94d58ab + 9486969 commit 4220f54

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/chart/graph/GraphChart.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const NeoGraphChart = (props: ChartProps) => {
8989

9090
let icons = parseNodeIconConfig(settings.iconStyle);
9191
const colorScheme = categoricalColorSchemes[settings.nodeColorScheme];
92+
const {theme} = props;
9293

9394
const generateVisualizationDataGraph = (records, _) => {
9495
let nodes: Record<string, any>[] = [];
@@ -159,6 +160,7 @@ const NeoGraphChart = (props: ChartProps) => {
159160
defaultRelWidth: settings.defaultRelWidth,
160161
relColorProp: settings.relColorProp,
161162
defaultRelColor: settings.defaultRelColor,
163+
theme: theme,
162164
},
163165
engine: {
164166
layout: layouts[settings.layout],

src/chart/graph/GraphChartVisualization.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export interface GraphChartVisualizationProps {
8888
defaultRelWidth: number;
8989
relColorProp: string;
9090
defaultRelColor: string;
91+
theme?: string;
9192
};
9293
/**
9394
* The keys in 'engine' are related to the graph rendering engine (force-directed layout) or the NeoDash query engine.

src/chart/graph/component/GraphChartInspectModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const NeoGraphChartInspectModal = (props: GraphChartVisualizationProps) =
2222
: ''}
2323
</Dialog.Header>
2424
<Dialog.Content>
25-
<GraphEntityInspectionTable entity={props.interactivity.selectedEntity}></GraphEntityInspectionTable>
25+
<GraphEntityInspectionTable entity={props.interactivity.selectedEntity} theme={props.style.theme}></GraphEntityInspectionTable>
2626
</Dialog.Content>
2727
</Dialog>
2828
</div>

src/chart/graph/component/GraphEntityInspectionTable.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const formatProperty = (property) => {
1919
*/
2020
export const GraphEntityInspectionTable = ({
2121
entity,
22+
theme,
2223
setSelectedParameters = (_value) => {
2324
console.log('undefined function in GraphEntityInspectionTable');
2425
},
@@ -51,14 +52,16 @@ export const GraphEntityInspectionTable = ({
5152
}
5253
}
5354

55+
const tableTextColor = theme === 'dark' ? 'var(--palette-dark-neutral-border-strong)' : 'rgba(0, 0, 0, 0.6)';
56+
5457
return (
5558
<TableContainer>
5659
<Table size='small'>
5760
{hasPropertyToShow ? (
5861
<TableHead>
5962
<TableRow>
60-
<TableCell align='left'>Property</TableCell>
61-
<TableCell align='left'>Value</TableCell>
63+
<TableCell align='left' style={{color:tableTextColor}}>Property</TableCell>
64+
<TableCell align='left' style={{color:tableTextColor}}>Value</TableCell>
6265
{checklistEnabled ? <TableCell align='center'>Select Property</TableCell> : <></>}
6366
</TableRow>
6467
</TableHead>
@@ -77,10 +80,10 @@ export const GraphEntityInspectionTable = ({
7780
.sort()
7881
.map((key) => (
7982
<TableRow key={key}>
80-
<TableCell component='th' scope='row'>
83+
<TableCell component='th' scope='row' style={{color:tableTextColor}}>
8184
{key}
8285
</TableCell>
83-
<TableCell align={'left'}>
86+
<TableCell align={'left'} style={{color:tableTextColor}}>
8487
<ShowMoreText lines={2}>{formatProperty(entity && entity.properties[key].toString())}</ShowMoreText>
8588
</TableCell>
8689
{checklistEnabled ? (

0 commit comments

Comments
 (0)