Skip to content

Commit 7f20e19

Browse files
committed
final
1 parent 1e011f3 commit 7f20e19

File tree

7 files changed

+120
-95
lines changed

7 files changed

+120
-95
lines changed

src/chart/Utils.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { QueryResult, Record as Neo4jRecord } from 'neo4j-driver';
2-
import { tokens } from '@neo4j-ndl/base';
2+
33
export function recordToNative(input: any): any {
44
if (!input && input !== false) {
55
return null;
@@ -118,6 +118,7 @@ export enum EntityType {
118118
}
119119

120120
export const themeNivo = {
121+
textColor: 'rgb(var(--palette-neutral-text-weak))',
121122
text: { fill: 'rgb(var(--palette-neutral-text-weak))' },
122123
axis: {
123124
ticks: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
@@ -127,5 +128,15 @@ export const themeNivo = {
127128
text: { fill: 'rgb(var(--palette-neutral-text-weak))' },
128129
title: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
129130
ticks: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
131+
hidden: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
132+
},
133+
markers: {
134+
text: { fill: 'rgb(var(--palette-neutral-text-default))' },
135+
},
136+
labels: {
137+
text: { fill: 'rgb(var(--palette-neutral-text-default))' },
138+
},
139+
annotations: {
140+
text: { fill: 'rgb(var(--palette-neutral-text-default))' },
130141
},
131142
};

src/chart/parameter/ParameterSelectionChart.tsx

Lines changed: 106 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import NodePropertyParameterSelectComponent from './component/NodePropertyParame
55
import RelationshipPropertyParameterSelectComponent from './component/RelationshipPropertyParameterSelect';
66
import FreeTextParameterSelectComponent from './component/FreeTextParameterSelect';
77
import QueryParameterSelectComponent from './component/QueryParameterSelect';
8+
import { createTheme, ThemeProvider } from '@mui/material/styles';
89

910
/**
1011
* A special chart type to define global dashboard parameters that are injected as query parameters into each report.
@@ -36,96 +37,111 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
3637
return <p style={{ margin: '15px' }}>No selection specified.</p>;
3738
}
3839

39-
if (type == 'Free Text') {
40-
return (
41-
<FreeTextParameterSelectComponent
42-
parameterName={parameterName}
43-
parameterDisplayName={parameterName}
44-
parameterValue={parameterValue}
45-
parameterDisplayValue={parameterDisplayValue}
46-
setParameterValue={setParameterValue}
47-
setParameterDisplayValue={setParameterDisplayValue}
48-
query={query}
49-
queryCallback={queryCallback}
50-
settings={props.settings}
51-
allParameters={allParameters}
52-
compatibilityMode={compatibilityMode}
53-
manualParameterSave={manualParameterSave}
54-
/>
55-
);
56-
} else if (type == 'Node Property') {
57-
return (
58-
<NodePropertyParameterSelectComponent
59-
parameterName={parameterName}
60-
parameterDisplayName={parameterName}
61-
parameterValue={parameterValue}
62-
parameterDisplayValue={parameterDisplayValue}
63-
setParameterValue={setParameterValue}
64-
setParameterDisplayValue={setParameterDisplayValue}
65-
query={query}
66-
queryCallback={queryCallback}
67-
settings={props.settings}
68-
allParameters={allParameters}
69-
compatibilityMode={compatibilityMode}
70-
multiSelector={multiSelector}
71-
manualParameterSave={manualParameterSave}
72-
/>
73-
);
74-
} else if (type == 'Relationship Property') {
75-
return (
76-
<RelationshipPropertyParameterSelectComponent
77-
parameterName={parameterName}
78-
parameterDisplayName={parameterName}
79-
parameterValue={parameterValue}
80-
parameterDisplayValue={parameterDisplayValue}
81-
setParameterValue={setParameterValue}
82-
setParameterDisplayValue={setParameterDisplayValue}
83-
query={query}
84-
queryCallback={queryCallback}
85-
settings={props.settings}
86-
allParameters={allParameters}
87-
compatibilityMode={compatibilityMode}
88-
multiSelector={multiSelector}
89-
manualParameterSave={manualParameterSave}
90-
/>
91-
);
92-
} else if (type == 'Date Picker') {
93-
return (
94-
<DatePickerParameterSelectComponent
95-
parameterName={parameterName}
96-
parameterDisplayName={parameterName}
97-
parameterValue={parameterValue}
98-
parameterDisplayValue={parameterDisplayValue}
99-
setParameterValue={setParameterValue}
100-
setParameterDisplayValue={setParameterDisplayValue}
101-
query={query}
102-
queryCallback={queryCallback}
103-
settings={props.settings}
104-
allParameters={allParameters}
105-
compatibilityMode={compatibilityMode}
106-
manualParameterSave={manualParameterSave}
107-
/>
108-
);
109-
} else if (type == 'Custom Query') {
110-
return (
111-
<QueryParameterSelectComponent
112-
parameterName={parameterName}
113-
parameterDisplayName={parameterName}
114-
parameterValue={parameterValue}
115-
parameterDisplayValue={parameterDisplayValue}
116-
setParameterValue={setParameterValue}
117-
setParameterDisplayValue={setParameterDisplayValue}
118-
query={query}
119-
queryCallback={queryCallback}
120-
settings={props.settings}
121-
allParameters={allParameters}
122-
compatibilityMode={compatibilityMode}
123-
multiSelector={multiSelector}
124-
manualParameterSave={manualParameterSave}
125-
/>
126-
);
127-
}
128-
return <div>Invalid Parameter Selector Type.</div>;
40+
const theme = createTheme({
41+
typography: {
42+
fontFamily: "'Nunito Sans', sans-serif !important",
43+
allVariants: { color: 'rgb(var(--palette-neutral-text-weak))' },
44+
},
45+
palette: {
46+
text: {
47+
primary: 'rgb(var(--palette-neutral-text-weaker))',
48+
},
49+
},
50+
});
51+
52+
const content = () => {
53+
if (type == 'Free Text') {
54+
return (
55+
<FreeTextParameterSelectComponent
56+
parameterName={parameterName}
57+
parameterDisplayName={parameterName}
58+
parameterValue={parameterValue}
59+
parameterDisplayValue={parameterDisplayValue}
60+
setParameterValue={setParameterValue}
61+
setParameterDisplayValue={setParameterDisplayValue}
62+
query={query}
63+
queryCallback={queryCallback}
64+
settings={props.settings}
65+
allParameters={allParameters}
66+
compatibilityMode={compatibilityMode}
67+
manualParameterSave={manualParameterSave}
68+
/>
69+
);
70+
} else if (type == 'Node Property') {
71+
return (
72+
<NodePropertyParameterSelectComponent
73+
parameterName={parameterName}
74+
parameterDisplayName={parameterName}
75+
parameterValue={parameterValue}
76+
parameterDisplayValue={parameterDisplayValue}
77+
setParameterValue={setParameterValue}
78+
setParameterDisplayValue={setParameterDisplayValue}
79+
query={query}
80+
queryCallback={queryCallback}
81+
settings={props.settings}
82+
allParameters={allParameters}
83+
compatibilityMode={compatibilityMode}
84+
multiSelector={multiSelector}
85+
manualParameterSave={manualParameterSave}
86+
/>
87+
);
88+
} else if (type == 'Relationship Property') {
89+
return (
90+
<RelationshipPropertyParameterSelectComponent
91+
parameterName={parameterName}
92+
parameterDisplayName={parameterName}
93+
parameterValue={parameterValue}
94+
parameterDisplayValue={parameterDisplayValue}
95+
setParameterValue={setParameterValue}
96+
setParameterDisplayValue={setParameterDisplayValue}
97+
query={query}
98+
queryCallback={queryCallback}
99+
settings={props.settings}
100+
allParameters={allParameters}
101+
compatibilityMode={compatibilityMode}
102+
multiSelector={multiSelector}
103+
manualParameterSave={manualParameterSave}
104+
/>
105+
);
106+
} else if (type == 'Date Picker') {
107+
return (
108+
<DatePickerParameterSelectComponent
109+
parameterName={parameterName}
110+
parameterDisplayName={parameterName}
111+
parameterValue={parameterValue}
112+
parameterDisplayValue={parameterDisplayValue}
113+
setParameterValue={setParameterValue}
114+
setParameterDisplayValue={setParameterDisplayValue}
115+
query={query}
116+
queryCallback={queryCallback}
117+
settings={props.settings}
118+
allParameters={allParameters}
119+
compatibilityMode={compatibilityMode}
120+
manualParameterSave={manualParameterSave}
121+
/>
122+
);
123+
} else if (type == 'Custom Query') {
124+
return (
125+
<QueryParameterSelectComponent
126+
parameterName={parameterName}
127+
parameterDisplayName={parameterName}
128+
parameterValue={parameterValue}
129+
parameterDisplayValue={parameterDisplayValue}
130+
setParameterValue={setParameterValue}
131+
setParameterDisplayValue={setParameterDisplayValue}
132+
query={query}
133+
queryCallback={queryCallback}
134+
settings={props.settings}
135+
allParameters={allParameters}
136+
compatibilityMode={compatibilityMode}
137+
multiSelector={multiSelector}
138+
manualParameterSave={manualParameterSave}
139+
/>
140+
);
141+
}
142+
return <div>Invalid Parameter Selector Type.</div>;
143+
};
144+
return <ThemeProvider theme={theme}>{content()}</ThemeProvider>;
129145
};
130146

131147
export default NeoParameterSelectionChart;

src/chart/table/TableChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const HIDDEN_COLUMN_PREFIX = '__';
3333
const theme = createTheme({
3434
typography: {
3535
fontFamily: "'Nunito Sans', sans-serif !important",
36+
allVariants: { color: 'rgb(var(--palette-neutral-text-default))' },
3637
},
3738
});
3839
const fallbackRenderer = (value) => {

src/extensions/advancedcharts/chart/choropleth/ChoroplethMapChart.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ const NeoChoroplethMapChart = (props: ChartProps) => {
9999
itemWidth: 94,
100100
itemHeight: 18,
101101
itemDirection: 'left-to-right',
102-
itemTextColor: '#444444',
103102
itemOpacity: 0.85,
104103
symbolSize: 18,
105104
effects: [

src/extensions/advancedcharts/chart/radar/RadarChart.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const NeoRadarChart = (props: ChartProps) => {
115115
translateY: -40,
116116
itemWidth: 100,
117117
itemHeight: 14,
118-
itemTextColor: '#999',
119118
symbolSize: 14,
120119
symbolShape: 'circle',
121120
effects: [

src/extensions/advancedcharts/chart/sankey/SankeyChart.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ const NeoSankeyChart = (props: ChartProps) => {
236236
itemHeight: 14,
237237
itemDirection: 'right-to-left',
238238
itemsSpacing: 2,
239-
itemTextColor: '#999',
240239
symbolSize: 14,
241240
effects: [
242241
{

src/report/Report.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export const NeoReport = ({
253253
}
254254
return (
255255
<div
256-
className={'n-text-palette-primary-bg-strong'}
256+
className={'n-text-palette-neutral-text-default'}
257257
style={{ height: '100%', marginTop: '0px', overflow: reportTypes[type].allowScrolling ? 'auto' : 'hidden' }}
258258
>
259259
<ChartType

0 commit comments

Comments
 (0)