forked from jaegertracing/jaeger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README for plexus (jaegertracing#425)
README for plexus Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
- Loading branch information
Showing
14 changed files
with
1,167 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,74 @@ | ||
// Copyright (c) 2019 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import * as React from 'react'; | ||
import { render } from 'react-dom'; | ||
|
||
import { LayoutManager } from '../../src'; | ||
// TODO(joe): Update import after killing `DirectedGraph` | ||
import LayeredDigraph from '../../src/LayeredDigraph'; | ||
import { TVertex } from '../../src/types'; | ||
|
||
const vertices = [ | ||
{ key: 'web', name: 'web-app : login' }, | ||
{ key: 'users', name: 'user-store : get-user' }, | ||
{ key: 'cache', name: 'cache : get' }, | ||
{ key: 'db', name: 'db : get-user' }, | ||
{ key: 'auth', name: 'auth : login' }, | ||
]; | ||
|
||
// Edges must refer to the `key` field of vertices. | ||
const edges = [ | ||
{ from: 'web', to: 'users' }, | ||
{ from: 'web', to: 'auth' }, | ||
{ from: 'users', to: 'cache' }, | ||
{ from: 'users', to: 'db' }, | ||
]; | ||
|
||
const lm = new LayoutManager({ useDotEdges: true, rankdir: 'TB', ranksep: 1.1 }); | ||
|
||
const simpleGraph = ( | ||
<LayeredDigraph | ||
edges={edges} | ||
vertices={vertices} | ||
setOnGraph={{ | ||
style: { | ||
fontFamily: 'sans-serif', | ||
height: '100%', | ||
position: 'fixed', | ||
width: '100%', | ||
}, | ||
}} | ||
layoutManager={lm} | ||
measurableNodesKey="nodes" | ||
layers={[ | ||
{ | ||
key: 'edges', | ||
edges: true, | ||
layerType: 'svg', | ||
defs: [{ localId: 'edge-arrow' }], | ||
markerEndId: 'edge-arrow', | ||
}, | ||
{ | ||
key: 'nodes', | ||
layerType: 'html', | ||
measurable: true, | ||
renderNode: (vertex: TVertex) => vertex.name, | ||
setOnNode: { style: { padding: '1rem', whiteSpace: 'nowrap', background: '#e8e8e8' } }, | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
render(simpleGraph, document.querySelector('#root')); |
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,89 @@ | ||
// Copyright (c) 2019 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import * as React from 'react'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { render } from 'react-dom'; | ||
|
||
import { LayoutManager } from '../../src'; | ||
// TODO(joe): Update import after killing `DirectedGraph` | ||
import LayeredDigraph from '../../src/LayeredDigraph'; | ||
import { TVertex } from '../../src/types'; | ||
|
||
const vertices = [ | ||
{ key: 'web', name: 'web-app : login' }, | ||
{ key: 'users', name: 'user-store : get-user' }, | ||
{ key: 'cache', name: 'cache : get' }, | ||
{ key: 'db', name: 'db : get-user' }, | ||
{ key: 'auth', name: 'auth : login' }, | ||
]; | ||
|
||
// Edges must refer to the `key` field of vertices. | ||
const edges = [ | ||
{ from: 'web', to: 'users' }, | ||
{ from: 'web', to: 'auth' }, | ||
{ from: 'users', to: 'cache' }, | ||
{ from: 'users', to: 'db' }, | ||
]; | ||
|
||
const lm = new LayoutManager({ useDotEdges: true, rankdir: 'TB', ranksep: 1.1 }); | ||
|
||
const UxEdges = () => ( | ||
<LayeredDigraph | ||
edges={edges} | ||
vertices={vertices} | ||
setOnGraph={{ | ||
style: { | ||
fontFamily: 'sans-serif', | ||
height: '100%', | ||
position: 'fixed', | ||
width: '100%', | ||
}, | ||
}} | ||
layoutManager={lm} | ||
measurableNodesKey="nodes" | ||
layers={[ | ||
{ | ||
key: 'edges-layers', | ||
layerType: 'svg', | ||
defs: [{ localId: 'arrow-head' }], | ||
layers: [ | ||
{ | ||
key: 'edges', | ||
markerEndId: 'arrow-head', | ||
edges: true, | ||
}, | ||
{ | ||
key: 'edges-pointer-area', | ||
edges: true, | ||
setOnContainer: { style: { cursor: 'default', opacity: 0, strokeWidth: 4 } }, | ||
setOnEdge: layoutEdge => ({ | ||
onMouseOver: () => console.log('mouse over', layoutEdge), | ||
onMouseOut: () => console.log('mouse out', layoutEdge), | ||
}), | ||
}, | ||
], | ||
}, | ||
{ | ||
key: 'nodes', | ||
layerType: 'html', | ||
measurable: true, | ||
renderNode: (vertex: TVertex) => vertex.name, | ||
setOnNode: { style: { padding: '1rem', whiteSpace: 'nowrap', background: '#e8e8e8' } }, | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
render(<UxEdges />, document.querySelector('#root')); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.