Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icons as described in #56235. Also: * Add double-border and ghost "shadow" on nodes * Add framework name capability to popover metrics (doesn't actually fetch this data yet)
- Loading branch information
Showing
14 changed files
with
534 additions
and
41 deletions.
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Cytoscape.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiCard, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import { storiesOf } from '@storybook/react'; | ||
import cytoscape from 'cytoscape'; | ||
import React from 'react'; | ||
import { iconForNode } from './icons'; | ||
|
||
storiesOf('app/ServiceMap/Cytoscape', module).add( | ||
'node icons', | ||
() => { | ||
const cy = cytoscape(); | ||
const elements = [ | ||
{ data: { id: 'default', label: 'default', type: undefined } }, | ||
{ data: { id: 'cache', label: 'cache', type: 'cache' } }, | ||
{ data: { id: 'database', label: 'database', type: 'database' } }, | ||
{ data: { id: 'external', label: 'external', type: 'external' } }, | ||
{ data: { id: 'messaging', label: 'messaging', type: 'messaging' } }, | ||
|
||
{ | ||
data: { | ||
id: 'dotnet', | ||
label: 'dotnet service', | ||
type: 'service', | ||
agentName: 'dotnet' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'go', | ||
label: 'go service', | ||
type: 'service', | ||
agentName: 'go' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'java', | ||
label: 'java service', | ||
type: 'service', | ||
agentName: 'java' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'js-base', | ||
label: 'js-base service', | ||
type: 'service', | ||
agentName: 'js-base' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'nodejs', | ||
label: 'nodejs service', | ||
type: 'service', | ||
agentName: 'nodejs' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'php', | ||
label: 'php service', | ||
type: 'service', | ||
agentName: 'php' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'python', | ||
label: 'python service', | ||
type: 'service', | ||
agentName: 'python' | ||
} | ||
}, | ||
{ | ||
data: { | ||
id: 'ruby', | ||
label: 'ruby service', | ||
type: 'service', | ||
agentName: 'ruby' | ||
} | ||
} | ||
]; | ||
cy.add(elements); | ||
|
||
return ( | ||
<EuiFlexGroup gutterSize="l" wrap={true}> | ||
{cy.nodes().map(node => ( | ||
<EuiFlexItem key={node.data('id')}> | ||
<EuiCard | ||
description={ | ||
<pre> | ||
agentName: {node.data('agentName') || 'undefined'}, type:{' '} | ||
{node.data('type') || 'undefined'} | ||
</pre> | ||
} | ||
icon={ | ||
<img | ||
alt={node.data('label')} | ||
src={iconForNode(node)} | ||
height={80} | ||
width={80} | ||
/> | ||
} | ||
title={node.data('label')} | ||
/> | ||
</EuiFlexItem> | ||
))} | ||
</EuiFlexGroup> | ||
); | ||
}, | ||
{ | ||
info: { | ||
propTables: false, | ||
source: false | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
x-pack/legacy/plugins/apm/public/components/app/ServiceMap/icons/default.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.