Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
/ port Public archive

Port. Web UI for JavaScript methods, Python scripts and ML models

Notifications You must be signed in to change notification settings

statsim/port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Port.js

Port is a highly opinionated GUI wrapper for processing tasks. Not even close to R's shiny or Python's streamlit. Mostly used in StatSim Apps.

Conceptual model

Port takes a schema object that contains four main blocks:

  • model - defines a computation part
  • render - visualization part (optional)
  • design - overall appearance (optional)
  • inputs - list of inputs and their descriptions (optional)
  • outputs - list of outputs and their descriptions (optional)

Config/schema object

  • model - Contains main parameters of the model/script
    • url (string) - URL of a JS/Python file to load, or:
    • code (function) - It's possible to pass code to a Port object instead of an url
    • name (string) - Name of the callable object. Default value is taken from url or code
    • autorun (boolean, default - false) - Defines if the script should be evaluated on each input change
    • type (string) - What kind of script is loaded. Influences how the code is initializated. Possible values:
      • function (default)
      • class
      • async-function
      • async-init
      • py
      • tf
    • method (string) - If type is class, defines the name of the class method to call during evaluation
    • container (string) - How input values are passed to the function/method:
      • object (default) - Pass inputs wrapped in an object, i.e. {'x': 1, 'y': 2}
      • args - Pass inputs as separate arguments
    • worker (boolean) - If true the script will be run in a Web Worker

About

Port. Web UI for JavaScript methods, Python scripts and ML models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published