Coder Social home page Coder Social logo

bbodi / notecalc3 Goto Github PK

View Code? Open in Web Editor NEW
1.1K 17.0 42.0 7.5 MB

NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.

Home Page: https://bbodi.github.io/notecalc3/

License: GNU Affero General Public License v3.0

Rust 93.63% HTML 4.71% JavaScript 1.61% Batchfile 0.02% CSS 0.01% Dockerfile 0.02%
calculator rust wasm webassembly note-taking notes math linear-algebra matrix

notecalc3's Introduction

logo

Example GIF

What is NoteCalc?

NoteCalc is a handy notepad with a smart builtin calculator.

Honestly, it just tries to be a free Soulver alternative in your browser.

Features

Try out

Roadmap

  • User-defined functions (0.4.0)
  • Conditionals & comparisons (0.4.0)
  • Configurations (decimal point, font size etc) (0.4.0)
  • Embeddable expressions
  • Error messages
  • Autocompletion
  • Currencies
  • Arbitrary large calculation
  • Laptimes
  • Timestamps
  • Financial functions
  • Line wrapping
  • Time zone math
  • Embeddable NoteCalc
  • Better result outputs (scientific notation, SI suffixes etc)
  • Search
  • Specifiers (e.g. xy as number)

Run locally

First, you will need to make sure that the following tools are installed:

  1. rustup. Instructions here
  2. npm. Instructions here
  3. wasm-pack. Instructions here
  4. serve. Simply run:
    npm install -g serve

Once the above tools are installed, you can run:

git clone https://github.com/bbodi/notecalc3.git
./compile_and_run.bat

Then, open your browser and go to http://localhost:5000/notecalc.

Run using docker

You can also run using a container with this command:

git clone https://github.com/bbodi/notecalc3.git
cd notecalc3
docker build . --tag notecalc3
docker run --rm -d -p 5000:5000 notecalc3

Then, open your browser and go to http://localhost:5000/notecalc.

Libraries used

Huge thanks for the following libraries

notecalc3's People

Contributors

balazsbodi avatar bbb651 avatar bbodi avatar gtsiam avatar squiter avatar vringar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notecalc3's Issues

Ability to rename tabs

Tabs seem to always be named "Note 1", "Note 2", etc.

Is there a way to do this already? Can't find it at the moment.

DOM-based frontend

See #6 (comment) for reasoning on why the current implementation is canvas based.

I get that motivation, but I think for this to be a great UI it needs to be using "native" text input, as provided by the browser / whatever platform the client is implemented in. Things that currently don't work because of this:

  1. Any text selection on mobile
  2. Double tap to select word on desktop
  3. Smooth scrolling (instead of row-based scrolling like a spreadsheet), native scrolling speed (instead of constant)
  4. Go to end of line, end of word via OS-standard keyboard shortcuts (on a mac cmd/alt arrow)
  5. Select all via keyboard shortcut (mac OS)
  6. Undo/redo (mac OS)

A lot of these things are handled already by CodeMirror / Monaco / Ace. I'd be curious whether you looked into any of these, or decided early that you didn't want to wrestle with their APIs.

Regardless kudos for this awesome project!

Conditionals and comparisons

cost = 500
discount = true
cost = if discount then cost - 10% else cost
cost = if discount then cost - 10% 
cost = cost - 10% if discount

(if discount then 5% else 2%) + 3%

earnings = $45k                             | $45,000.00
tax = if earnings > $30k then 20% else 5%
My tax paid: earnings * tax                 | $9,000.00

Feature-request: data synchronization

Hi - I would be happy if I could save certain data somewhere like a google drive, dropbox or through protocols such as: remote storage, ftp or webdav if that's possible. Would it be possible to have a way to synchronize my data in notecalc3?

If anyone can answer, I look forward to hearing from you.

Same units out as in

When I type something like... 15k / 2 it would be nice if I could see the same units out such as 7.5k in the output window.

I tend to work in large numbers so all the numbers I get out have a lot of trailing zeros.

Currency support (€, USD…)

Thanks for this handy tool.

It would be great to support other currencies than Dollar.

meal cost = 12€
person = 4

total = person * meal cost

Here is an example of possible content to support.
There could be a generic support for currency codes (EUR, USD…) or symbols (, $…).
A next step could be currency conversion, but it might be much harder.

