unageek / graphest Goto Github PK
View Code? Open in Web Editor NEWA faithful graphing calculator
License: MIT License
A faithful graphing calculator
License: MIT License
cargo r --bin graph --release -- -s 1024 1024 -- "y = sin(exp(x))"
cargo r --bin graph --release -- -s 3072 3072 \
--pad-left 1 --pad-right 1 --pad-bottom 1 --pad-top 1 \
--dilate "1,1,1;1,1,1;1,1,1" \
-- "y = sin(exp(x))"
→ Crop each side of the image by 1px, and resize it by 1/3.
convert graph.png -shave 1x1 -filter triangle -resize 1024x1024 graph2.png
cargo r --bin graph --release -- -s 5120 5120 \
--pad-left 2 --pad-right 2 --pad-bottom 2 --pad-top 2 \
--dilate "0,1,1,1,0;1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;0,1,1,1,0" \
-- "y = sin(exp(x))"
→ Crop each side of the image by 2px, and resize it by 1/5.
convert graph.png -shave 2x2 -filter triangle -resize 1024x1024 graph2.png
cargo r --bin graph --release -- -s 7168 7168 \
--pad-left 3 --pad-right 3 --pad-bottom 3 --pad-top 3 \
--dilate "0,0,1,1,1,0,0;0,1,1,1,1,1,0;1,1,1,1,1,1,1;1,1,1,1,1,1,1;1,1,1,1,1,1,1;0,1,1,1,1,1,0;0,0,1,1,1,0,0" \
-- "y = sin(exp(x))"
→ Crop each side of the image by 3px, and resize it by 1/7.
convert graph.png -shave 3x3 -filter triangle -resize 1024x1024 graph2.png
cargo r --bin graph --release -- -s 9216 9216 \
--pad-left 4 --pad-right 4 --pad-bottom 4 --pad-top 4 \
--dilate "0,0,1,1,1,1,1,0,0;0,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,0;0,0,1,1,1,1,1,0,0" \
-- "y = sin(exp(x))"
→ Crop each side of the image by 4px, and resize it by 1/9.
convert graph.png -shave 4x4 -filter triangle -resize 1024x1024 graph2.png
The dilation kernels are obtained by Mathematica's DiskMatrix[1]
, DiskMatrix[2]
, etc.
For example, the parametric algorithm can complete graphing of x = π ∧ y = e
, while the explicit algorithm cannot.
Use ∨
instead of ||
.
A graph g (Image::<Ternary>
) and a kernel ker (Image::<bool>
).
The dilated graph g_out (Image::<Ternary>
).
This is awesome software, thanks!
I'm running on Ubuntu 20.04. I didn't realize there was a docs/build.md
, so I first built graph
via cargo build
, which worked fine; I used your instructions to install node etc. and run, and it all works. Maybe you could put a link to [edit: whoops, now I see there is a link!]docs/build.md
in your root README.md?
I was experimenting with the logical connectives, and I think something isn't quite right. This is fine:
but when I combine the two expressions with "&&" I get this:
If I logically invert the first condition I get this:
Am I missing something?
Step to reproduce:
Result:
The initial "y=sin(x)" does not plot.
Error message:
"Uncaught (in promise) Error" revealed in Dev Tools:
The error turns out to be at column 1996451 in bundle.js:
Alternative way of reproducing
Step to reproduce:
Result:
Plotting failed. Does not plot anything.
Error message:
Exception stack is revealed in Dev Tools:
The top of the stack turns out to be at column 1997727 in bundle.js:
Version:
1.3.3 for windows
Platform:
Windows 10 22H2
Dependabot couldn't find a Cargo.toml for this project.
Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /Cargo.toml
.
If this isn't a Rust project, or if it is a library, you may wish to disable updates for it from within Dependabot.
The following relation is plotted as two gray (incomplete) lines around y = ±π:
![]() |
y = atan2(-2^-1075, -1) |
NOTE: 2^-1075 is the half of the smallest positive subnormal number, so -2^-1075 is interpreted as an interval [-2^-1074, 0].
While this graph is incomplete, it should be able to complete plotting relations such as:
Actual | Expected | Relation |
---|---|---|
![]() |
![]() |
-1 < atan2(-2^-1075, -1) < 1 |
![]() |
![]() |
atan2(-2^-1075, -1) < -1 || 1 < atan2(-2^-1075, -1) |
But the current implementation cannot. This is because branch map is lost in DecSignSet
.
To address this issue, we should add BranchMap
per sign to DecSignSet
. However, this change will significantly increase the size of the struct:
size_of |
align_of |
|
---|---|---|
DecSignSet (current) |
2 | 1 |
DecSignSet (proposed) |
32 | 8 |
TupperIntervalSet |
112 | 16 |
TupperIntervalSet w/ smallvec/union enabled |
96 | 16 |
Congratulations on the 1.0.0 release!
I was wondering if the PNG output can have a transparent background. This can be very useful when showing the graphs against a color background (such as in a poster).
I have a feeling that this won’t be easy due to supersample anti-aliasing. Currently, it’s mixing the function’s color with white. But how would one go about mixing the function’s color with transparency? I have no idea…
In the current version (1bc8bb8), sqrt({[-1,-1]_def, [1,1]_def})
is evaluated to {[1,1]_def}
, which should instead be {[1,1]_trv}
. This is because the empty interval returned by sqrt([-1,-1]_def)
is discarded by TupperIntervalSet.insert()
.
cargo r "y<sqrt(floor(-x/100))"
Graphing y = x^(1/3)
does not take the real root for negative values of x.
Another example: graphing y = (-1)^x
does not plot two lines of pixels (due to the graph resolution not being infinite) at y = 1 and y = -1 as GrafEq does.
Perhaps there could be an option to toggle this behavior?
in low resolution it is correct
in high resolution
this is a famous problem because of spatial-aliasing
Hi. I am on a Windows machine, so I am not sure if this also happens to the MacOS build.
It appears that internet connection is required for the software to boot up.
Steps to reproduce:
graphest will spawn ~3 processes but no gui window is shown. The problem cannot be reproduced if internet connection is allowed once. Afterward everything just seems to work, even after an offline reinstall.
It also appears that graphest will keep sending network requests despite there is no apparent need to do so.
Are there any features that require internet connections?
Example:
cargo r --release -- "y = ((((((((((((((((((((((((x))))))))))))))))))))))))" --parse
Hello! I installed graphest and the graphs aren't showing up at all! I tried any function and they still don't show up. I don't know what the problem is. I'm on windows 11, and when i tried to install it it blocked it from installing. Am I missing a file? I also read the readme file and nothing about my problem was addressed
This seems to happen when both of the zoom levels from/to which the map is zoomed are ≥ 129.
Apparently, Leaflet has nothing to do with the condition. Maybe this is caused by Chromium.
npm start
builds the webpack + rust code properly but gives the error
cp: cannot stat 'target/release/{compose,concatenate,graph}': No such file or directory
ERROR: "build:rust" exited with 1.
After running npx electron .
, the UI works, but the backend doesn't, so no graphs appear in the viewport
npm run build; cp target/release/{compose,concatenate,graph} dist/ && npx electron .
Clean build after rm -rf
ing target
and dist
directories:
● ~/graphest$ npm run start
> [email protected] start
> cross-env-shell NODE_ENV=development npm run build && electron .
> [email protected] build
> npm-run-all build:*
> [email protected] build:app
> webpack
webpack compiled successfully
webpack compiled successfully
webpack compiled successfully
> [email protected] build:rust
> cargo build --release && mkdirp dist && rm -f dist/{compose,concatenate,graph} && cp target/release/{compose,concatenate,graph} dist/
Compiling autocfg v1.0.1
Compiling libc v0.2.101
Compiling memchr v2.4.1
// (more compiles omitted)
Compiling inari v0.15.0
Compiling graphest-fftw-sys v0.1.0 (/home/jared/graphest/rust/graphest-fftw-sys)
Compiling graphest-arb-sys v0.5.0 (/home/jared/graphest/rust/graphest-arb-sys)
Compiling graphest v1.2.1 (/home/jared/graphest/rust)
Finished release [optimized] target(s) in 1m 38s
cp: cannot stat 'target/release/{compose,concatenate,graph}': No such file or directory
ERROR: "build:rust" exited with 1.
● ~/graphest$ ls target/release/{compose,concatenate,graph}
target/release/compose target/release/concatenate target/release/graph
The webpack and UI works; I can run npx electron .
to get the full UI. But nothing shows on the plot; the backend doesn't work
APPIMAGE env is not defined, current application is not an AppImage
checkForUpdatesAndNotify called, downloadPromise is null
Error occurred in handler for 'request-relation': TypeError: Cannot read properties of undefined (reading 'match')
at /home/jared/graphest/dist/main.js:72181:45
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async node:electron/js2c/browser_init:189:563
Error occurred in handler for 'request-relation': TypeError: Cannot read properties of undefined (reading 'match')
at /home/jared/graphest/dist/main.js:72181:45
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async node:electron/js2c/browser_init:189:563
Changing the one line in package.json to
"build:rust": "cargo build --release && mkdirp dist && rm -f dist/{compose,concatenate,graph} && sleep 1 && cp target/release/{compose,concatenate,graph} dist/",
does not work
● ~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
● ~$ rustc --version
rustc 1.61.0 (fe5b13d68 2022-05-18)
● ~$ node --version
v16.15.1
● ~$ npm --version
8.11.0
I am going to build your project on Archlinux. But your docs only write Ubuntu, so I followed these steps:
sudo pacman -S curl git clang m4 gtk3 nss nodejs npm rust
git clone https://github.com/unageek/graphest.git
cd graphest
npm install
chmod -R a+x node_modules \\ [1]
npm start
and then I got:
(base) [firestar@Archlinux graphest]$ npm start
> [email protected] start
> cross-env-shell NODE_ENV=development npm run build && electron .
> [email protected] build
> npm-run-all build:*
> [email protected] build:app
> webpack
ERROR in ./node_modules/bignumber.js/bignumber.mjs 2602:35
Module parse failed: Unexpected token (2602:35)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| */
| P.toFraction = function (md) {
> var d, d0, d1, d2, e, exp, n, n
ERROR in /home/firestar/graphest/src/common/bignumber.ts
./src/common/bignumber.ts 1:26-40
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(1,27)
TS7016: Could not find a declaration file for module 'bignumber.js'. '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/bignumber.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'bignumber.js';`
ERROR in /home/firestar/graphest/src/common/bignumber.ts
./src/common/bignumber.ts 3:15-29
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(3,16)
TS2665: Invalid module name in augmentation. Module 'bignumber.js' resolves to an untyped module at '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js', which cannot be augmented.
ERROR in /home/firestar/graphest/src/main/main.ts
./src/main/main.ts 16:28-46
[tsl] ERROR in /home/firestar/graphest/src/main/main.ts(16,29)
TS7016: Could not find a declaration file for module 'electron-updater'. '/home/firestar/graphest/node_modules/electron-updater/out/main.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/electron-updater` if it exists or add a new declaration (.d.ts) file containing `declare module 'electron-updater';`
webpack compiled with 4 errors
ERROR in /home/firestar/graphest/src/common/bignumber.ts
1:26-40
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(1,27)
TS7016: Could not find a declaration file for module 'bignumber.js'. '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/bignumber.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'bignumber.js';`
ERROR in /home/firestar/graphest/src/common/bignumber.ts
3:15-29
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(3,16)
TS2665: Invalid module name in augmentation. Module 'bignumber.js' resolves to an untyped module at '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js', which cannot be augmented.
ERROR in /home/firestar/graphest/src/main/main.ts
16:28-46
[tsl] ERROR in /home/firestar/graphest/src/main/main.ts(16,29)
TS7016: Could not find a declaration file for module 'electron-updater'. '/home/firestar/graphest/node_modules/electron-updater/out/main.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/electron-updater` if it exists or add a new declaration (.d.ts) file containing `declare module 'electron-updater';`
webpack compiled with 3 errors
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 5:36-111
Module not found: Error: Can't resolve './files/noto-sans-cyrillic-ext-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 6:36-110
Module not found: Error: Can't resolve './files/noto-sans-cyrillic-ext-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 7:36-107
Module not found: Error: Can't resolve './files/noto-sans-cyrillic-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 9:36-109
Module not found: Error: Can't resolve './files/noto-sans-devanagari-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 10:36-108
Module not found: Error: Can't resolve './files/noto-sans-devanagari-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 11:36-108
Module not found: Error: Can't resolve './files/noto-sans-greek-ext-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 12:36-107
Module not found: Error: Can't resolve './files/noto-sans-greek-ext-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 13:36-104
Module not found: Error: Can't resolve './files/noto-sans-greek-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 14:36-103
Module not found: Error: Can't resolve './files/noto-sans-greek-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 15:37-110
Module not found: Error: Can't resolve './files/noto-sans-vietnamese-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 16:37-109
Module not found: Error: Can't resolve './files/noto-sans-vietnamese-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 17:37-109
Module not found: Error: Can't resolve './files/noto-sans-latin-ext-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 18:37-108
Module not found: Error: Can't resolve './files/noto-sans-latin-ext-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 19:37-105
Module not found: Error: Can't resolve './files/noto-sans-latin-400-normal.woff2' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/@fontsource/noto-sans/400.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@fontsource/noto-sans/400.css) 20:37-104
Module not found: Error: Can't resolve './files/noto-sans-latin-400-normal.woff' in '/home/firestar/graphest/node_modules/@fontsource/noto-sans'
ERROR in ./node_modules/bignumber.js/bignumber.mjs 2602:35
Module parse failed: Unexpected token (2602:35)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| */
| P.toFraction = function (md) {
> var d, d0, d1, d2, e, exp, n, n
ERROR in /home/firestar/graphest/src/common/bignumber.ts
./src/common/bignumber.ts 1:26-40
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(1,27)
TS7016: Could not find a declaration file for module 'bignumber.js'. '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/bignumber.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'bignumber.js';`
ERROR in /home/firestar/graphest/src/common/bignumber.ts
./src/common/bignumber.ts 3:15-29
[tsl] ERROR in /home/firestar/graphest/src/common/bignumber.ts(3,16)
TS2665: Invalid module name in augmentation. Module 'bignumber.js' resolves to an untyped module at '/home/firestar/graphest/node_modules/bignumber.js/bignumber.js', which cannot be augmented.
ERROR in /home/firestar/graphest/src/main/main.ts
16:28-46
[tsl] ERROR in /home/firestar/graphest/src/main/main.ts(16,29)
TS7016: Could not find a declaration file for module 'electron-updater'. '/home/firestar/graphest/node_modules/electron-updater/out/main.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/electron-updater` if it exists or add a new declaration (.d.ts) file containing `declare module 'electron-updater';`
webpack compiled with 19 errors
ERROR: "build:app" exited with 1.
[1] https://stackoverflow.com/questions/54831494/sh-1-cross-env-permission-denied-on-laravel-mix
x = f(t) && y = g(t) && P(t)
y = f(x) && P(x)
or x = f(y) && P(y)
block::MIN_K
smaller−
(U+2212) as an alias for -
∧
, ∨
, and ¬
as aliases for &&
, ||
, and !
, respectivelyx^y
to match exp(y ln(x))
.
(y ∈ ℤ ∧ x ≠ 0) ∨ (y ∈ ℤ ∧ y ≥ 1) ∨ (x ≥ 0 ∧ y > 0) ∨ x > 0
.x^^y
?0^0
and 0^^0
undefined for the best consistency.
^
(real) is a subset of ^
(complex) and ^^
.if
)if
(flattened arguments?):=
for definitionsReal
?
sin(π/2) = 1
, etc.)RelationInput
y = ⌊x⌋
may look worse than now when low-level supersampling is used. On the other hand, high-level supersampling cannot be incorporated in real-time rendering. So anti-aliasing involving resampling would be an option only for exporting graphs.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.