b3by / atom-math Goto Github PK
View Code? Open in Web Editor NEWAtom package for evaluating simple mathematical expressions using Math.js
License: MIT License
Atom package for evaluating simple mathematical expressions using Math.js
License: MIT License
It could be good to get a droppable input view where commands can be inserted, to be used when it's not desired to insert text in the current buffer.
An icon could be added to the status bar.
It might be nice to wrap console.log to return output messages instead of just returning the result only. As I recall, it's a little awkward since the way in which console
interacts with arguments
isn't fully covered by standards so it takes some care to do properly. Otherwise perhaps there's another way to intercept and forward these messages to the output.
As note, integration support could be achieved with external packages such as this one, using the same interface.
f(x) = cos(1/x) * x
> saved
integrate(f, 0, 1, 0.01)
...
Some inner commands should be specified, so that internal logic could be added to the package. An example is the command to print a list of all defined functions.
f(x) = x + 1
> saved
g(x) = x + 2
> saved
1 + 2
> 3
/printFunctions
> f(x) = x + 1
> g(x) = x + 2
It could be nice to have a way of loading a full buffer into the atom-math
history, so commands and functions could be permanently saved as files.
Next big improvement to the package would be function evaluation in an easy, user-friendly fashion.
My approach would go for declaring a function and then evaluate it according to the passed values, such as:
f(x) = x + 3
> f(x) saved
compute(f, 39)
> f(39) = 42
Maybe, a query on the available functions could also be possible, like:
...
symbols
> f(x) // f(y) // g(z)
Command history should be available with some hotkey in the text editor. Early development stage takes ctrl-up
and ctrl-down
to navigate through the history. Full history should be available when typing history
in the buffer?
When a core command has to be evaluated, it generates wrong syntax if there are white spaces on the left.
1 + 2
> 3
/help
> wrong syntax
Commands should be trimmed before evaluation.
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.