-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph.php
96 lines (75 loc) · 4.28 KB
/
graph.php
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<title>Arduino Graphic</title>
<meta charset='UTF-8'>
<script src='js/utils.js'></script>
<script src='js/graph.js'></script>
<script src='js/colors.js'></script>
<script src='js/statistics.js'></script>
<script src='js/graph-controls.js'></script>
<script src='js/graph-process.js'></script>
<script src='js/class/SVGData.js'></script>
<script src='js/class/Statistics.js'></script>
<link rel='stylesheet' href='css/style.css' type='text/css'/>
<link rel='stylesheet' href='css/styleGraph.css' type='text/css'/>
</head>
<body>
<div id='graph'>
</div>
<div id='conf-graph'>
<p id='pointStatus'>PROPERTIES: </p>
<form>
<fieldset id='graphControls'>
<legend>Graph Auto Controls</legend>
<p>Offset X: <input type='range' id='oX' value=0 onchange='refresh_graph()'/><input type='number' readonly id='oX_value'/></p>
<p>Offset Y: <input type='range' id='oY' value=0 onchange='refresh_graph()'/><input type='number' readonly id='oY_value'/></p>
<p>Amplitude: <input type='number' id='amplitude' value=100 onchange='refresh_graph()'/></p>
<p>Lateral Amplitude: <input type='number' id='lateralAmplitude' value=100 onchange='refresh_graph()'/>
<input type="button" id="autoAmplitude" value="Auto Calculate Value" onclick="set_lateral_amplitude()"/>
</p>
<label for='horizontalLine'>Horizontal Lines <input type='checkbox' id='horizontalLine' onchange='refresh_graph()'/></label>
<label for='verticalLine'>Vertical Lines <input type='checkbox' id='verticalLine' onchange='refresh_graph()'/></label>
<p>xSpace: <input type='number' id='xSpace' value=2.5 onchange='refresh_graph()'/> </p>
<p>ySpace: <input type='number' id='ySpace' value=10 onchange='refresh_graph()'/> </p>
</fieldset>
<fieldset id='graphPersonalControls'>
<legend>Graph Personal Controls</legend>
<label for='manualOffset'>Manual Offset <input type='checkbox' id='manualOffset' onchange='refresh_graph()'/></label>
<p>Offset X: <input type='number' id='oX_manual' value=0 onchange='refresh_graph()'/></p>
<p>Offset Y: <input type='number' id='oY_manual' value=0 onchange='refresh_graph()'/></p>
</fieldset>
<fieldset id='dataStat'>
<legend>Statistics</legend>
<p id='statReport'></p>
<p id='graphStatus'></p>
</fieldset>
<fieldset id='pointsControl'>
<legend>Point Controls</legend>
<p>point_size: <input type='number' id='point_size' value=5 onchange='set_data_svg()'/></p>
<label for='noConnection' class='connection'>No-connection <input type='radio' id='noConnection' name='connectionLine' checked onclick='connectPoints()'/></label>
<label for='linearConnection' class='connection'>Linear connection <input type='radio' id='linearConnection' name='connectionLine' onclick='connectPoints()'/></label>
<!--<label for='bezierConnection' class='connection'>Bézier connection <input type='radio' id='bezierConnection' name='connectionLine' onclick='connectPoints()'/></label -->
<p>labelX <input type='text' id='label_x' value='xAxis' onchange='xAxisLabel()'/></p>
<p>labelY <input type='text' id='label_y' value='yAxis' onchange='refresh_graph()'/></p>
<label for='hLabels'>Show Horizontal Labels <input type='checkbox' id='hLabels' onchange='setLabels()'/></label>
<label for='vLabels'>Show Vertical Labels <input type='checkbox' id='vLabels' onchange='setLabels()'/></label>
</fieldset>
</form>
</div>
<?php
// starts session use
session_start();
// creates the script tag with DOM SVG
echo "
\n\t<script>" .
$_SESSION['svgGraph'];
echo "\n\tdata_points = [];";
for($i=0; $i< $_SESSION['sample']; $i++){
echo "\n\n\tdata_points[$i] = " .
$_SESSION['dataGraph'][$i];
}
echo "\n\t</script>\n";
?>
</body>
</html>