CivilKit Calcs

Run Calcpad worksheets in your browser, offline

Calcpad is a calculator and report writer by Nedelcho Ganchovski (Proektsoft): you write equations with units and get a formatted document. Its authors offer an official online version on their own site, and that is the place to go for Calcpad itself. This page is about something else. CivilKit Calcs is an independent, open source derivative of CalcpadCE, the MIT licensed community edition, and it opens your .cpd worksheets in a browser tab and runs them there, with no server and, once it has loaded, no connection.

The worksheet language is the same. The calculation engine was rewritten in Rust and compiled to WebAssembly, so the arithmetic happens on your own computer. It is not affiliated with the Calcpad authors: their work is the foundation, and the credit and licence travel with the code.

Open Calcs Read the guide

Open a .cpd worksheet

Open the app and use File, then Open, drag a .cpd file onto the page, or paste the text into a new Calcpad tab. The page calculates it straight away. A worksheet like this one is ordinary Calcpad:

'Right triangle
a = 3m
b = 4m
c = sqrt(a^2 + b^2)

It gives 5 m for the hypotenuse, with the units carried through. Everything the language offers is meant to work: units, vectors and matrices, $Plot and $Map plots, macros, #if and #while blocks, includes, input fields and the large function library.

Video: Your first calculation (about 85 seconds). Read the chapter Your first sheet in five minutes.

Offline, and on your own computer

The first visit loads the app; after that a service worker keeps a copy, so the page opens and calculates with no network at all. You can install it from the browser as an app on a desktop or a phone. Worksheets are kept in the browser's own library or saved to your disk as ordinary .cpd text files, and nothing you calculate is sent anywhere. That makes it a practical way to read and check a colleague's worksheet on a machine where you cannot install software.

What was rebuilt, and what was kept

How close to CalcpadCE is it?

The Rust engine is tested against CalcpadCE's own test classes, transcribed to Rust, and against the expected-output files of its worksheets. Where it deliberately behaves differently, the difference is listed one by one with the test that pins it, in a file of deviations in the repository. One example: when an #if condition cannot be evaluated, the block is left unresolved with an error message, instead of silently running the #else branch.

Not supported: raster plots from the original's graphics library, the project and library path roots, and compiled .cpdz worksheets. The project is early, so if you depend on an unusual corner of the language, run your worksheet and compare the output before you switch.

Beyond the worksheet: sheets, imports and exports

On top of the Calcpad language there is a lighter way to write, called the sheet format: Markdown prose, name: expression -> unit | note lines and LaTeX. A sheet compiles to Calcpad and runs on the same engine, and you can always see the Calcpad it becomes with Show compiled. A ? in front of a value makes it an input, so a sheet becomes a fill-in template; the beam calculator is a worked one.

The same page can import worksheets from another calculation tool and export any worksheet to Word with real equations, to Excel with native charts, or to PDF.

Credit and licence

Calcpad was created by Nedelcho Ganchovski (Proektsoft); CalcpadCE is its MIT licensed continuation, at github.com/imartincei/CalcpadCE. CivilKit Calcs is MIT licensed too, and the upstream copyright notices are kept in the repository. If Calcpad is useful to you, look at the original project as well.

Questions

Is this the official Calcpad online version?

No. The Calcpad authors publish their own online version. This is an independent derivative of CalcpadCE, the MIT licensed community edition, with the engine rewritten in Rust. It is not made or endorsed by the Calcpad authors.

Do I have to install anything?

No. Open the page in a current browser. You can install it as an app from the browser if you want it on the desktop or a phone.

Can I open my existing .cpd files?

Yes, with File then Open or by pasting the text. Check the result against what you expect, because the engine is a port and a few behaviours are deliberately different. The deviations file lists them.

Does my worksheet leave my computer?

No. The engine runs in the page. There is no calculation server.

Does it work offline?

Yes, after a first visit. Plotly charts, which load a script from a CDN, need to have been loaded once while online.

Can it open compiled .cpdz files?

No. Compiled .cpdz worksheets are not supported. Open the .cpd source instead.

Open Calcs Read the guide