Skip to content

Commit d477319

Browse files
committed
Fixed README. Update array rendering in table charts
1 parent 71ca606 commit d477319

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To run the application in development mode:
2222
- open a terminal and navigate to the directory you just cloned.
2323
- execute `npm install` to install the necessary dependencies.
2424
- execute `npm run dev` to run the app in development mode.
25-
- the application should be available at http://localhost:3001.
25+
- the application should be available at http://localhost:3000.
2626

2727

2828
To build the app for production:

src/chart/TableChart.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ function RenderTableValue(value, key = 0) {
2727
return "";
2828
}
2929
if (valueIsArray(value)) {
30-
const mapped = value.map((v, i) => RenderTableValue(v));
30+
const mapped = value.map((v, i) => {
31+
return <div>
32+
{RenderTableValue(v)}
33+
{i < value.length - 1 && !valueIsNode(v) && !valueIsRelationship(v) ? <span>,&nbsp;</span> : <></>}
34+
</div>
35+
});
3136
return mapped;
3237
} else if (valueIsNode(value)) {
3338
return <HtmlTooltip key={key + "-" + value.identity} arrow title={<div><b> {value.labels.length > 0 ? value.labels.join(", ") : "Node"}</b><table><tbody>{Object.keys(value.properties).length == 0 ? <tr><td>(No properties)</td></tr> : Object.keys(value.properties).map((k, i) => <tr key={i}><td key={0}>{k.toString()}:</td><td key={1}>{value.properties[k].toString()}</td></tr>)}</tbody></table></div>}>
@@ -37,7 +42,7 @@ function RenderTableValue(value, key = 0) {
3742
return <HtmlTooltip key={key + "-" + value.identity} arrow title={<div><b> {value.type}</b><table><tbody>{Object.keys(value.properties).length == 0 ? <tr><td>(No properties)</td></tr> : Object.keys(value.properties).map((k, i) => <tr key={i}><td key={0}>{k.toString()}:</td><td key={1}>{value.properties[k].toString()}</td></tr>)}</tbody></table></div>}>
3843
<Chip style={{ borderRadius: 0, clipPath: (value.direction == undefined) ? "none" : ((value.direction) ? rightRelationship : leftRelationship) }} label={value.type} />
3944
</HtmlTooltip>
40-
} else if (valueIsPath(value)) {
45+
} else if (valueIsPath(value)) {
4146
return value.segments.map((segment, i) => {
4247
return RenderTableValue((i < value.segments.length - 1) ?
4348
[segment.start, addDirection(segment.relationship, segment.start)] :
@@ -49,7 +54,7 @@ function RenderTableValue(value, key = 0) {
4954
return value.toString();
5055
}
5156
const NeoTableChart = (props: ChartProps) => {
52-
if (props.records == null || props.records.length == 0 || props.records[0].keys == null){
57+
if (props.records == null || props.records.length == 0 || props.records[0].keys == null) {
5358
return <>No data, re-run the report.</>
5459
}
5560

0 commit comments

Comments
 (0)