Author Topic: Standard JavaScript interface for simulators  (Read 415 times)

0 Members and 1 Guest are viewing this topic.

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1459
  • Country: es
    • Picuino
Standard JavaScript interface for simulators
« on: May 23, 2026, 02:51:50 pm »
I want to build another simulator (this time for control systems) and I’d like to use an interface similar to the one Falstad uses—with copy-paste functionality, cursor-hover highlighting, dragging nodes by clicking the mouse, etc.

My current pneumatic simulator has a rather basic interface, and I’d like to improve it without having to spend a huge amount of time on it.

Does anyone know of a JavaScript interface similar to Falstad that has already been developed and can be adapted for use with other simulators?
Or do I have to build it from scratch?
« Last Edit: May 23, 2026, 02:55:27 pm by Picuino »
 

Offline mapalme

  • Newbie
  • Posts: 5
  • Country: us
Re: Standard JavaScript interface for simulators
« Reply #1 on: May 26, 2026, 11:46:54 am »
I'm not 100 percent sure what you mean by similar to Falstad other than maybe just the look they have on there and the look you have on your other simulator? I will say that anything I've ever done in JavaScript or TypeScript for UIs I have always preferred React when possible and there are some open source libraries like this React Flow to help with some of the things you would be needing

https://github.com/xyflow/xyflow

Best of luck!
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1459
  • Country: es
    • Picuino
Re: Standard JavaScript interface for simulators
« Reply #2 on: May 26, 2026, 02:47:52 pm »
I'm not familiar with React. I'm going to look into the library to see if it makes programming easier than building the interface from scratch on my own.

Thank you very much for the link.
 

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: us
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1459
  • Country: es
    • Picuino
Re: Standard JavaScript interface for simulators
« Reply #4 on: May 26, 2026, 04:28:25 pm »
The problem with having so many libraries to choose from is that I don't have time to try them all out and decide which one is best suited for creating an interface similar to Falstad's (grid-based, with copy-paste-delete functionality, element highlighting on mouseover, dragging elements with the mouse, zoom in and out using the mouse, pan and center the diagram, etc.)

In any case, both Falstad's interface and mine are based on pixel-based canvas, not vector graphics using SVG.

« Last Edit: May 26, 2026, 04:30:51 pm by Picuino »
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1459
  • Country: es
    • Picuino
Re: Standard JavaScript interface for simulators
« Reply #5 on: May 26, 2026, 04:53:24 pm »
The AI recommends these libraries:
Konva.js / PixiJS
Fabric.js

Or doing it directly with native JavaScript. The advantage is that I learn more and don’t have to deal with all kinds of licenses. The downside is that it might take me longer (but considering that I have to learn the libraries from scratch, it won’t take much longer).

Given that there won't be many elements on the screen, I don't think performance will be a major issue.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf