@zushah/chalkboard 1.6.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  # Chalkboard examples
2
- Six basic programs made by Zushah that utilize [Chalkboard v1.6.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.6.0) are located in this directory.
2
+ Six basic programs made by Zushah that utilize [Chalkboard v2.0.0 al-Khwarizmi](https://www.github.com/Zushah/Chalkboard/releases/tag/v2.0.0) are located in this directory.
3
3
 
4
4
  They can be viewed in action here:
5
5
  - [fluid.js](https://zushah.github.io/Chalkboard/examples/fluid.html)
@@ -9,4 +9,4 @@ They can be viewed in action here:
9
9
  - [newton.js](https://zushah.github.io/Chalkboard/examples/newton.html)
10
10
  - [quat-donut.js](https://zushah.github.io/Chalkboard/examples/quat-donut.html)
11
11
 
12
- The main webpage for the examples can be visited at the [Chalkboard website](https://zushah.github.io/Chalkboard/examples.html).
12
+ The main webpage for the examples can be visited at the [Chalkboard website](https://zushah.github.io/Chalkboard/examples/index.html).
package/examples/fluid.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Fluid Flow
3
+ Version 2.0.0 al-Khwarizmi Example Program: Fluid Flow
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -12,36 +12,36 @@ canvas.height = window.innerHeight;
12
12
  var cb = Chalkboard; // Initialize Chalkboard as cb
13
13
 
14
14
  // Vector field defined as F(x, y) = (-y, -x/(1 + x^2)^2), adapted from "Learning about Hamiltonian Monte Carlo" which can be found here: https://github.com/anvaka/fieldplay/blob/main/Awesome%20Fields.md
15
- var F = cb.vec2.field("y", "-x / ((1 + x * x) * (1 + x * x))");
15
+ var F = cb.vect.field("y", "-x / ((1 + x * x) * (1 + x * x))");
16
16
 
17
17
  // Basic particle system to simulate the fluid flow
18
18
  class Particle {
19
19
  constructor() {
20
- this.pos = cb.vec2.new(cb.numb.random(-canvas.width / 2, canvas.width / 2), cb.numb.random(-canvas.height / 2, canvas.height / 2)); // Position vector
21
- this.vel = cb.vec2.new(0); // Velocity vector
20
+ this.pos = cb.vect.random(-canvas.width / 2, canvas.width / 2, 2); // Position vector
21
+ this.vel = cb.vect.init(0, 0); // Velocity vector
22
22
  this.ppos = this.pos; // Previous position vector
23
23
  }
24
24
  update() {
25
25
  // Update the particle's position and velocity
26
- this.vel = cb.vec2.magset(cb.vec2.fromField(F, cb.vec2.scl(this.pos, 1/100)), 5); // Velocity direction depends on the (scaled) vector field, velocity magnitude is set to always be 5
27
- this.pos = cb.vec2.add(this.pos, this.vel); // Velocity is added to the position
26
+ this.vel = cb.vect.magset(cb.vect.fromField(F, cb.vect.scl(this.pos, 1/100)), 5); // Velocity direction depends on the (scaled) vector field, velocity magnitude is set to always be 5
27
+ this.pos = cb.vect.add(this.pos, this.vel); // Velocity is added to the position
28
28
  }
29
29
  constrain() {
30
30
  // Constrain the particle position within the canvas
31
31
  // The canvas coordinates are within -width/-height and width/height so that the Cartestian point (0, 0) is in the center of the canvas
32
- if(this.pos.x > canvas.width / 2) {
32
+ if (this.pos.x > canvas.width / 2) {
33
33
  this.pos.x = -canvas.width / 2;
34
34
  this.ppos = this.pos;
35
35
  }
36
- if(this.pos.x < -canvas.width / 2) {
36
+ if (this.pos.x < -canvas.width / 2) {
37
37
  this.pos.x = canvas.width / 2;
38
38
  this.ppos = this.pos;
39
39
  }
40
- if(this.pos.y > canvas.height / 2) {
40
+ if (this.pos.y > canvas.height / 2) {
41
41
  this.pos.y = -canvas.height / 2;
42
42
  this.ppos = this.pos;
43
43
  }
44
- if(this.pos.y < -canvas.height / 2) {
44
+ if (this.pos.y < -canvas.height / 2) {
45
45
  this.pos.y = canvas.height / 2;
46
46
  this.ppos = this.pos;
47
47
  }
@@ -64,15 +64,15 @@ class Particle {
64
64
  }
65
65
  // Create 500 particles in the particles array
66
66
  var particles = [];
67
- for(var i = 0; i < 500; i++) {
67
+ for (var i = 0; i < 500; i++) {
68
68
  particles.push(new Particle());
69
69
  }
70
70
 
71
71
  // Draw everything
72
- ctx.fillStyle = "rgb(0, 0, 0)";
72
+ ctx.fillStyle = "black";
73
73
  ctx.fillRect(0, 0, canvas.width, canvas.height);
74
74
  function main() {
75
- for(var i = 0; i < particles.length; i++) {
75
+ for (var i = 0; i < particles.length; i++) {
76
76
  particles[i].draw();
77
77
  }
78
78
  window.requestAnimationFrame(main);
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Hyperbolic Functions
3
+ Version 2.0.0 al-Khwarizmi Example Program: Hyperbolic Functions
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -13,14 +13,14 @@ var cb = Chalkboard; // Initialize Chalkboard as cb
13
13
 
14
14
  var theta = 0;
15
15
  function main() {
16
- ctx.fillStyle = "rgb(255, 255, 255)";
16
+ ctx.fillStyle = "white";
17
17
  ctx.fillRect(0, 0, canvas.width, canvas.height);
18
18
  cb.plot.xyplane({lineWidth: 2});
19
19
 
20
20
  // Plot the unit hyperbola with a parametric function (see: https://en.wikipedia.org/wiki/Hyperbola)
21
- var f = cb.real.function(["(t * t + 1) / (2 * t)", "(t * t - 1) / (2 * t)"], "curv");
22
- cb.plot.function(f, {strokeStyle: "rgb(100, 100, 255)", domain: [0, 10], lineWidth: 4});
23
- cb.plot.function(f, {strokeStyle: "rgb(100, 100, 255)", domain: [-10, 0], lineWidth: 4});
21
+ var f = cb.real.define(["(t * t + 1) / (2 * t)", "(t * t - 1) / (2 * t)"], "curv");
22
+ cb.plot.definition(f, {strokeStyle: "rgb(100, 100, 255)", domain: [0, 10], lineWidth: 4});
23
+ cb.plot.definition(f, {strokeStyle: "rgb(100, 100, 255)", domain: [-10, 0], lineWidth: 4});
24
24
 
25
25
  // The two main hyperbolic trigonometric functions, hyperbolic sine (sinh) and hyperbolic cosine (cosh)
26
26
  var x = cb.trig.cosh(theta);
@@ -39,12 +39,12 @@ function main() {
39
39
  ctx.moveTo(0, -y * 100);
40
40
  ctx.lineTo(x * 100, -y * 100);
41
41
  ctx.stroke();
42
- ctx.fillStyle = "rgb(0, 0, 0)";
42
+ ctx.fillStyle = "black";
43
43
  ctx.beginPath();
44
44
  ctx.ellipse(x * 100, -y * 100, 5, 5, 0, 0, cb.PI(2));
45
45
  ctx.fill();
46
46
  ctx.restore();
47
- ctx.fillStyle = "rgb(0, 0, 0)";
47
+ ctx.fillStyle = "black";
48
48
  ctx.font = "50px Times New Roman";
49
49
  ctx.fillText("x² - y² = 1", 20, 70);
50
50
  ctx.fillText("θ = " + theta.toFixed(2), 20, 120);
@@ -55,34 +55,34 @@ function main() {
55
55
  ctx.fillText("sech(θ) = " + cb.trig.sech(theta).toFixed(2), 20, 370);
56
56
  ctx.fillText("coth(θ) = " + cb.trig.coth(theta).toFixed(2), 20, 420);
57
57
  ctx.fillText("arcsinh(θ) = " + cb.trig.arcsinh(theta).toFixed(2), 20, 470);
58
- if(cb.trig.arccosh(theta) !== undefined) {
58
+ if (cb.trig.arccosh(theta) !== undefined) {
59
59
  ctx.fillText("arccosh(θ) = " + cb.trig.arccosh(theta).toFixed(2), 20, 520);
60
60
  } else {
61
61
  ctx.fillText("arccosh(θ) = undefined", 20, 520);
62
62
  }
63
- if(cb.trig.arctanh(theta) !== undefined) {
63
+ if (cb.trig.arctanh(theta) !== undefined) {
64
64
  ctx.fillText("arctanh(θ) = " + cb.trig.arctanh(theta).toFixed(2), 20, 570);
65
65
  } else {
66
66
  ctx.fillText("arctanh(θ) = undefined", 20, 570);
67
67
  }
68
- if(cb.trig.arccsch(theta) !== undefined) {
68
+ if (cb.trig.arccsch(theta) !== undefined) {
69
69
  ctx.fillText("arccsch(θ) = " + cb.trig.arccsch(theta).toFixed(2), 20, 620);
70
70
  } else {
71
71
  ctx.fillText("arccsch(θ) = undefined", 20, 620);
72
72
  }
73
- if(cb.trig.arcsech(theta) !== undefined) {
73
+ if (cb.trig.arcsech(theta) !== undefined) {
74
74
  ctx.fillText("arcsech(θ) = " + cb.trig.arcsech(theta).toFixed(2), 20, 670);
75
75
  } else {
76
76
  ctx.fillText("arcsech(θ) = undefined", 20, 670);
77
77
  }
78
- if(cb.trig.arccoth(theta) !== undefined) {
78
+ if (cb.trig.arccoth(theta) !== undefined) {
79
79
  ctx.fillText("arccoth(θ) = " + cb.trig.arccoth(theta).toFixed(2), 20, 720);
80
80
  } else {
81
81
  ctx.fillText("arccoth(θ) = undefined", 20, 720);
82
82
  }
83
83
 
84
84
  theta += 0.05;
85
- if(theta > 2.5) {
85
+ if (theta > 2.5) {
86
86
  theta = -2.5;
87
87
  }
88
88
  window.requestAnimationFrame(main);
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Mandelbrot Set
3
+ Version 2.0.0 al-Khwarizmi Example Program: Mandelbrot Set
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -16,21 +16,21 @@ var cb = Chalkboard; // Initialize Chalkboard as cb
16
16
  var imageData = ctx.createImageData(canvas.width, canvas.height);
17
17
  var pixels = imageData.data;
18
18
  function main() {
19
- for(var x = 0; x < canvas.width; x++) {
20
- for(var y = 0; y < canvas.height; y++) {
19
+ for (var x = 0; x < canvas.width; x++) {
20
+ for (var y = 0; y < canvas.height; y++) {
21
21
  // The complex numbers from the Mandelbrot set's definition (see: lines 33-34), z and c
22
- var z = cb.comp.new(cb.numb.map(x, [0, canvas.width], [-2 * ratio, 2 * ratio]), cb.numb.map(y, [0, canvas.height], [-2, 2]));
23
- var c = cb.comp.new(cb.numb.map(x, [0, canvas.width], [-2 * ratio, 2 * ratio]), cb.numb.map(y, [0, canvas.height], [-2, 2]));
22
+ var z = cb.comp.init(cb.numb.map(x, [0, canvas.width], [-2 * ratio, 2 * ratio]), cb.numb.map(y, [0, canvas.height], [-2, 2]));
23
+ var c = cb.comp.init(cb.numb.map(x, [0, canvas.width], [-2 * ratio, 2 * ratio]), cb.numb.map(y, [0, canvas.height], [-2, 2]));
24
24
 
25
25
  var currIteration = 0; // The current iteration of the fractal
26
26
  var maxIterations = 100; // The maximum iterations intended to be evaluated
27
27
 
28
- while(currIteration < maxIterations) {
28
+ while (currIteration < maxIterations) {
29
29
  // The definition of the Mandelbrot set: f(z) = z^2 + c (see: https://en.wikipedia.org/wiki/Mandelbrot_set)
30
30
  z = cb.comp.add(cb.comp.sq(z), c);
31
31
 
32
32
  // Of course we can't keep iterating infinitely, so we'll just round infinity down to 2
33
- if(cb.comp.mag(z) > 2) {
33
+ if (cb.comp.magsq(z) > 4) {
34
34
  break;
35
35
  }
36
36
  currIteration++; // Keep iterating
@@ -38,7 +38,7 @@ function main() {
38
38
 
39
39
  // The fractal will be colored based on how many iterations it's gone through at a point
40
40
  var color = cb.numb.map(cb.real.sqrt(cb.numb.map(currIteration, [0, maxIterations], [0, 1])), [0, 1], [0, 255]);
41
- if(currIteration === maxIterations) {
41
+ if (currIteration === maxIterations) {
42
42
  color = 0;
43
43
  }
44
44
  var px = (x + y * canvas.width) * 4;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Matrix Donut
3
+ Version 2.0.0 al-Khwarizmi Example Program: Matrix Donut
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -11,26 +11,30 @@ canvas.height = window.innerHeight;
11
11
 
12
12
  var cb = Chalkboard; // Initialize Chalkboard as cb
13
13
 
14
- // Generate the donut's points with a parametric function (see: https://en.wikipedia.org/wiki/Torus)
14
+ // Generate the donut's points with parametric equations (see: https://en.wikipedia.org/wiki/Torus)
15
15
  var points = [];
16
- for(var u = 0; u < cb.PI(2); u += cb.PI(1/16)) {
17
- for(var v = 0; v < cb.PI(2); v += cb.PI(1/6)) {
16
+ for (var u = 0; u < cb.PI(2); u += cb.PI(1/16)) {
17
+ for (var v = 0; v < cb.PI(2); v += cb.PI(1/6)) {
18
18
  var x = (75 + 30 * cb.trig.cos(v)) * cb.trig.cos(u);
19
19
  var y = (75 + 30 * cb.trig.cos(v)) * cb.trig.sin(u);
20
20
  var z = 30 * cb.trig.sin(v);
21
- points.push(cb.vec3.new(x, y, z));
21
+ points.push(cb.vect.init(x, y, z));
22
22
  }
23
23
  }
24
+
25
+ // Make the donut rotate with a rotation matrix
26
+ var r = cb.matr.rotator(0.01, 0.01, 0.01);
27
+
24
28
  function main() {
25
- ctx.fillStyle = "rgb(255, 255, 255)";
29
+ ctx.fillStyle = "white";
26
30
  ctx.fillRect(0, 0, canvas.width, canvas.height);
27
31
 
28
32
  ctx.save();
29
33
  ctx.translate(canvas.width / 2, canvas.height / 2);
30
- ctx.strokeStyle = "rgb(0, 0, 0)";
31
- for(var i = 0; i < points.length; i++) {
32
- for(var j = 0; j < points.length; j++) {
33
- if(cb.vec3.dist(points[i], points[j]) < 25) {
34
+ ctx.strokeStyle = "black";
35
+ for (var i = 0; i < points.length; i++) {
36
+ for (var j = 0; j < points.length; j++) {
37
+ if (cb.vect.distsq(points[i], points[j]) < 625) {
34
38
  // Draw lines between the donut's points to draw the donut
35
39
  cb.geom.line3D(points[i].x, points[i].y, points[i].z, points[j].x, points[j].y, points[j].z);
36
40
  }
@@ -38,12 +42,8 @@ function main() {
38
42
  }
39
43
  ctx.restore();
40
44
 
41
- // Make the donut rotate with a rotation matrix
42
- var r = cb.matr.rotator(cb.trig.toRad(1), cb.trig.toRad(1), cb.trig.toRad(1));
43
- for(var i = 0; i < points.length; i++) {
44
- var buffer = cb.vec3.toMatrix(points[i]); // Create a buffer matrix which has the donut's points
45
- var rbuffer = cb.matr.mul(r, buffer); // Multiply the rotation matrix with the buffer matrix
46
- points[i] = cb.matr.toVector(rbuffer, "vec3"); // Reassign the values of the donut's points to the new rotated points
45
+ for (var i = 0; i < points.length; i++) {
46
+ points[i] = cb.matr.mulVector(r, points[i]); // Multiply the rotation matrix with the points' vectors
47
47
  }
48
48
 
49
49
  window.requestAnimationFrame(main);
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Newton's Method
3
+ Version 2.0.0 al-Khwarizmi Example Program: Newton's Method
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -12,16 +12,12 @@ canvas.height = window.innerHeight;
12
12
  var cb = Chalkboard; // Initialize Chalkboard as cb
13
13
 
14
14
  // Random fourth-degree polynomial function
15
- var c1 = cb.numb.random(-3, 3);
16
- var c2 = cb.numb.random(-3, 3);
17
- var c3 = cb.numb.random(-3, 3);
18
- var c4 = cb.numb.random(-3, 3);
19
- var c5 = cb.numb.random(-3, 3);
20
- var f = cb.real.function(c1 + " * x * x * x * x + " + c2 + " * x * x * x + " + c3 + " * x * x + " + c4 + " * x + " + c5);
15
+ var c = cb.stat.random(-3, 3, 5);
16
+ var f = cb.real.define(c[0] + " * x * x * x * x + " + c[1] + " * x * x * x + " + c[2] + " * x * x + " + c[3] + " * x + " + c[4]);
21
17
 
22
18
  // Newton's method's solution and tangent line (see: https://en.wikipedia.org/wiki/Newton's_method)
23
19
  var root = cb.calc.Newton(f, [-5, 5]);
24
- var y = cb.real.function(cb.calc.dfdx(f, root) + " * (x - " + root + ") + " + cb.real.val(f, root));
20
+ var y = cb.real.define(cb.calc.dfdx(f, root) + " * (x - " + root + ") + " + cb.real.val(f, root));
25
21
 
26
22
  function main() {
27
23
  ctx.fillStyle = "rgb(255, 255, 255)";
@@ -29,16 +25,16 @@ function main() {
29
25
  cb.plot.xyplane({lineWidth: 2});
30
26
 
31
27
  // Draw the polynomial
32
- cb.plot.function(f, {strokeStyle: "rgb(100, 100, 255)", lineWidth: 4});
28
+ cb.plot.definition(f, {strokeStyle: "rgb(100, 100, 255)", lineWidth: 4});
33
29
  ctx.fillStyle = "rgb(0, 0, 0)";
34
30
  ctx.font = "50px Times New Roman";
35
- ctx.fillText("f(x) = " + c1.toFixed(2) + "x⁴ + " + c2.toFixed(2) + "x³ + " + c3.toFixed(2) + "x² + " + c4.toFixed(2) + "x + " + c5.toFixed(2), 20, 70);
31
+ ctx.fillText("f(x) = " + c[0].toFixed(2) + "x⁴ + " + c[1].toFixed(2) + "x³ + " + c[2].toFixed(2) + "x² + " + c[3].toFixed(2) + "x + " + c[4].toFixed(2), 20, 70);
36
32
 
37
- // Only draw the solution and the tangent line if the solution is correct
38
- if(cb.real.val(f, root).toFixed(1) == 0) {
33
+ // Draw the solution and the tangent line if the solution is correct
34
+ if (cb.real.val(f, root).toFixed(1) == 0) {
39
35
  ctx.fillText("y = " + cb.calc.dfdx(f, root).toFixed(2) + "x - " + (cb.calc.dfdx(f, root) * root).toFixed(2), 20, 120);
40
36
  ctx.fillText("A possible root is at x = " + root.toFixed(2), 20, 170);
41
- cb.plot.function(y, {strokeStyle: "rgb(255, 100, 100)", lineWidth: 4});
37
+ cb.plot.definition(y, {strokeStyle: "rgb(255, 100, 100)", lineWidth: 4});
42
38
  ctx.save();
43
39
  ctx.translate(canvas.width / 2, canvas.height / 2);
44
40
  ctx.beginPath();
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  The Chalkboard Library ===> https://www.github.com/Zushah/Chalkboard
3
- Version 1.6.0 Example Program: Quaternion Donut
3
+ Version 2.0.0 al-Khwarizmi Example Program: Quaternion Donut
4
4
  Authored by Zushah ===> https://www.github.com/Zushah
5
5
  */
6
6
 
@@ -11,35 +11,35 @@ canvas.height = window.innerHeight;
11
11
 
12
12
  var cb = Chalkboard; // Initialize Chalkboard as cb
13
13
 
14
- // Generate the donut's points with a parametric function (see: https://en.wikipedia.org/wiki/Torus)
14
+ // Generate the donut's points with parametric equations (see: https://en.wikipedia.org/wiki/Torus)
15
15
  var points = [];
16
- for(var u = 0; u < cb.PI(2); u += cb.PI(1/16)) {
17
- for(var v = 0; v < cb.PI(2); v += cb.PI(1/6)) {
16
+ for (var u = 0; u < cb.PI(2); u += cb.PI(1/16)) {
17
+ for (var v = 0; v < cb.PI(2); v += cb.PI(1/6)) {
18
18
  var x = (75 + 30 * cb.trig.cos(v)) * cb.trig.cos(u);
19
19
  var y = (75 + 30 * cb.trig.cos(v)) * cb.trig.sin(u);
20
20
  var z = 30 * cb.trig.sin(v);
21
- points.push(cb.vec3.new(x, y, z));
21
+ points.push(cb.vect.init(x, y, z));
22
22
  }
23
23
  }
24
24
  var theta = 0;
25
25
  function main() {
26
- ctx.fillStyle = "rgb(0, 0, 0)";
26
+ ctx.fillStyle = "black";
27
27
  ctx.fillRect(0, 0, canvas.width, canvas.height);
28
28
 
29
29
  // Make the donut rotate with a rotation quaternion
30
- var r = cb.quat.fromAxis(cb.vec3.normalize(cb.vec3.new(1, 1, 1)), theta);
30
+ var r = cb.quat.fromAxis(cb.vect.normalize(cb.vect.init(1, 1, 1)), theta);
31
31
  var qoints = []; // We'll say that "qoints" are the new rotated points
32
- for(var i = 0; i < points.length; i++) {
32
+ for (var i = 0; i < points.length; i++) {
33
33
  qoints.push(cb.quat.toRotation(r, points[i]));
34
34
  }
35
35
  theta += cb.trig.toRad(1);
36
36
 
37
37
  ctx.save();
38
38
  ctx.translate(canvas.width / 2, canvas.height / 2);
39
- ctx.strokeStyle = "rgb(255, 255, 255)";
40
- for(var i = 0; i < qoints.length; i++) {
41
- for(var j = 0; j < qoints.length; j++) {
42
- if(cb.vec3.dist(qoints[i], qoints[j]) < 25) {
39
+ ctx.strokeStyle = "white";
40
+ for (var i = 0; i < qoints.length; i++) {
41
+ for (var j = 0; j < qoints.length; j++) {
42
+ if (cb.vect.distsq(qoints[i], qoints[j]) < 625) {
43
43
  // Draw lines between the donut's qoints to draw the donut
44
44
  cb.geom.line3D(qoints[i].x, qoints[i].y, qoints[i].z, qoints[j].x, qoints[j].y, qoints[j].z);
45
45
  }
package/package.json CHANGED
@@ -1,27 +1,56 @@
1
1
  {
2
2
  "name": "@zushah/chalkboard",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
4
4
  "description": "The Chalkboard library provides a plethora of mathematical functionalities for its user.",
5
- "main": "src/Chalkboard.js",
5
+ "main": "dist/Chalkboard.js",
6
+ "files": ["dist", "examples", "CHANGELOG.md", "LICENSE.md", "package.json", "README.md"],
6
7
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
+ "build": "tsc --project tsconfig.json",
9
+ "eslint": "eslint src/**",
10
+ "eslint:fix": "eslint --fix src/**",
11
+ "prettier": "prettier src",
12
+ "prettier:fix": "prettier --write src",
13
+ "docs": "typedoc --options typedoc.json"
8
14
  },
9
15
  "repository": {
10
16
  "type": "git",
11
17
  "url": "git+https://github.com/Zushah/Chalkboard.git"
12
18
  },
13
19
  "keywords": [
14
- "mathematics",
20
+ "algebra",
21
+ "calculus",
22
+ "complex",
23
+ "geometry",
15
24
  "khan-academy",
16
- "processing"
25
+ "mathematics",
26
+ "number",
27
+ "plot",
28
+ "quaternion",
29
+ "statistics",
30
+ "tensor",
31
+ "trigonometry",
32
+ "typescript",
33
+ "matrix",
34
+ "vector"
17
35
  ],
18
36
  "author": "Zushah",
19
37
  "license": "MIT",
20
38
  "bugs": {
21
39
  "url": "https://github.com/Zushah/Chalkboard/issues"
22
40
  },
23
- "homepage": "https://zushah.github.io/Chalkboard/home.html",
41
+ "homepage": "https://zushah.github.io/Chalkboard",
24
42
  "publishConfig": {
25
43
  "access": "public"
44
+ },
45
+ "save-prefix": "",
46
+ "devDependencies": {
47
+ "@types/node": "20.10.6",
48
+ "@typescript-eslint/eslint-plugin": "6.17.0",
49
+ "@typescript-eslint/parser": "6.17.0",
50
+ "eslint": "8.56.0",
51
+ "prettier": "3.1.1",
52
+ "typedoc": "0.25.6",
53
+ "typedoc-material-theme": "1.0.2",
54
+ "typescript": "5.3.3"
26
55
  }
27
56
  }
Binary file
package/docs/README.md DELETED
@@ -1,2 +0,0 @@
1
- # Chalkboard documentation
2
- The documentation for [Chalkboard v1.6.0](https://www.github.com/Zushah/Chalkboard/releases/tag/v1.6.0) can be visited [here](https://zushah.github.io/Chalkboard/documentation.html/). Its source code is located [here](https://www.github.com/Zushah/zushah.github.io/blob/main/Chalkboard/documentation.html).