@geometryzen/eigenmathts
TypeScript icon, indicating that this package has built-in type declarations

0.9.43 • Public • Published

eigenmathts

Eigenmath in TypeScript with EcmaScript modules

version

npm downloads

GitHub license

PRs Welcome

eigenmathts is a Javascript program for evaluating Eigenmath scripts in a browser.

Scripts are read from document.getElementById("stdin").value

Results are written to document.getElementById("stdout").innerHTML

For a STEMCstudio example (click here to try)

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <base href="/">
    <title></title>
    <!-- link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-css-reset/dist/reset.min.css" /-->
    <link rel="stylesheet" href="style.css">
</head>

<body>

    <textarea id="stdin" rows="24" cols="80" style="font-family:courier;font-size:1em" spellcheck="false"></textarea>

    <button id="btn-run">Run</button><br>

    <div id="stdout"></div>
</body>

</html>
import { run } from '@geometryzen/eigenmathts'

const stdin = document.getElementById("stdin") as HTMLTextAreaElement

stdin.value = [
    `f=sin(x)/x`,
    `f`,
    `yrange=(-1,1)`,
    `draw(f,x)`
].join('\n').trim()

const btnRun = document.getElementById("btn-run") as HTMLElement

btnRun.onclick = run

window.onunload = function() {
    // Write your application cleanup code here.
}

// Used to ensure that this file is treated as a module.
export { }

Readme

Keywords

Package Sidebar

Install

npm i @geometryzen/eigenmathts

Weekly Downloads

2

Version

0.9.43

License

MIT

Unpacked Size

737 kB

Total Files

8

Last publish

Collaborators

  • geometryzen