-
Notifications
You must be signed in to change notification settings - Fork 0
/
termigraph.js
45 lines (33 loc) · 1.07 KB
/
termigraph.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import Router from './Router.js';
import clearWindow from './functions/clearWindow.js';
import hideCursor from './functions/hideCursor.js';
import ParseMath from './parsemath.js';
let params = {
width: process.stdout.columns,
height: process.stdout.rows,
pageStack: ['Welcome'],
version: {
name: "v0.1 Alpha α"
},
curves: ["", "", "", ""],
curveColours: ["red", "green", "yellow", "blue"],
selectedCurve: -1,
xStretch: 1,
yStretch: 1,
// the factor by which the scroll changes on each press in graph screen
stretchSensitivity: 2,
xTranslate: 0,
yTranslate: 0,
// the amount by which to translate on each key press
translateSensitivity: 5,
// stretch the x values by a certain amount to take into account the disparity between cell height and width
defaultXScaleFactor: 2.5,
// the resolution of plotting points, the lower the higher resolution but also longer plotting time; adapt in graph with "O" and "P" keys
resolution: 0.05,
}
hideCursor();
const updateParams = newParams => {
params = newParams;
Router(newParams, updateParams);
}
updateParams(params);