Skip to content

Instantly share code, notes, and snippets.

@jason-woolf
jason-woolf / DesmosPlayer.user.js
Last active January 28, 2022 04:51
Programmatically control a Desmos graph
// ==UserScript==
// @name desmosPlayer
// @namespace http://github.com/jason-woolf
// @version 1.0.0
// @description Program a series of graph changes to create animation
// @author Jason Woolf (MathyJaphy)
// @match https://www.desmos.com/calculator*
// @grant none
// @run-at document-idle
// ==/UserScript==
@jason-woolf
jason-woolf / gist:06a8ab893b0bac9f6203feae8191f529
Last active May 30, 2021 15:58
Suppress automatic scrolling in Desmos expression list
...
Calc = window.Calc;
// Squelch the automatic scroll-into-view behavior for programs
Calc.controller.origScrollItemIntoView = Calc.controller.scrollItemIntoView;
Calc.controller.origScrollSelectedItemIntoView = Calc.controller.scrollSelectedItemIntoView;
Calc.controller.scrollSelectedItemIntoView = function () {
const expr = this.getSelectedItem();
if (expr && expr.text && isAProgram(expr.text)) {
// No auto scrolling for a program!