A basic example of embedding a Desmos calculator using their API.
Last active
October 18, 2015 01:23
-
-
Save ctlusto/86b24d1d3d5e7ecd673d to your computer and use it in GitHub Desktop.
Basic Desmos Example
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
html, | |
body, | |
#calculator { | |
width: 100%; | |
height: 100%; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Basic Desmos Example</title> | |
<link rel="stylesheet" href="index.css"> | |
</head> | |
<body> | |
<div id="calculator"></div> | |
<script src="//www.desmos.com/api/v0.5/calculator.js?apiKey=dcb31709b452b1cf9dc26972add0fda6"></script> | |
<script src="index.js"></script> | |
</body> | |
</html> |
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
var elt = document.getElementById('calculator'); | |
var calc = Desmos.Calculator(elt); | |
calc.setExpressions([ | |
{ | |
id: 'parameter', | |
latex: 'a = 1' | |
}, | |
{ | |
id: 'parabola', | |
latex: 'y = ax^2', | |
color: Desmos.Colors.PURPLE | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment