diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx index d636f8b1f4d52c4..57a0d3512a7854a 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx @@ -4,21 +4,21 @@ * you may not use this file except in compliance with the Elastic License. */ +import cytoscape from 'cytoscape'; import React, { + createContext, CSSProperties, - useState, - useRef, - useEffect, ReactNode, - createContext, - useCallback + useCallback, + useEffect, + useRef, + useState } from 'react'; -import cytoscape from 'cytoscape'; import { isRumAgentName } from '../../../../../../../plugins/apm/common/agent_name'; import { + animationOptions, cytoscapeOptions, - nodeHeight, - animationOptions + nodeHeight } from './cytoscapeOptions'; export const CytoscapeContext = createContext( @@ -26,7 +26,7 @@ export const CytoscapeContext = createContext( ); interface CytoscapeProps { - children?: ReactNode; + children?: (cy?: cytoscape.Core) => ReactNode | ReactNode; elements: cytoscape.ElementDefinition[]; height: number; width: number; @@ -175,7 +175,7 @@ export function Cytoscape({ return (
- {children} + {typeof children === 'function' ? children(cy) : children}
); diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx index 418430e37b21e63..999827fd2b88679 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx @@ -19,6 +19,7 @@ const EmptyBannerCallOut = styled(EuiCallOut)` ${lightTheme.gutterTypes.gutterExtraLarge} ); position: absolute; + width: 95%; z-index: 1; `; diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/icons/dot-net.svg b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/icons/dot-net.svg index 9f7427f0e10017c..da7f1a8fde45daa 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/icons/dot-net.svg +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/icons/dot-net.svg @@ -1,127 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx index 2942ce64729e7df..22c72ad68d40940 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx @@ -201,7 +201,7 @@ export function ServiceMap({ serviceName }: ServiceMapProps) { if (!license) { return null; } - + console.log({ elements, renderedElements: renderedElements.current }); return isValidPlatinumLicense(license) ? (
- - {serviceName && renderedElements.current.length === 1 && ( - - )} - + {cy => { + return ( + <> + + {serviceName && cy?.nodes().length === 1 && } + + + ); + }}
) : (