Giter Site home page Giter Site logo

simlin's Introduction

Simlin: a system dynamics modeling tool

Simlin is an open source tool for creating and editing System Dynamics models. You can try it today at https://simlin.com.

simple example model

Controls

  • Shift-click on the background to reposition the canvas (and drag selection doesn't currently do something).
  • Click the blue edit button to show/hide new object creation tools.
    • use these tools by highlighting one of them and clicking on an existing item (in the case of "link" and maybe "flow"), or on the background of the canvas.
  • Create a new flow by clicking-down on a stock (or on a blank spot on the canvas) and dragging.
  • Detach + reposition/reattach flows + links by clicking-down on arrowheads and moving them over a new target. The new target should highlight as green.
  • Click on a variable name to edit the name.
  • In equations, you can either refer to the variables like "var name" (with quotes), or like var_name (replacing spaces with underscores).
  • The arrows in the bottom right are Undo and Redo - there is currently a 10-change limit for undos, and if you undo into the past + make a change (like moving something), you won't be able to redo-back those changes.
  • If you mouse-down and drag a label you can adjust its position relative to the variable.

Known issues

  • If you select a variable that is under the "search" box, the sheet showing variable details will cover that part of the model (you can manually shift-click the background and reposition the diagram to get out of/around this).
  • Drag selection isn't implemented yet.
  • You can only detach the arrowhead of a flow, not the origin/source end.
  • Undo/redo only applies within a browser tab. If you restart your browser (or reload the page), you will lose the ability to undo to before the reload.
  • Only straight-line flows are supported for now.
  • Maybe more! See the Issues page for additional info (and to report a bug or usability issue)

Local development

# dependencies; ignore warnings
$ yarn install
# build everything -- necessary to compile the rust simulation engine to WebAssembly
$ yarn build
# (the next 3 commands don't exit on their own -- they should be run in 3 separate terminals)
# start a local Firestore instance using the Google Cloud SDK
$ yarn start:firestore
# in another tab:
$ yarn start:backend
# in third and final tab:
$ yarn start:frontend

Now to the browser!

You can start local development + iteration on http://localhost:3000/

simlin's People

Contributors

bpowers avatar dependabot[bot] avatar evanp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

simlin's Issues

run management

This has two components:

  • How do we mark runs on the backend
  • What is the UI/design of run management in the app

fork and merge models

Step 1 is fork, but we should have some story for how this offline-first collaboration will work.

problems with variable names with / in them

have a report of a bug when a variable with "/" in the name is the target of a module input. Its possible this works in simlin (and is just a bug in sd.js) as I fixed some problems around canonicalization and modules, but we should add an explicit test to ensure it stays working

edit variable names

  • editable overlay
  • persist name change to ViewElement
  • update equations of dependent variables
  • work with canvas panning

module editing

We support running models with modules, but we should support them as a first class feature. This is a very large task

unit checking

There are a few parts to unit checking:

  • basic checking -- given a model with units specified, typecheck them.
  • type inference -- this is (a) helpful for users so that we can suggest units, but is also necessary for modules like smth1 where we really want the smth1 units to be generic
  • UI to edit units on variables. somewhat complicated by there not being much space in the sidebar, so we are going to have to be better at scrolling or rearrange things
  • UI to edit project unit relations (e.g. people person and persons are all interchangable units). This should probably be tied in to the general "control panel" view for a project we need.
  • (maybe) a classic frustration is that constants are unitless: a variable with equation 3 * n_homes is expected to have the same unit as n_homes, so if 3 is a constant designed to help convert from one unit to another, you have to pull it out into its own aux to give it its own unit. It would be nice if we could say 3 { units: people/home } * n_homes inline in the equation, but this will require lexing and parsing changes.

snap to alignment

a tidy diagram is a nice diagram. Things should be able to align to each other, and maybe to an integer grid?

Local development: no model-oauth

README.md refers to a step . ~/model-oauth to set environment variables, however that file resides outside of the git repo.

Could that be the cause of yarn start-frontend failing with Module not found: Can't resolve './core/engine' in '/home/durapensa/simlin/src/engine

upgrade to firebase 9; drop firebase-ui

firebase 9 is supposed to enable much smaller bundles. We currently use firebase-ui, which pulls in a whole material UI lite package that is redundant with material-ui. We should ditch the ui thing (we just use it for drawing the 3 "log in with *" buttons); this should cut our bundle size down significantly.

multi-part flows

right now you can only create (or move) straight-line flows. we should be able to create flows with bends in them

array support

roughly in priority order

  • lexer + parser support for subscripts
  • simulation support for single-dimensional arrays
  • show simulation results in diagram
  • edit a2a equations
  • edit subscripted equations
  • simulation support for multi-dimensional arrays
  • lexer + parser support for transpose (') unary postfix operator
  • use dimension names in A2A equations
  • use Dimension.SubscriptName directly in equations to get the integer subscript value (1, 2, etc)
  • Apply-to-all arrays with non-apply-to-all graphical functions
  • Slicing -- A[1, *] and SUM(A[1:3])
  • "Dimension positions"

server-side support

  • create user
  • log in
  • set user name (e.g. bpowers)
  • view existing models
  • edit model
  • save model
  • leave model
  • log out

lower `xmile` structs into an intermediate representation, use that everywhere

I believe we want to end up with 3 wasm-ified libraries:

  • system-dynamics-compat: import (and eventually export) projects to XMILE + Vensim mdl formats. These will output a protobuf representation of models
  • system-dynamics-engine: load, check, and edit projects. Works on protobuf inputs (no dependencies on e.g. XML library)
  • system-dynamics-simulation: simulate models, runs in a web worker. We can keep the core engine on the main thread to simplify the concurrency story for editing, and the engine can generate bytecode and spit it over to the simulation piece to run it in a worker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.