This repository has been archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
84 lines (68 loc) · 1.7 KB
/
index.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
83
84
<html>
<head>
<title></title>
<meta charset="utf-8">
<style>
</style>
</head>
<body>
<h1>Ultimate Stats Calculator Demo</h1>
<div id="calculator"></div>
<script src="https://www.desmos.com/api/v1.5/calculator.js?apiKey=dcb31709b452b1cf9dc26972add0fda6"></script>
<script>
(function () {
const calculators = {
"Weibull": "https://www.desmos.com/calculator/ux56x56sft"
}
const setCalculatorStateFromLink = async (calc, url) => {
requestJSON(url)
.then((endpoint) => {
// console.log(endpoint);
calc.setState(endpoint.state);
});
}
const requestJSON = async url => {
const myHeaders = new Headers();
myHeaders.append('Accept', 'application/json');
return fetch(url, {
method: 'GET',
headers: myHeaders,
})
.then(response => response.json())
.catch((error) => {
console.error(error);
})
}
var calculatorSettings = {
settingsMenu: false,
zoomButtons: false,
keypad: false,
expressionsTopbar: false,
border: false
};
var calculator = Desmos.GraphingCalculator(
document.getElementById('calculator'),
calculatorSettings
);
setCalculatorStateFromLink(calculator, calculators["Weibull"]);
function update() {
// calculator.setMathBounds({
// left: getRandMin()- padding,
// right: getRandMax()+ padding,
// bottom: -1,
// top: 1
// });
// let pointObj = {
// id: "range" + points.length,
// latex: getRandMin() + " <= x < " + getRandMax(),
// color: Desmos.Colors.BLUE
// };
// points.push(pointObj);
// Add an expression
// calculator.setExpression(pointObj);
}
update()
})();
</script>
</body>
</html>