Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
77 lines (67 loc) · 2.38 KB

File metadata and controls

77 lines (67 loc) · 2.38 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!--
Copyright (c) 2006-2017, JGraph Ltd
Animation example for mxGraph. This example demonstrates using
SVG animations on edges to visualize the flow in a pipe.
-->
<html>
<head>
<title>Animation example for mxGraph</title>
<!-- Sets the basepath for the library if not in same directory -->
<script type="text/javascript">
mxBasePath = '../src';
</script>
<!-- Loads and initializes the library -->
<script type="text/javascript" src="../src/js/mxClient.js"></script>
<style type="text/css">
.flow {
stroke-dasharray: 8;
animation: dash 0.5s linear;
animation-iteration-count: infinite;
}
@keyframes dash {
to {
stroke-dashoffset: -16;
}
}
</style>
<!-- Example code -->
<script type="text/javascript">
function main(container)
{
var graph = new mxGraph(container);
graph.setEnabled(false);
var parent = graph.getDefaultParent();
var vertexStyle = 'shape=cylinder;strokeWidth=2;fillColor=#ffffff;strokeColor=black;' +
'gradientColor=#a0a0a0;fontColor=black;fontStyle=1;spacingTop=14;';
graph.getModel().beginUpdate();
try
{
var v1 = graph.insertVertex(parent, null, 'Pump', 20, 20, 60, 60,vertexStyle);
var v2 = graph.insertVertex(parent, null, 'Tank', 200, 150, 60, 60,vertexStyle);
var e1 = graph.insertEdge(parent, null, '', v1, v2,
'strokeWidth=3;endArrow=block;endSize=2;endFill=1;strokeColor=black;rounded=1;');
e1.geometry.points = [new mxPoint(230, 50)];
graph.orderCells(true, [e1]);
}
finally
{
// Updates the display
graph.getModel().endUpdate();
}
// Adds animation to edge shape and makes "pipe" visible
var state = graph.view.getState(e1);
state.shape.node.getElementsByTagName('path')[0].removeAttribute('visibility');
state.shape.node.getElementsByTagName('path')[0].setAttribute('stroke-width', '6');
state.shape.node.getElementsByTagName('path')[0].setAttribute('stroke', 'lightGray');
state.shape.node.getElementsByTagName('path')[1].setAttribute('class', 'flow');
};
</script>
</head>
<!-- Page passes the container for the graph to the program -->
<body onload="main(document.getElementById('graphContainer'))">
<!-- Creates a container for the graph with a grid wallpaper -->
<div id="graphContainer"
style="position:relative;overflow:hidden;width:321px;height:241px;background:url('editors/images/grid.gif');cursor:default;">
</div>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.