forked from minivan/matematica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
82 lines (57 loc) · 1.8 KB
/
test.html
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
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link href="css/graph-plot.css" rel="stylesheet" type="text/css" />
<!-- Latest compiled and minified JavaScript -->
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/d3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/graphPlotter.js"></script>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="https://wzrd.in/standalone/function-plot@1.3.0"></script>
</head>
<body>
<div>
<div id="plot"></div>
<div>
<div>
</div>
</div>
</div>
<input type="text" id="textbox"/>
<button onclick="drawFunctions();"> Hello </button>
<script type="text/javascript">
var expression = "";
var data = [];
var function_number = 0;
function getExpression() {
expression = document.getElementById("textbox").value;
function_number++;
data.push({ "title": function_number, "fn": expression});
}
function drawFunctions() {
getExpression();
$(document.getElementById("plot")).ready(function () {
var instance = functionPlot({
tip: {
xLine: true,
yLine: true
},
target: '#plot',
title: 'Plotting',
xLabel: 'x',
yLabel: 'y',
data: data
});
});
}
</script>
</body>
</html>