Glam is a web-based graphing calculator for complex numbers and functions. It prioritizes speed and ease of use, which means that it should be accessible to any mathematics student without coding experience.
The core module is built using cmake
with an emscripten
toolchain, and the UI module is built using npm
and
typescript
. The process has been tested on 64-bit Linux and will likely need to be modified if you use Windows.
emscripten
- most easily installed using the emsdk tool. Follow the instructions to install the latest toolchain.binaryen
is included as a git submodule, so make sure to update withgit submodule update --init
before continuing.- Make sure the following environment variables are set:
# for an example install directory
# most of these should be set using the script in the emsdk folder.
EMSDK=/home/user/emsdk
EM_CONFIG=/home/user/emsdk/.emscripten
EMSDK_NODE=/home/user/emsdk/node/14.15.5_64bit/bin/node
BINARYEN_ROOT=/home/user/emsdk/binaryen/main_64bit_binaryen
mathquill
is also included as a git submodule. After updating submodules, use thebuildMathquill.sh
script to compile it.
The core module has several dependencies that must be built locally.
- Navigate to
core/
and make a build directory (mkdir build
), cd ./build && emcmake cmake ..
- Build
mpc
and its dependencies:
cmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake --build . --target mpc -- -j N # where `N` is the number of cores to use.
- Build
binaryen
:cd local/src/binaryen # a git submodule emcmake cmake -DBUILD_STATIC_LIB=ON emmake make -j N # same thing, N is the number of cores. # this command might fail - it's okay as long as it succeeds building libbinaryen.a.
cd build/
emmake make glamcore -j N
make install
(copies the compiled wasm into the source tree for the UI module)
- Navigate to the
ui
directory - Configure the project. I use
yarn
, so runningyarn
in this directory suffices.
To run a local development server, run yarn start
. To make a production build,
use yarn build
.
An older version of Glam bundled the asciimath2tex
library, created by Christian Lawson-Perfect,
available here. It is licensed under
the Apache License 2.0.