217 Commits

Author SHA1 Message Date
Jos de Jong
be2cf35ee1 chore: rename example code editor to code_editor and update its dependencies 2025-08-22 13:01:36 +02:00
Jos de Jong
2bb678460e docs: let the custom set method return the right map in the example custom_scope_objects.js and an internal tool (see #3490) 2025-06-11 09:34:27 +02:00
Jos de Jong
a1eec936fc
feat: export util functions for maps and improve documentation of scope (#3243)
* feat: export util functions `isMap`, `isPartitionedMap`, and `isObjectWrappingMap` and improve the documentation of `scope` (see #3150)

* chore: fix broken unit tests

* docs: refine the explanation about scopes
2024-08-01 10:57:23 +02:00
Jos de Jong
b6b76cd11e chore: update dependencies of the code editor example 2024-07-04 12:26:15 +02:00
Jos de Jong
0602198540 docs: fix example convert_fraction_to_bignumber.js by upgrading to typed-function@4.2.1 2024-06-05 11:04:24 +02:00
Jos de Jong
fb6d4d9eea fix: example advanced/custom_argument_parsing.js 2024-05-31 16:49:17 +02:00
Jos de Jong
ab3461d484
feat: implement support for bigint (#3207, #2737) 2024-05-31 12:43:09 +02:00
Jos de Jong
1f05a35d68
chore: convert CJS files to ESM (#3204) 2024-05-22 08:46:14 +02:00
Sukka
d5740c9ac9
chore: remove polyfill.io inside example (#3167)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-03-08 16:22:16 +01:00
Jos de Jong
83ae82aa21 fix: give the inputsDiv a white background (see #3151) 2024-03-06 10:19:27 +01:00
David Contreras
36611384da
feat: Interactive lorenz example (#3151)
* Interactive lorenz

* Separate Interactive Lorenz

* Cleanup

* Bigger graphs

* Full screen examples

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-03-06 10:16:49 +01:00
David Contreras
4475dacc5a
Fixed issue with long lines in Code Editor Example (#3130)
* broadcasting

* Simplified broadcasting

* Updated for broadcasting

* Changed to camel case

* Camel case and auto formating

* Added comments

* Skip if matrices have the same size

* Fixed issue with undefined variable

missing dot  in `A._size`

* Implemented broadcasting in all functions

* Added helper functions

* Added function to check for broadcasting rules

* Tests for broadcasted arithmetic

* Fixed issue with matrix the size of a vector

* Documented and updated broadcasting

* Included broadcast.test

* Included math to syntax when missing

* Add code editor example

* Vite mini project

* Initial example

* added alpine debounce

* Fixed display

* Added parser.clear

* Added mathjs-language

* Made module to get expressions

* Added custom events

* Issue with help formatting

* Simplified help format

* Restored package.json

* removed unneded icons

* Added readme file

* Fixed versions

* Commented getExpressions

* Documented main.js

* Fixed title

* Fixed alpine version

* Removed AlpineJS

* Added documentation and renamed variables for clarity

* Fixed naming errors

* Fixed issue with long lines

* Edge case where multiple expressions are on the same line not ending in ";"

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-01-19 09:27:41 +01:00
Jos de Jong
25fa2f72f5 chore: minor refinement in the code editor example 2024-01-17 10:57:12 +01:00
David Contreras
8abac840e7
CodeEditorExample (#3027)
* broadcasting

* Simplified broadcasting

* Updated for broadcasting

* Changed to camel case

* Camel case and auto formating

* Added comments

* Skip if matrices have the same size

* Fixed issue with undefined variable

missing dot  in `A._size`

* Implemented broadcasting in all functions

* Added helper functions

* Added function to check for broadcasting rules

* Tests for broadcasted arithmetic

* Fixed issue with matrix the size of a vector

* Documented and updated broadcasting

* Included broadcast.test

* Included math to syntax when missing

* Add code editor example

* Vite mini project

* Initial example

* added alpine debounce

* Fixed display

* Added parser.clear

* Added mathjs-language

* Made module to get expressions

* Added custom events

* Issue with help formatting

* Simplified help format

* Restored package.json

* removed unneded icons

* Added readme file

* Fixed versions

* Commented getExpressions

* Documented main.js

* Fixed title

* Fixed alpine version

* Removed AlpineJS

* Added documentation and renamed variables for clarity

* Fixed naming errors

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-01-17 10:52:25 +01:00
Vrushaket Chaudhari
8f8e506166
feat: implement subtractScalar (#3081, #2643)
* added subtractScaler

* added subtractScaler missing entries

* added test cases for 2 or more parameters, test for subtractScalar instead fo subtract

* replaced subtract with subtractScalar whereever possible

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-10-25 13:46:58 +02:00
Vincent Tam
4a26b068d8
docs: fix typo in p.set example in the documentation of matrices (#3080) 2023-10-16 12:50:50 +02:00
David Contreras
856b9489fa
Example for Lorenz attractor (#3018)
* broadcasting

* Simplified broadcasting

* Updated for broadcasting

* Changed to camel case

* Camel case and auto formating

* Added comments

* Skip if matrices have the same size

* Fixed issue with undefined variable

missing dot  in `A._size`

* Implemented broadcasting in all functions

* Added helper functions

* Added function to check for broadcasting rules

* Tests for broadcasted arithmetic

* Fixed issue with matrix the size of a vector

* Documented and updated broadcasting

* Included broadcast.test

* Included math to syntax when missing

* Lorenz attractor

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-08-30 11:46:04 +02:00
Jos de Jong
cb168f60d9 Fix #2876: use the number only implementation of mathjs in example custom_evaluate_using_factories.js 2023-01-13 15:33:40 +01:00
Jos de Jong
3799fa658e Fix #2873: the rocket_trajectory_optimization.html example being partly broken 2023-01-13 15:09:38 +01:00
Jos de Jong
cc20bacec1 Fix #2144: examples/advanced/custom_loading.js was broken 2022-08-18 14:41:14 +02:00
Jos de Jong
b18f4d4f54 Fix custom loading example (rename to .mjs), see #2447, #2144 2022-08-18 14:24:23 +02:00
Jos de Jong
f9b944acfe Fix #2613: describe matrix methods get and set in the docs and example 2022-07-04 09:51:09 +02:00
Akira Cai
8c5c5b03b6
Update expressions.js (#2366) 2021-12-22 08:25:01 +01:00
Jos de Jong
780bde7ed5 Extend example custom_datatype.js demoing it a bit more 2021-06-23 09:15:31 +02:00
Jos de Jong
69e395cd2f Extend example custom_datatype.js demoing it a bit more 2021-06-23 09:14:49 +02:00
jhugman
e80995d52d
Add support for scopes with get and set methods (#2166)
* Add support for scopes with get and set methods

* Fix build for node v12

* Fixup cli and parser tests

* Add tests for simplify and evaluate

* Add example for a custom scope object

* Function calls need child scopes

* Transitionary step: Separate Safe and Scope Property calls

* Renamed identifiers in FunctionNode

* Evaluate with ObjectScopeWrapper

* Simplify tests passing

* Assume all scopes are map-like. Except parser

* Remove isMapLike check in customs.*SafeProperty() methods

* Change MapLike to Map

* Move keywords from an Object to a Set

* Move ScopeProperty functions in to scope.js

* Removed deprecation warning

* Rename scope.js to map.js

* Rename ScopeProperty to MapProperty

* Add tests and docs for map.js

* Put back the micro-optimization of function calls

* Use Map in the parser

* Called scope methods directly in cli.js

* Coercing of scope into a Map is done in Node, not evaluate

* Move createSubScope to its own file

* Fixup following self-review

* Add scope docs

* Final self-review changes

* Address reviewer comments

* Remove MapProperty witness marks

* Converted broken benchmark possibly lost in a rebase

* Use bare map as scope in benchmark

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-05-16 13:33:01 +02:00
Josef Wittmann
eabaaf0048
Update rocket example (#2072)
* Update rocket example

- use values for moon ascent (was earth)
- refactor to use easier syntax
- extract functions for readability
- add comments explaining equations
- label chart axes

* Simulate Falcon 9 launch (with atmosphere)

* Add more charts to rocket example

* Track time in rocket example

* Update comments and extract chart options
2021-01-06 09:22:36 +01:00
Peter Krautzberger
02137e01c9
docs: update pretty print with MathJax (#2023)
Upgrades to MathJax v3 and adjusts to new APIs.
2020-11-09 13:23:18 +01:00
Jos de Jong
41c5e2fabe Merge branch 'develop' into v8
# Conflicts:
#	HISTORY.md
#	package-lock.json
#	package.json
#	src/expression/embeddedDocs/embeddedDocs.js
#	src/factoriesAny.js
#	src/function/special/erf.js
#	src/plain/number/probability.js
#	src/version.js
2020-11-02 11:59:12 +01:00
Jos de Jong
68c6a91801 Update devDependencies 2020-11-02 09:33:11 +01:00
Jos de Jong
99b738f3e6 Merge branch 'develop' into v8
# Conflicts:
#	AUTHORS
#	HISTORY.md
#	package-lock.json
#	package.json
#	src/expression/embeddedDocs/embeddedDocs.js
#	src/factoriesAny.js
#	src/function/arithmetic/ceil.js
#	src/function/arithmetic/fix.js
#	src/function/arithmetic/floor.js
#	test/unit-tests/function/arithmetic/ceil.test.js
2020-10-07 12:12:35 +02:00
Jos de Jong
d82fc392ac Simplify require url in math_worker example 2020-09-26 11:29:11 +02:00
Jos de Jong
91fa8ea5aa Fix require url in math_worker example 2020-09-26 11:28:25 +02:00
Jos de Jong
6f00715754
Specify import require paths (continuation of #1941) (#1962)
* Add `.js` extension to source file imports

* Specify package `exports` in `package.json`

Specify package type as `commonjs` (It's good to be specific)

* Move all compiled scripts into `lib` directory

Remove ./number.js (You can use the compiled ones in `./lib/*`)

Tell node that the `esm` directory is type `module` and enable tree shaking.

Remove unused files from packages `files` property

* Allow importing of package.json

* Make library ESM first

* - Fix merge conflicts
- Refactor `bundleAny` into `defaultInstance.js` and `browserBundle.cjs`
- Refactor unit tests to be able to run with plain nodejs (no transpiling)
- Fix browser examples

* Fix browser and browserstack tests

* Fix running unit tests on Node 10 (which has no support for modules)

* Fix node.js examples (those are still commonjs)

* Remove the need for `browserBundle.cjs`

* Generate minified bundle only

* [Security] Bump node-fetch from 2.6.0 to 2.6.1 (#1963)

Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. **This update includes a security fix.**
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Cleanup console.log

* Add integration tests to test the entry points (commonjs/esm, full/number only)

* Create backward compatibility error messages in the files moved/removed since v8

* Describe breaking changes in HISTORY.md

* Bump karma from 5.2.1 to 5.2.2 (#1965)

Bumps [karma](https://github.com/karma-runner/karma) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v5.2.1...v5.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

Co-authored-by: Lee Langley-Rees <lee@greenimp.co.uk>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-20 18:01:29 +02:00
josdejong
cab986671e Merge remote-tracking branch 'origin/develop' into develop 2020-06-28 22:14:53 +02:00
josdejong
2df28bb609 Fix #1899: documentation on expression trees still using old namespace
`math.expression.node.*` instead of `math.*`
2020-06-28 22:14:27 +02:00
SungJinWoo-SL
98ce1fe437
g != h (#1897)
ik it's small but I was reading and it was kind of annoying
2020-06-27 09:41:30 +02:00
josdejong
7b5038eb89 Update devDependencies. Fix linting error 2020-06-23 21:09:38 +02:00
josdejong
f8521d3344 Add two examples on creating a custom instance of evaluate 2020-06-23 21:00:10 +02:00
josdejong
654e193a78 Fix fixer.io example, the free plan doesn't support SSL 2020-05-06 10:14:18 +02:00
josdejong
28b7a02f01 Fix #1834: value Infinity cannot be serialized and deserialized 2020-05-03 15:41:03 +02:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
c74a736ff9 Create an example showing how to override relational functions, see #1557 2019-07-10 12:20:50 +02:00
jos
51f99dbcd3 Remove old_browsers example (these browsers aren't supported anymore) 2019-06-08 13:59:39 +02:00
jos
a4d2c70c37 Define HTML charset and lang in all browser examples 2019-06-08 13:57:17 +02:00
jos
a602a38340 Updated docs for v6 2019-05-20 21:42:49 +02:00
jos
794803c0cd Updated readme, history, and some examples 2019-04-30 21:06:08 +02:00
jos
e4bb1c6198 Generate individual files for dependencies (tree shaking working now :) ) 2019-04-24 21:13:49 +02:00
jos
ecaa30c05e Update urls of examples to point to root instead of index.js 2019-04-24 10:50:54 +02:00
jos
f4d4180cea Move all entry files under ./src/entry 2019-04-24 10:48:01 +02:00