diff --git a/libs/shared/lib/schema/pills/nodes/entity/SchemaEntityPill.tsx b/libs/shared/lib/schema/pills/nodes/entity/SchemaEntityPill.tsx index c4fb7f010b2b1dd82d8604230e565c280208d53b..054e019b46251a4ab768f57c463d298da63f1bcf 100644 --- a/libs/shared/lib/schema/pills/nodes/entity/SchemaEntityPill.tsx +++ b/libs/shared/lib/schema/pills/nodes/entity/SchemaEntityPill.tsx @@ -14,7 +14,6 @@ export const SchemaEntityPill = React.memo(({ id, selected, data }: NodeProps<Sc const viewport = useViewport(); const schemaStats = useSchemaStats(); - const ref = useRef<HTMLDivElement>(null); /** * adds drag functionality in order to be able to drag the entityNode to the schema @@ -39,13 +38,13 @@ export const SchemaEntityPill = React.memo(({ id, selected, data }: NodeProps<Sc const tooltipX = useMemo(() => { if (ref.current == null || openPopupLocation == null) return -1; const rect = ref.current.getBoundingClientRect(); - return rect.x - openPopupLocation.x + (rect.width / 2); + return rect.x - openPopupLocation.x + rect.width / 2; }, [viewport.x, openPopupLocation]); const tooltipY = useMemo(() => { if (ref.current == null || openPopupLocation == null) return -1; const rect = ref.current.getBoundingClientRect(); - return rect.y - openPopupLocation.y + (rect.height / 2); + return rect.y - openPopupLocation.y + rect.height / 2; }, [viewport.y, openPopupLocation]); return ( @@ -83,7 +82,7 @@ export const SchemaEntityPill = React.memo(({ id, selected, data }: NodeProps<Sc }, {} as Record<string, string>, )} - numberOfElements={schemaStats.nodeStats[data.name]?.count} + numberOfElements={schemaStats.nodes.stats[data.name]?.count} /> </VisualizationTooltip> </div> diff --git a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx index 738baaad3aff52a10f32618dba85fac3e2d0f2ed..8413a3c29982895a940ad93066f415e7da9d1158 100644 --- a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx +++ b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationPill.tsx @@ -94,7 +94,7 @@ export const SchemaRelationPill = React.memo(({ id, selected, data, ...props }: : {} } connections={{ from: data.from, to: data.to }} - numberOfElements={schemaStats.edgeStats[data.collection]?.count} + numberOfElements={schemaStats.edges.stats[data.collection]?.count} /> </VisualizationTooltip> </div>