Skip to content

Commit

Permalink
Merge pull request #699 from JonanOribe/Font-color-not-changed-in-gra…
Browse files Browse the repository at this point in the history
…ph-contextual-popups-when-in-dark-mode

Font-color not changed in graph contextual popups when in dark mode #621
  • Loading branch information
alfredorubin96 authored Nov 27, 2023
2 parents 94d58ab + 9486969 commit 4220f54
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/chart/graph/GraphChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const NeoGraphChart = (props: ChartProps) => {

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

const generateVisualizationDataGraph = (records, _) => {
let nodes: Record<string, any>[] = [];
Expand Down Expand Up @@ -159,6 +160,7 @@ const NeoGraphChart = (props: ChartProps) => {
defaultRelWidth: settings.defaultRelWidth,
relColorProp: settings.relColorProp,
defaultRelColor: settings.defaultRelColor,
theme: theme,
},
engine: {
layout: layouts[settings.layout],
Expand Down
1 change: 1 addition & 0 deletions src/chart/graph/GraphChartVisualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface GraphChartVisualizationProps {
defaultRelWidth: number;
relColorProp: string;
defaultRelColor: string;
theme?: string;
};
/**
* The keys in 'engine' are related to the graph rendering engine (force-directed layout) or the NeoDash query engine.
Expand Down
2 changes: 1 addition & 1 deletion src/chart/graph/component/GraphChartInspectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const NeoGraphChartInspectModal = (props: GraphChartVisualizationProps) =
: ''}
</Dialog.Header>
<Dialog.Content>
<GraphEntityInspectionTable entity={props.interactivity.selectedEntity}></GraphEntityInspectionTable>
<GraphEntityInspectionTable entity={props.interactivity.selectedEntity} theme={props.style.theme}></GraphEntityInspectionTable>
</Dialog.Content>
</Dialog>
</div>
Expand Down
11 changes: 7 additions & 4 deletions src/chart/graph/component/GraphEntityInspectionTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const formatProperty = (property) => {
*/
export const GraphEntityInspectionTable = ({
entity,
theme,
setSelectedParameters = (_value) => {
console.log('undefined function in GraphEntityInspectionTable');

Check warning on line 24 in src/chart/graph/component/GraphEntityInspectionTable.tsx

View workflow job for this annotation

GitHub Actions / build-test (18.x)

Unexpected console statement
},
Expand Down Expand Up @@ -51,14 +52,16 @@ export const GraphEntityInspectionTable = ({
}
}

const tableTextColor = theme === 'dark' ? 'var(--palette-dark-neutral-border-strong)' : 'rgba(0, 0, 0, 0.6)';

return (
<TableContainer>
<Table size='small'>
{hasPropertyToShow ? (
<TableHead>
<TableRow>
<TableCell align='left'>Property</TableCell>
<TableCell align='left'>Value</TableCell>
<TableCell align='left' style={{color:tableTextColor}}>Property</TableCell>
<TableCell align='left' style={{color:tableTextColor}}>Value</TableCell>
{checklistEnabled ? <TableCell align='center'>Select Property</TableCell> : <></>}
</TableRow>
</TableHead>
Expand All @@ -77,10 +80,10 @@ export const GraphEntityInspectionTable = ({
.sort()
.map((key) => (
<TableRow key={key}>
<TableCell component='th' scope='row'>
<TableCell component='th' scope='row' style={{color:tableTextColor}}>
{key}
</TableCell>
<TableCell align={'left'}>
<TableCell align={'left'} style={{color:tableTextColor}}>
<ShowMoreText lines={2}>{formatProperty(entity && entity.properties[key].toString())}</ShowMoreText>
</TableCell>
{checklistEnabled ? (
Expand Down

0 comments on commit 4220f54

Please sign in to comment.