add some comments

This commit is contained in:
Simon Gardling 2022-02-14 11:15:55 -05:00
parent d790b9c0f1
commit 93be08f048
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ fn integral_rectangles(
.map(|e| {
let x: f32 = ((e as f32) * step) + min_x;
// Makes sure rectangles are properly handled on x values below 0
let x2: f32 = match x > 0.0 {
true => x + step,
false => x - step,
@ -27,6 +28,7 @@ fn integral_rectangles(
let tmp1: f32 = func(x as f64) as f32;
let tmp2: f32 = func(x2 as f64) as f32;
// Chooses the y value who's absolute value is the smallest
let y: f32 = match tmp2.abs() > tmp1.abs() {
true => tmp1,
false => tmp2,

View File

@ -25,7 +25,7 @@ export function main() {
/** This function is used in `bootstrap.js` to setup imports. */
export function setup(WasmChart) {
ChartManager = WasmChart;
ChartManager.init_panic_hook();
ChartManager.init_panic_hook(); // Allows `panic!()` to log in the browser's console
}
/** Add event listeners. */