Skip to content

SimulationVuer ​

SimulationVuer

Props ​

NameDescriptionTypeRequiredDefault
apiLocationThe URL of a running copy of the SPARC API.Stringtrue-
idEither:
  • the id of a SPARC simulation-based dataset (as a Number, e.g., 135);
  • the PMR path to an OMEX file (as a String, e.g., workspace/b7c/rawfile/e0ae8d2d56aaaa091e23e1ee7e84cacbda1dfb6b/135.omex);
  • the direct URL to an OMEX file (as a String, e.g., https://raw.githubusercontent.com/opencor/webapp/refs/heads/main/tests/models/ui/135.omex); or
  • a raw OMEX file (as a Uint8Array).
  • Number / String / Uint8Arraytrue-

    Events ​

    Event NameDescriptionParameters
    externalData--
    file--
    data-notification--
    simulationData--

    Methods ​

    MethodDescriptionParameters
    addDataSubscriptionAdd a data subscription.subscription
    addExternalDataAdd external data to the OpenCOR simulation.csv A CSV string or URL for the external data. voiExpression Optional VOI expression to map the data. modelParameters An array of model parameter identifiers.
    removeDataSubscriptionRemove a data subscription.subscriptionId
    onExternalDataLet the outside world know that we have received some external data from OpenCOR by emitting an externalData event.event
    onFileLet the outside world know that we have received a file from OpenCOR by emitting a file event.event
    onSimulationDataLet the outside world know that we have received some simulation data from OpenCOR by emitting a simulationData event, as well as a data-notification event.event
    plotMetadataGenerate the metadata associated with the plot which index is given.index
    buildSimulationUiBuild the simulation UI using simulationUiInfo, a JSON object that describes the contents of the simulation UI.simulationUiInfo
    runOnOsparcRun the simulation-based dataset directly on oSPARC. Not all simulation-based datasets can be run directly on oSPARC, but for those that can the simulation UI shows a Run on oSPARC button which, when clicked, calls this method.-
    viewDatasetView the simulation-based dataset on the SPARC portal. The simulation UI has a View Dataset button which, when clicked, calls this method.-
    viewWorkspaceView the simulation-based dataset on PMR. The simulation UI has a View Workspace button which, when clicked, calls this method.-
    parametersDataData needed to set a model's parameters.-
    outputDataData needed to specify the model output.-
    retrieveRequestCreate the request that is going to be used by startSimulation to ask oSPARC to start the simulation.-
    processSimulationResultsProcess the simulation results retrieved by checkSimulation. The simulation results are post-processed, if needed, and then readied for use by PlotVuer.results
    showHttpIssueShow an HTTP issue using the given xmlhttp.xmlhttp
    checkSimulationCheck the progress of the simulation using the given data, a JSON object that contains the simulation job ID, as well as the solver name and version. This method is first called by startSimulation and then every second by itself until the simulation is finished.data
    startSimulationStart the simulation associated with the simulation-based dataset. The simulation UI has a Run Simulation button which, when clicked, calls this method.-