Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bobkerns/physics-math-parser
Parser for the Spherical Cow project.
https://github.com/bobkerns/physics-math-parser
calculus javascript math observablehq physics quaternions vectors
Last synced: 26 days ago
JSON representation
Parser for the Spherical Cow project.
- Host: GitHub
- URL: https://github.com/bobkerns/physics-math-parser
- Owner: BobKerns
- License: mit
- Created: 2020-08-13T12:13:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T13:37:00.000Z (about 2 years ago)
- Last Synced: 2024-11-18T15:45:04.341Z (3 months ago)
- Topics: calculus, javascript, math, observablehq, physics, quaternions, vectors
- Language: TypeScript
- Homepage:
- Size: 539 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Project physics-math-parser
Parser for math expressions. Part of the Newton's Spherical Cow physics project.To make it load in [ObservableHQ](https://observablehq.com), we must first load the `antlr4ts` runtime like this:
~~~js
antlr4ts = {
const baseURL = `https://bundle.run/[email protected]`;
const antlr4ts = await require(`${baseURL}`);
antlr4ts.atn = await require(`${baseURL}/atn/index.js`);
antlr4ts.misc = await require(`${baseURL}/misc/index.js`);
antlr4ts.tree = await require(`${baseURL}/tree/index.js`);
window.antlr4ts = antlr4ts;
return antlr4ts;
}
~~~
and then explicitly reference to ensure it is loaded first, like this:
~~~js
M = antlr4ts && require(`http://localhost:5000/lib/umd/index.js}`)
~~~