How to use the @mathigon/boost.$body.on function in @mathigon/boost

To help you get started, we’ve selected a few @mathigon/boost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathigon / textbooks / content / graph-theory / components / sketch.ts View on Github external
start: p => {
        if (!this.options.noStart) this.start(p);
      },
      move: p => {
        if (!this.drawing) return;

        const box = $svg.viewBox;
        if (!isBetween(p.x, 0, box.width) || !isBetween(p.y, 0, box.height))
          return this.stop();

        this.addPoint(p);
      },
      end: () => this.stop()
    });

    $body.on('scroll', () => this.stop());
  }