{"id":28205056,"url":"https://github.com/zushah/chalkboard","last_synced_at":"2025-10-07T09:19:03.989Z","repository":{"id":205835975,"uuid":"715214047","full_name":"Zushah/Chalkboard","owner":"Zushah","description":"The Chalkboard library provides a plethora of mathematical functionalities for its user.","archived":false,"fork":false,"pushed_at":"2025-06-25T18:40:48.000Z","size":996,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-06T06:46:34.446Z","etag":null,"topics":["khan-academy","library","mathematics","typescript"],"latest_commit_sha":null,"homepage":"https://zushah.github.io/Chalkboard","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zushah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-06T17:37:13.000Z","updated_at":"2025-06-16T21:45:37.000Z","dependencies_parsed_at":"2023-11-15T05:27:40.853Z","dependency_job_id":"e4d467cb-c625-49d1-a039-7f6a679a2663","html_url":"https://github.com/Zushah/Chalkboard","commit_stats":null,"previous_names":["zushah/chalkboard"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/Zushah/Chalkboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zushah%2FChalkboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zushah%2FChalkboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zushah%2FChalkboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zushah%2FChalkboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zushah","download_url":"https://codeload.github.com/Zushah/Chalkboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zushah%2FChalkboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278748400,"owners_count":26038904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["khan-academy","library","mathematics","typescript"],"created_at":"2025-05-17T07:11:19.721Z","updated_at":"2025-10-07T09:19:03.970Z","avatar_url":"https://github.com/Zushah.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://www.github.com/Zushah/Chalkboard\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Zushah/Chalkboard/main/assets/Chalkboard-logo.png\" width=\"50%\"\u003e\u003c/a\u003e\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://www.github.com/Zushah/Chalkboard/releases/tag/v2.4.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/release-v2.4.0_Noether-blueviolet?logo=github\u0026logoColor=white\" alt=\"Latest release\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://www.github.com/microsoft/TypeScript\"\u003e\u003cimg src=\"https://img.shields.io/github/languages/top/Zushah/Chalkboard?color=blue\u0026logo=typescript\u0026logoColor=white\" alt=\"Written in TypeScript\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://www.codefactor.io/repository/github/zushah/chalkboard\"\u003e\u003cimg src=\"https://img.shields.io/codefactor/grade/github/Zushah/Chalkboard?color=darkgreen\u0026logo=codefactor\u0026logoColor=white\" alt=\"CodeFactor grade\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/@zushah/chalkboard\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/%40zushah/chalkboard?logo=npm\u0026logoColor=white\" alt=\"npm downloads\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/github/license/Zushah/Chalkboard?color=yellow\u0026logo=opensourceinitiative\u0026logoColor=white\" alt=\"MIT License\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://bundlephobia.com/package/@zushah/chalkboard@2.4.0\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/min/%40zushah/chalkboard?color=orange\u0026logo=files\u0026logoColor=white\" alt=\"Minified size\"\u003e\u003c/a\u003e\r\n    \u003ca href=\"https://www.jsdelivr.com/package/gh/Zushah/Chalkboard\"\u003e\u003cimg src=\"https://img.shields.io/jsdelivr/gh/hm/Zushah/Chalkboard?color=crimson\u0026logo=jsdelivr\u0026logoColor=white\" alt=\"jsDelivr requests\"\u003e\u003c/a\u003e \r\n    \u003cbr\u003e\r\n    \u003ca href=\"https://zushah.github.io/Chalkboard\"\u003ehttps://zushah.github.io/Chalkboard\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n# Contents\r\n\u003col\u003e\r\n    \u003cli\u003e\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\r\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\r\n\u003c/ol\u003e\r\n\r\n# About\r\nThe Chalkboard library is a JavaScript namespace that provides a plethora of both practical and abstract mathematical functionalities for its user. It was developed by [Zushah](https://www.github.com/Zushah) during 2022 and 2023 and then [released](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.0.0) on November 6, 2023. As per the latest release of [v2.4.0 Noether](https://www.github.com/Zushah/Chalkboard/releases/tag/v2.4.0), Chalkboard has 615 unique commands. The library is available for regular JavaScript on both the client-side and the server-side as well as [Proccesing.js](https://www.processing.org/) (fully compatible with [Khan Academy](https://www.khanacademy.org/cs/chalkboard/6708642430369792)). Chalkboard's website can be visited [here](https://zushah.github.io/Chalkboard).\r\n\r\n# Installation\r\nIf your JavaScript project is being run on the client-side within a webpage, you can install Chalkboard with this HTML tag:\r\n```html\r\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Zushah/Chalkboard@2.4.0/dist/Chalkboard.min.js\"\u003e\u003c/script\u003e\r\n```\r\nIf your JavaScript project is being run on the server-side within the [Node.js](https://nodejs.org/en) environment, you can install Chalkboard with this console command:\r\n```bash\r\nnpm install @zushah/chalkboard\r\n```\r\nAlternatively, you can simply download the [latest release](https://www.github.com/Zushah/Chalkboard/releases/tag/v2.4.0) and put the relevant files in your project's directory.\r\n\r\nChalkboard can also be downloaded on [Khan Academy](https://www.khanacademy.org) from the code in the corresponding [release](https://www.khanacademy.org/cs/chalkboard/6708642430369792).\r\n\r\n# Documentation\r\nChalkboard has fourteen categories of commands:\r\n- `abal` - Abstract algebra definitions, sets, operations, structures, and morphisms\r\n- `bool` - Boolean algebra operations\r\n- `calc` - Single/multi-variable real/complex-valued calculus operations\r\n- `comp` - Complex number and complex function operations\r\n- `geom` - Geometric operations\r\n- `matr` - Multidimensional matrix operations\r\n- `numb` - Number-theoretic operations\r\n- `plot` - Plotting real and complex functions, complex numbers, vectors, matrices, and statistical graphs\r\n- `quat` - Quaternion operations\r\n- `real` - Real number and real function operations\r\n- `stat` - Statistical array operations\r\n- `tens` - Tensor (multidimensional multidimensional matrix) operations\r\n- `trig` - Trigonometric function operations\r\n- `vect` - Two-, three-, and four-dimensional vector and vector field operations\r\n\r\nThere are also nine \"global\" commands and constants, which are:\r\n- `APPLY` - Applies a callback function in an element-wise manner on a Chalkboard object\r\n- `CONTEXT` - The JavaScript canvas rendering context to use for plotting\r\n- `E()` - Computes the number e\r\n- `I()` - Computes the number i\r\n- `LOGO()` - Draws the Chalkboard logo\r\n- `PARSEPREFIX` - Used for adding custom functions to the Chalkboard parser\r\n- `PI()` - Computes the number π\r\n- `README()` - Prints basic information about Chalkboard in the console\r\n- `VERSION` - The installed version of Chalkboard\r\n- `VERSIONALIAS` - The alias of the installed version of Chalkboard\r\n\r\nLastly, Chalkboard has eleven data types (also known as Chalkboard objects):\r\n- `ChalkboardComplex` - Complex numbers\r\n- `ChalkboardFunction` - Mathematical functions\r\n- `ChalkboardMatrix` - Matrices\r\n- `ChalkboardMorphism` - Morphisms\r\n- `ChalkboardQuaternion` - Quaternions\r\n- `ChalkboardSet` - Sets\r\n- `ChalkboardStructure` - Algebraic structures\r\n- `ChalkboardStructureExtension` - Algebraic structure extensions\r\n- `ChalkboardTensor` - Tensors\r\n- `ChalkboardVector` - Vectors\r\n- `ChalkboardVectorField` - Vector fields\r\n\r\nThe comprehensive Chalkboard documentation can be visited [here](https://zushah.github.io/Chalkboard).\r\n\r\n# Getting Started\r\nAfter installing Chalkboard into your program, you can immediately get started with using it. Every Chalkboard command begins with typing \"Chalkboard\" followed by a period, then the name of the category of the command (all categories are listed above in the [documentation](#documentation) section) with another period, and lastly the desired command itself.\r\n```js\r\nChalkboard.category.command(parameters);\r\n```\r\nHere is some code that shows off only a few features of Chalkboard:\r\n```js\r\nconst cb = Chalkboard; // Initialize in a browser\r\nconst cb = require(\"@zushah/chalkboard\"); // Initialize in Node with CommonJS\r\nimport cb from \"@zushah/chalkboard\"; // Initiialize in Node with ES Modules\r\n\r\nconst f = cb.real.define(\"Math.cos(2 * x)\"); // f(x) = cos(2x)\r\nconst dfdx = cb.calc.dfdx(f, 2); // Derivative of f at x = 0\r\nconst fxdx = cb.calc.fxdx(f, 0, 2); // Antiderivative of f from x = 0 to x = 2\r\nconst fourier = cb.calc.Fourier(f, 2); // Fourier transform of f at x = 2\r\n\r\nconst f = cb.vect.field(\"x\", \"y\", \"z\"); // f(x, y, z) = (x, y, z)\r\nconst r = cb.real.define([\"Math.cos(s) * Math.cos(t)\", \"Math.sin(s) * Math.cos(t)\", \"Math.sin(t)\"], \"surf\"); // r(s, t) = (cos(s)cos(t), sin(s)cos(t), sin(t))\r\nconst fnds = cb.calc.fnds(f, r, cb.PI(-1/2), cb.PI(1/2), 0, cb.PI(2)); // Flux of the radial vector field through the unit sphere\r\n\r\nconst primes = cb.numb.primeArr(0, 100); // Array of prime numbers between 0 and 100\r\nconst midPrime = cb.stat.median(primes); // Median number in the primes array\r\ncb.plot.barplot(primes, cb.stat.array(0, 100, 11), {size: 5, strokeStyle: \"black\", fillStyle: \"blue\"}); // Barplot of the primes array with a bin size of 10, a scale of 2, a stroke color of black, and a fill color of blue\r\n\r\nconst z = cb.comp.init(1, 1); // z = 1 + i\r\nconst zsqsqrt = cb.comp.sqrt(cb.comp.sq(z)); // The square root of z squared equals z\r\nconst f = cb.comp.define(\"a*a - b*b + 1\", \"2*a*b\"); // f(z) = z^2 + 1\r\ncb.plot.definition(f); // Plots the domain coloring of f\r\n\r\nconst r = cb.real.define([\"Math.cos(t)\", \"Math.sin(t)\"], \"curv\"); // r(t) = (cos(t), sin(t))\r\ncb.plot.xyplane({size: 2}); // Draws the Cartesian coordinate plane scaled by 2\r\ncb.plot.definition(r, {size: 2, strokeStyle: \"rgb(255, 100, 100)\", domain: [0, cb.PI(2)]}); // Plots r(t) scaled by 2 colored light red from t = 0 to t = π/2\r\n\r\nconst a = cb.vect.init(1, 2, 3); // Vector a = (1, 2, 3)\r\nconst b = cb.vect.init(4, 5, 6); // Vector b = (4, 5, 6)\r\nconst c = cb.vect.init(7, 8, 9); // Vector c = (7, 8, 9)\r\nconst axbxc = cb.vect.vectorTriple(a, b, c); // Triple cross product between a, b, and c\r\ncb.vect.print(axbxc); // Prints axbxc in the console\r\n\r\nconst m = cb.matr.init( // m is a 5x5 matrix\r\n    [0, 1, 1, 1, 1],\r\n    [1, 0, 1, 1, 1],\r\n    [1, 1, 0, 1, 1],\r\n    [1, 1, 1, 0, 1],\r\n    [1, 1, 1, 1, 0]\r\n);\r\nconst mi = cb.matr.invert(m); // mi is the inverse of m\r\nconst mmi = cb.matr.mul(m, mi); // mmi is the product of m and mi\r\ncb.matr.print(mmi); // Prints mmi in the console\r\n\r\nconst t = cb.tens.init( // t is a 2x2x2 rank-3 tensor\r\n    [\r\n        [1, 2],\r\n        [3, 4]\r\n    ],\r\n    [\r\n        [5, 6],\r\n        [7, 8]\r\n    ]\r\n);\r\nconst tt = cb.tens.mul(t, t); // tt is a 2x2x2x2x2x2 rank-6 tensor\r\nconst ttm = cb.tens.resize(tt, 8, 8); // ttm is an 8x8 matrix (or rank-2 tensor)\r\ncb.tens.print(tt); // Prints tt in the console just to see what it looks like for fun\r\nconst factorialt = cb.APPLY(t, (x) =\u003e cb.numb.factorial(x)); // Calculates the factorial of each element of t\r\n\r\nconst Z4 = cb.abal.Z(4); // The set of integers modulo 4 is the set {0, 1, 2, 3}\r\nconst C4 = cb.abal.C(4); // The set of fourth roots of unity is the set {1, i, -1, -i}\r\nconst G = cb.abal.group(Z4, (a, b) =\u003e (a + b) % 4); // The group G is the set Z₄ with mod 4 addition\r\nconst H = cb.abal.group(C4, (z, w) =\u003e cb.comp.mul(z, w)); // The group H is the set C₄ with complex multiplication\r\nconst F = cb.abal.isomorphism(G, H, (n) =\u003e cb.comp.round(cb.comp.pow(cb.comp.init(0, 1), n))); // The isomorphism F: G → H is defined by F(n) = iⁿ for all n in Z₄\r\n```\r\nSeveral examples that are rather interesting can be seen [here](https://zushah.github.io/Chalkboard/examples/index.html), and their source code is [here](https://www.github.com/Zushah/Chalkboard/tree/main/examples).\r\n\r\n# Contributing\r\n\u003col\u003e\r\n    \u003cli\u003eFork Chalkboard's GitHub repository. Make sure the fork is based on the main branch.\u003c/li\u003e\r\n    \u003cli\u003eClone the repository, download the dev dependencies with `npm install`, and then make your contributions to your fork.\u003c/li\u003e\r\n    \u003cli\u003eWhen you're done, commit the changes to your fork with a detailed description.\u003c/li\u003e\r\n    \u003cli\u003eOpen a pull request. It will be reviewed soon and then merged to the main branch.\u003c/li\u003e\r\n\u003c/ol\u003e\r\n\r\nNOTE: If you want to change the documentation, you will also have to clone the [zushah.github.io repository](https://www.github.com/Zushah/zushah.github.io) because that's where the files are generated.\r\n\r\nThe changelog can be read [here](https://www.github.com/Zushah/Chalkboard/blob/main/CHANGELOG.md).\r\n\r\nThe Chalkboard library is available under the [MIT License](https://www.github.com/Zushah/Chalkboard/blob/main/LICENSE.md).\r\n\r\n# Acknowledgments\r\nThanks to [@bhavjitChauhan](https://www.github.com/bhavjitChauhan) for his contribution ([here](https://www.github.com/Zushah/Chalkboard/pull/1)) to [v1.3.0 Heaviside](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.3.0).\\\r\nThanks to [@gyang0](https://www.github.com/gyang0) for his contributions ([here](https://www.github.com/Zushah/zushah.github.io/pull/1) and [here](https://github.com/Zushah/Chalkboard/pull/5)) to the [documentation](https://www.github.com/Zushah/zushah.github.io/tree/main/Chalkboard).\\\r\nThanks to [@JentGent](https://www.github.com/JentGent) for his implementation ([here](https://www.github.com/JentGent/linalg/blob/main/linalg.js#L519)) for calculating QR decomposition which was [adapted](https://www.github.com/Zushah/Chalkboard/commit/1dce0dbac82b38f9a550dd496bc878c402a92442) into [v1.7.0 Descartes](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.7.0).\r\n\r\n# Contact\r\n[GitHub](https://www.github.com/Zushah)\\\r\n[Khan Academy](https://www.khanacademy.org/profile/zushah77)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzushah%2Fchalkboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzushah%2Fchalkboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzushah%2Fchalkboard/lists"}