I don't feel experimented enough with Rust and the codebase to try implementing it, but I could give it a try if someone points me in the right direction.

Arrow keys don't work in Edge Bar

In Edge, turn on the Edge Bar (Settings > Edge Bar > Open Edge Bar). Add NoteCalc's URL to the bar. NoteCalc opens the first tab and renders it well and usefully. However, arrow keys simply don't work, either to move around within the current calculation line or to move to another line for including as a reference.

Is there a Mod function?

Trying to do Modulus(%)
228%4
and it isn't working. Neither is:
mod(228,4)

Is Modulus supported? What's the syntax for it?

Sum reset not resetting

Hello,

Love the project. While looking at the homepage, I saw that sum could be reset with --:

Values are automatically accumulated in the sum variable.
It can be reset and set to zero by starting a line with double dash (--). 

In practice, it doesn't seem like sum is resetting like I would expect. Am I missing something or is this not working?

image

Native desktop client

Awesome tool! I could see myself using this, to replace my boring SublimeText as a notepad.

Have you thought about integrating into an webview app like electron (but lighter ofc), if so, that would become even more handy.

Good idea and good job.

[Feature] Dark theme support

This is a pretty basic and simple to add feature that would make the application way more usable for a lot of people.
Should be pretty easy to add using a @media tag with prefers-color-scheme: dark, or even using css variables and a way to import themes from some format by adding a style attribute to set the variables.

usability on mobile is limited

scrolling is not possible inside the notebook area and the column width is off. also cannot move the cursor with touch

-- not resetting sum

I may be doing something wrong, but starting the line with double dash does not reset the sum.

It is not even working in the Introduction/Features note, it displays Err.

macOS Monterey Version 12.5.1 (21G83)
Safari Version 15.6.1 (17613.3.9.1.16)

Screenshot 2022-09-05 at 19 52 26

Feature request: keyed lists

While it's possible to store collections of data in matrices, it would be nice if we could store collections into maps with keys. This allows for convenient aggregate operations:

item counts = [a: 1, b: 2, c: 3, d: 4]
weight per item = 10g

item weights = item counts * weight per item
item weights.d == 40g

Vimium does not recognize text input

Probably related to #14: Vimium extension (https://vimium.github.io/) does not recognize the website as having text input, which means it steals all keyboard events.

This is easy to rectify (enter insert mode or add NoteCalc to exclusions) but I imagine that the same mechanism might break other extensions.

Is this project discontinued / unmaintained?

I saw that this project seems to have not received much attention for the last 2 years, which is a shame, cause it looks very promising.

Is this project officially discontinued or is someone planning to get back to development whenever they are ready?

Thanks a lot!

Support keyboard shortcuts

Currently (on macOS and Firefox), there seems to be no support for keyboard shortcuts. I would love to see support for copy, paste, and undo/redo, and a bonus for more advanced features like ctl+a and ctrl +e for start/end of line like Emacs/VSCode and other editors.

If you are open to helping me get started with the codebase, I would be willing to take a crack at it and try and open a PR, let me know.

Vim plugin

Just pitching this as an idea.
Might be nice to integrate it as a vim plugin.

Laptimes

03:04:05 + 01:02:03                    | 04:06:08
00:12:05 − 00:04:09                    | 00:07:56

$dollar amounts are not recognized

Just tried out the app, looks great!

Biggest piece of feedback is needing to write 1000$, not $1000, which is way more natural. Super confused me and I had to go back to the readme to learn about it.

