Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abi-software/simulationvuer",
"version": "3.0.17",
"version": "3.0.18",
"private": false,
"scripts": {
"serve": "vite serve --host --force",
Expand All @@ -21,7 +21,7 @@
},
"dependencies": {
"@abi-software/plotvuer": "1.0.7",
"@opencor/opencor": "^0.20260416.0",
"@opencor/opencor": "^0.20260416.2",
"element-plus": "2.8.4",
"jsonschema": "^1.4.0",
"mathjs": "^15.1.0",
Expand Down
39 changes: 38 additions & 1 deletion src/components/SimulationVuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
ref="opencorRef"
:omex="opencorOmexFile"
theme="light"
@externalData="onExternalData($event)"
@file="onFile($event)"
@simulationData="onSimulationData($event)"
/>
</div>
Expand Down Expand Up @@ -339,6 +341,22 @@ export default {

this.$refs.opencorRef?.trackSimulationData(modelParameters);
},
/**
* @public
* Add external data to the OpenCOR simulation.
* @param `csv` A CSV string or URL for the external data.
* @param `voiExpression` Optional VOI expression to map the data.
* @param `modelParameters` An array of model parameter identifiers.
*/
addExternalData(csv, voiExpression, modelParameters) {
if (!this.$refs.opencorRef?.addExternalData) {
return Promise.reject(
new Error("SimulationVuer: OpenCOR instance is not available."),
);
}

return this.$refs.opencorRef.addExternalData(csv, voiExpression, modelParameters);
Comment thread
agarny marked this conversation as resolved.
},
/**
* @public
* Remove a data subscription.
Expand Down Expand Up @@ -410,7 +428,24 @@ export default {
},
/**
* @public
* Let the outside world know that we have received some simulation data from OpenCOR by emitting a `data-notification` event.
* Let the outside world know that we have received some external data from OpenCOR by emitting an `externalData` event.
* @param `event`
*/
onExternalData(event) {
this.$emit("externalData", event);
},
/**
* @public
* Let the outside world know that we have received a file from OpenCOR by emitting a `file` event.
* @param `event`
*/
onFile(event) {
this.$emit("file", event);
},
/**
* @public
* Let 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.
* @param `event`
*/
onSimulationData(event) {
Expand Down Expand Up @@ -455,6 +490,8 @@ export default {
data,
},
});

this.$emit("simulationData", event);
});
Comment thread
agarny marked this conversation as resolved.
},
/**
Expand Down
Loading