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.
Port takes a schema object that contains four main blocks:
model
- defines a computation partrender
- visualization part (optional)design
- overall appearance (optional)inputs
- list of inputs and their descriptions (optional)outputs
- list of outputs and their descriptions (optional)
model
- Contains main parameters of the model/scripturl
(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 urlname
(string) - Name of the callable object. Default value is taken fromurl
orcode
autorun
(boolean, default -false
) - Defines if the script should be evaluated on each input changetype
(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) - Iftype
isclass
, defines the name of the class method to call during evaluationcontainer
(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) - Iftrue
the script will be run in a Web Worker