(Also, minor thing - there's a big horizontal scrollbar at the bottom)

Specifiers

$100 as number                                        | 100
40/day as number                                      | 40
20% as number                                         | 0.2

Google Drive integration for storage and sync

Hello!

I use CalcNote (basically, a mobile version of notecalc), which supports saving your notes to Google Drive.

I'd love for there to be a cross-platform way to work on these types of notes, e.g. so that I can start them on my computer then bring them with me to the workshop on my phone.

It seems like CalcNote's file structure is compatible with yours (example below), what would you think about enabling users to log in with Google OAuth and read / write their files to a directory in Google Drive?

# turlough hill
turloughmwh = 6 * 300 
irelandmwh = 40 * $2
irelandpop = 5000000
irelandmwhcapita = irelandmwh / irelandpop
globalpop = 8000000000
globalmwh = globalpop * irelandmwhcapita

Migrate to 0.4

The new release 0.4 looks fantastic. What's the best way to bring my existing notes into this version?

Feature request: rounding

Hi - I would love a rounding feature, which specifies the number of decimals to keep.

I know there's a lot of rounding strategies, especially for money, but simple rounding would be a great start.

Thanks!

Cannot type ^ character

With Slovenian keyboard layout on Linux, I cannot type ^ character into Notecalc.

When I press the AltGr + 3 twice (which produces ^ in every other text entry field), nothing happens with NoteCalc. This is especially annoying because I cannot use exponentiation (for example 2^3 to calculate 2³).

High-DPI rendering is blurry

As the title says, opening the app on a high-dpi monitor (mine is 3840x2160), causes the app to appear blurry.

Unable to clone & run locally

Summary

  1. Need wasm-pack and serve binaries
  2. #![feature] may not be used on the stable release channel
  3. When running, it seems to launch the notecalc home page instead of the calculator itself

1. Resolving wasm-pack and serve binaries missing

Screenshots

Without wasm-pack
With wasm-pack, without serve

Update README

# 1. clone repo
git clone https://github.com/bbodi/notecalc3.git

# 2. install global binaries required for compile_and_run
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

# 3. compile and run
cd ../
./compile_and_run.bat

Update compile_and_run.bat

Use npx for serve to avoid global install

From...

cd frontend-web
wasm-pack build --debug --target no-modules
cd ..
serve .
To...

cd frontend-web
wasm-pack build --debug --target no-modules
cd ..
npx serve .
```

2. Stable release channel

Screenshots

Stable release channel error
Re-running rustup

Questions

This is obviously not a new issue rust-lang/rust#37877

Despite re-running rustup, there's still an issue. I'm a rust novice and I'm confident this is an issue with my system, not notecalc.

Is there a rust RC (eg. like a nightly release) that I need to be using?


3. Showing website instead of calculator

Screenshots

Serve working (expected)
Notecalc home page showing (unexpected)
Calculator I expected to see when accessing localhost:5000

Expected

I would open localhost:5000 and see an error

Actual

Surprisingly, I was able to access localhost:5000 despite the compilation errors. However, the site is showing notecalc3's website instead of the calculator.

Multiple Licenses support

Now the license of notecalc3 is AGPL-V3, which is not friendly for me want to integrate notecalc3 into my commercial project as an extra practical feature. Could you please consider support multiple licenses? I mean, I'd love to pay for this awesome project. If you have no plan to earn profits from it, MIT license maybe more friendly.

License unfavourable

The AGPL license is not favourable for widespread usage whether commercially or with a lot of other open source licences. Would you consider replacing the current license with something like Apache-2.0?

Library to allow developing alternate UI

It would be really neat if this could expose a library to allow the functionality to be surfaced in another UI - I'm imagining a terminal version, a Vim plugin, etc.

Timestamps

3 hours 5 minutes 10 seconds             | 3 hours 5 minutes 10 seconds
3h 5m 10s                                | 3 hours 5 minutes 10 seconds

3h 5m 10s in seconds                     | 11,110 s 

Units dropped in calculation

First of all, super cool tool; I can see myself using this a lot.

In the following calculation the last result has no unit, when it should have the unit mol:

halflife = 1.5 years
decayconst = ln(2)/halflife
n0 = 1 mol
n0*e^(decayconst*(100 years))

Some problematic audits results + PWA support

I've ran a test using lighthouse in Chrome 87 (on a Windows 10 Pro 19041) and got the following results:
Summary
Summary
Full Results
Results.zip

Some notable things are missing a lot of SEO tags, accessibility is not great due to using one canvas instead of elements a screen reader can read but there's no real way to solve that, and PWA is missing (I think it can be really useful, as it would make it function similarly to a native app, with almost every browser supporting it on mobile and chrome supporting it on desktop).

I might make a pull request trying to solve some of these things.

Option to disable flashy highlights

I want to be able to disable the pulsing highlight effect as it just distracts me. It would be awesome to get a static highlight instead. If I want it to flash, then I can use the arrows keys for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.