mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
hide null keys from node
This commit is contained in:
parent
d7b8da00f9
commit
b2d1891d64
@ -90,7 +90,9 @@ const CustomNode = ({ nodeProps }) => {
|
|||||||
<StyledForeignObject width={width} height={height} x={0} y={0}>
|
<StyledForeignObject width={width} height={height} x={0} y={0}>
|
||||||
<StyledTextWrapper>
|
<StyledTextWrapper>
|
||||||
<StyledText width={width} height={height}>
|
<StyledText width={width} height={height}>
|
||||||
{entries.map((val) => (
|
{entries.map(
|
||||||
|
(val) =>
|
||||||
|
val[1] !== null && (
|
||||||
<div
|
<div
|
||||||
key={nodeProps.id}
|
key={nodeProps.id}
|
||||||
style={{
|
style={{
|
||||||
@ -98,14 +100,15 @@ const CustomNode = ({ nodeProps }) => {
|
|||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
padding: '0 auto',
|
padding: "0 auto",
|
||||||
width: width - 20
|
width: width - 20,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<StyledKey>{val[0]}: </StyledKey>
|
<StyledKey>{val[0]}: </StyledKey>
|
||||||
{val[1]}
|
{val[1]}
|
||||||
</div>
|
</div>
|
||||||
))}
|
)
|
||||||
|
)}
|
||||||
</StyledText>
|
</StyledText>
|
||||||
</StyledTextWrapper>
|
</StyledTextWrapper>
|
||||||
</StyledForeignObject>
|
</StyledForeignObject>
|
||||||
|
@ -22,8 +22,8 @@ export function getEdgeNodes(graph: any, isExpanded: boolean = true): any {
|
|||||||
nodes.push({
|
nodes.push({
|
||||||
id: el.id,
|
id: el.id,
|
||||||
text: el.text,
|
text: el.text,
|
||||||
width: isExpanded ? (35 + longestLine * 8) : 180,
|
width: isExpanded ? 35 + longestLine * 8 : 180,
|
||||||
height: isExpanded ? (30 + lines.length * 10) : 50,
|
height: isExpanded ? 30 + lines.length * 10 : 50,
|
||||||
data: { type: "special" },
|
data: { type: "special" },
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user