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