Author Features / readonly are not working for some reason

51 views
Skip to first unread message

Muhanad Gad

unread,
Feb 29, 2024, 12:16:59 PM2/29/24
to desmos-api-discuss
Hello Desmos,

I'm integrating your beautiful library into my react project, it was not easy but i'm pretty close to achieve it.

I'm trying to set a readonly expression but the feature is not working for some reason,

I was using the npm version while also having your script tag in the index.html file that gave me the 1.8 version of desmos

I tried uninstalling the npm version and using only the script and accessing it using window.Desmos.GraphingCalculator and initialized the calculator using the initial state used in this example: https://www.desmos.com/api/v1.8/docs/examples/readonly-expressions.html

But still not working but i noticed a warning in the console, i attached an image for the warning and you can see that the graph is working super fine in the background with all your expressions still intact.

xlg.png

I'll also attach a screenshot of the window.desmos object to verify the version and a screenshot for the code used to create the graph. 

codexlg.png

consolelog.png


Thanks a ton in advance.

Chris Lusto

unread,
Feb 29, 2024, 12:30:58 PM2/29/24
to desmos-api-discuss
First of all, we don't distribute the API on npm, so you definitely shouldn't use that version (a) because it's not supported, and (b) it's very out of date. The last screenshot you posted makes it look like you're using v1.8.5 (the `Desmos.version` property), but I'm not sure why you're getting a warning about new states in that case. I now this is a bit silly, but are you sure you're not looking at a stale version in your browser that might still be using the old/npm API version?

If you're sure you're looking at an accurate state of the world, then the next thing I would ask is if you can try to send a minimal repro of the issue somewhere where I can see the actual code, because I'm not able to reproduce the issue in the current stable release (v1.8.5).

Best,
Chris

Muhanad Gad

unread,
Mar 10, 2024, 9:06:41 AM3/10/24
to desmos-api-discuss
Hey Chris,

Thanks a ton for your help. Just realized I overlooked something on my end that was causing the problem. Got it sorted now though! 🤦‍♂️

The NPM "UNOFFICIAL" Desmos version was getting called from a random component and apparently was overriding the other version.

Appreciate your support throughout.

Cheers,
Muhanad
Reply all
Reply to author
Forward
0 new messages