[Metrics UI] Don't render node if group width is 0 or NaN (#98980)

* don't render nodes if squareSize is NaN

* check group.width instead of squareSize

* fix react warning
This commit is contained in:
Sandra Gonzales 2021-05-04 16:47:55 -04:00 committed by GitHub
parent 6130f16a6e
commit f2693edddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,18 +43,20 @@ export const GroupOfNodes: React.FC<Props> = ({
<GroupOfNodesContainer style={{ width }}>
<GroupName group={group} onDrilldown={onDrilldown} isChild={isChild} options={options} />
<Nodes>
{group.nodes.map((node) => (
<Node
key={`${node.pathId}:${node.name}`}
options={options}
squareSize={group.squareSize}
node={node}
formatter={formatter}
bounds={bounds}
nodeType={nodeType}
currentTime={currentTime}
/>
))}
{group.width
? group.nodes.map((node) => (
<Node
key={`${node.pathId}:${node.name}`}
options={options}
squareSize={group.squareSize}
node={node}
formatter={formatter}
bounds={bounds}
nodeType={nodeType}
currentTime={currentTime}
/>
))
: null}
</Nodes>
</GroupOfNodesContainer>
);