Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculator #116

Open
3 of 8 tasks
sancarn opened this issue May 11, 2021 · 4 comments · Fixed by #163
Open
3 of 8 tasks

Calculator #116

sancarn opened this issue May 11, 2021 · 4 comments · Fixed by #163
Labels
applet related to an applet enhancement New feature or request megathread

Comments

@sancarn
Copy link
Contributor

sancarn commented May 11, 2021

Update 2021-07-13: Tar is now working on a final version of calculator which will be significantly more customisable than my existing attempt. It will include:

  • Custom syntax tokenisation, parsing, symantics
  • AST analysis and modification.
  • Include a units parser and evaluator, see units of measurement.
    • Will allow for unit conversion
  • Offers simple graph correction in the form of LM suggestions, as described below.

This is currently being done as a seperate project unitary Math parser as we believe this will be useful for others also.


The calculator applet would attempt to provide a search menu for all things Math.

  • Math parser has a fully customisable feature set
  • Suggested query fixes
  • Evaluation of graph to a result (including units)
  • LM Wrapper
  • Store calculations as custom variables
  • Derivatives/integrals Capability shown to exist under current framework, doesn't fit the scope currently. Feel free to make an applet!
  • Plotting
  • Wolfram alpha

Detail

Simple evaluator

As an MVP, it could just provide answers for simple calculations such as

5 + 9 * sin(3.4)

When such a query is entered, a menu item with the result could appear in the menu.

Note: We may consider using power fx if a JavaScript evaluator is available.

Research and implement built-in functions

We should also look into creating a list of inbuilt functions which will be offered.

For a list of functions which we may like to add we could look at spreadsheet formula engines?

Note: A list of possibly useful functions can be found here

Search pattern

A search pattern is really up to the user but I would anticipate using something like /^=/ would be an ideal search pattern because:

  1. Spreadsheet users will be used to this from formula
  2. Feel calculator will be frequently used so 1 char prefix is maybe useful

ANS Shortcut

A keyboard shortcut to execute the same functionality as the ANS key on a calculator does (evaluate and replace search text with the result)

Suggested query fixes

LM currently has fuzzy search mechanisms to find errors in typed text. It would be cool if LM also suggested potential fixes in the listed menu items. E.G. If the typed text was 1+2+3)/120 LM would suggest:

(1+2+3)/120
1+(2+3)/120
1+2+3/120

As a long term apple spotlight user myself I can say that this is at least extremely common.

Plotting

It could provide simple plotting capabilities, for formulas involving 1 variable such as x + 9 * sin(x) in which case we also have to consider how the plot result will be nevigated (translation + zoom)

This idea could even be taken a step further by making an environment simular to the one found in desmos. This would obviously be a large undertaking however. When making such an advanced system you would probably also want to be able to save the environment and such.

There are open source web projects that exist already which have functionality similar to desmos.

Derivatives/integrals

The calculator may provide some way of calculating derivatives and integrals including their derivation steps, similar to derivative-calculator.net and integral-calculator.net.

Wolfram alpha

Depending on available apis, it would be amazing if a service similar to wolfram alpha could provide some advanced analytical data that wouldn't be feasible for us to implement in javascript.

@sancarn sancarn added enhancement New feature or request applet related to an applet labels May 11, 2021
@sancarn sancarn changed the title Calculator Megathread Calculator Jun 23, 2021
@sancarn
Copy link
Contributor Author

sancarn commented Jun 28, 2021

Work in progress at https://github.com/sancarn/launchmenu-calculator

@TarVK TarVK linked a pull request Aug 18, 2021 that will close this issue
@TarVK
Copy link
Member

TarVK commented Aug 18, 2021

Imo focus should be different than is currently described in the main post. The calculator applet would be a simple applet mostly oriented towards common usecases that non-engineers may have.

And a separate "scientific-calculator" applet or something along those lines could be made to provide plotting, and all other advanced features.

@sancarn
Copy link
Contributor Author

sancarn commented Aug 18, 2021

And a separate "scientific-calculator" applet or something along those lines could be made to provide plotting, and all other advanced features.

In my view it depends on ease of integration. If a plotter were easy to integrate I wouldn't be opposed to someone adding it in some capacity to the applet (Can always have a basic/advanced mode for calculator in settings anyway). If however it's going to be a nightmare and/or be a messy addition, I'd rather it separate.

@sancarn
Copy link
Contributor Author

sancarn commented Sep 6, 2021

Reopening as although simple applet is implemented full scope of issue isn't addressed. Although there is debate that full scope in issue should be included or not in the simple calculator

@sancarn sancarn reopened this Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
applet related to an applet enhancement New feature or request megathread
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants