Skip to content

Commit 58c8bc5

Browse files
Merge pull request #852 from neo4j-labs/issue/789-wrap-text-table
#789 wrap text table
2 parents 85f4e4f + 52e3438 commit 58c8bc5

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

public/style.css

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,13 @@
125125
margin-top: -10px;
126126
}
127127

128-
.MuiDataGrid-virtualScroller {
129-
overflow-y: hidden !important;
130-
}
131-
132-
.MuiDataGrid-panel{
128+
.MuiDataGrid-panel {
133129
translate: 0px -152%;
134130
}
135131

136132
.MuiCard-root {
137-
box-shadow: 0 0 #0000,0 0 #0000,var(--tw-shadow) !important;
138-
box-shadow: var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow) !important;
133+
box-shadow: 0 0 #0000, 0 0 #0000, var(--tw-shadow) !important;
134+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
139135
}
140136

141137
.white-text {
@@ -188,7 +184,6 @@
188184
text-align: center;
189185
}
190186

191-
192187
.card-view.expanded {
193188
position: absolute;
194189
top: 0;
@@ -218,24 +213,23 @@
218213

219214
.card-view .MuiTablePagination-root {
220215
margin-top: 0px;
221-
222216
}
223217

224218
@keyframes pulse {
225-
0% {
226-
transform: scale(0.95);
227-
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
228-
}
219+
0% {
220+
transform: scale(0.95);
221+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
222+
}
229223

230-
70% {
231-
transform: scale(1);
232-
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
233-
}
224+
70% {
225+
transform: scale(1);
226+
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
227+
}
234228

235-
100% {
236-
transform: scale(0.95);
237-
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
238-
}
229+
100% {
230+
transform: scale(0.95);
231+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
232+
}
239233
}
240234

241235
/* Workaround for Needle not handling menu placement of dropdowns on modals */
@@ -247,14 +241,14 @@
247241
/* End workaround */
248242

249243
/* Workaround for cleaning the Gantt chart UI */
250-
.gantt-wrapper > div > div:first-child > div:first-child > div:first-child > div> div:not(:first-child) {
244+
.gantt-wrapper > div > div:first-child > div:first-child > div:first-child > div > div:not(:first-child) {
251245
display: none;
252246
}
253-
.gantt-wrapper > div > div > div > div> div> div> div:not(:first-child) {
247+
.gantt-wrapper > div > div > div > div > div > div > div:not(:first-child) {
254248
display: none;
255249
}
256250
/* End Gantt chart workaround */
257251

258252
.markdown-widget a {
259253
text-decoration: underline;
260-
}
254+
}

src/chart/table/TableChart.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ export const NeoTableChart = (props: ChartProps) => {
271271
<DataGrid
272272
key={'tableKey'}
273273
headerHeight={32}
274-
rowHeight={tableRowHeight}
274+
density={compact ? 'compact' : 'standard'}
275+
getRowHeight={() => 'auto'}
275276
rows={rows}
276277
columns={columns}
277278
columnVisibilityModel={columnVisibilityModel}
@@ -314,6 +315,12 @@ export const NeoTableChart = (props: ChartProps) => {
314315
})
315316
.join(' ');
316317
}}
318+
sx={{
319+
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '3px' },
320+
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
321+
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
322+
'&.MuiDataGrid-root .MuiDataGrid-cell': { wordBreak: 'break-word' },
323+
}}
317324
/>
318325
</div>
319326
</ThemeProvider>

0 commit comments

Comments
 (0)