Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geometryzen/eigenmathts

A port of eigenmath to TypeScript and EcmaScript modules
https://github.com/geometryzen/eigenmathts

Last synced: 9 days ago
JSON representation

A port of eigenmath to TypeScript and EcmaScript modules

Awesome Lists containing this project

README

        

# eigenmathts

Eigenmath in TypeScript with EcmaScript modules

[![version](https://img.shields.io/npm/v/@geometryzen/eigenmathts.svg)](https://www.npmjs.com/package/@geometryzen/eigenmathts)

[![npm downloads](https://img.shields.io/npm/dm/@geometryzen/eigenmathts.svg)](https://npm-stat.com/charts.html?package=@geometryzen/eigenmathts&from=2022-09-01)

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)

`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](https://www.stemcstudio.com/gists/aa8013930a6319728967b566c38b1eb3) to try)

```html







Run

```

```typescript
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 { }
```