Skip to content

Commit 884308e

Browse files
authored
Added the ability to run CellML-based simulations using libOpenCOR.
This relies on libOpenCOR's WASM module which is, for now, part of `SimulationVuer`.
2 parents 595ed45 + bb84c46 commit 884308e

11 files changed

+671
-328
lines changed

package-lock.json

Lines changed: 86 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@abi-software/simulationvuer",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"private": false,
55
"scripts": {
66
"serve": "vite serve --host",
@@ -16,6 +16,7 @@
1616
"@abi-software/plotvuer": "^1.0.0",
1717
"element-plus": "^2.5.3",
1818
"jsonschema": "^1.4.0",
19+
"mathjs": "^13.0.2",
1920
"unplugin-vue-components": "^0.26.0",
2021
"vue": "^3.4.15"
2122
},

src/App.vue

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
<div class="app">
44
<h1>SimulationVuer</h1>
55
<el-radio-group v-model="id" size="small">
6-
<el-radio-button :class="className(dataset.id)" v-for="dataset in datasets" v-bind:key="dataset.id" :label="dataset.id" />
6+
<el-radio-button :class="className(dataset.id)" v-for="dataset in datasets" v-bind:key="dataset.id" :label="dataset.label" :value="dataset.id" />
77
</el-radio-group>
88
</div>
99
<hr />
1010
<div v-for="dataset in datasets" v-bind:key="dataset.id">
1111
<div v-if="initialised(dataset.id)" v-show="dataset.id == id">
12-
<span>
12+
<span v-if="typeof dataset.id === 'number'">
1313
<strong>Dataset <a :href="datasetUrl(dataset.id)" target="_blank">{{ dataset.id }}</a>:</strong> {{ dataset.description }}
1414
</span>
15+
<span v-if="typeof dataset.id !== 'number'">
16+
<strong>ISAN:</strong> {{ dataset.description }} {{ typeof dataset.id }}
17+
</span>
1518
<hr />
16-
<SimulationVuer :apiLocation="apiLocation" :id="dataset.id" />
19+
<SimulationVuer :apiLocation="apiLocation" :id="dataset.id" :preferredSolver="dataset.preferredSolver" style="height: 640px;" />
1720
</div>
1821
</div>
1922
<hr />
@@ -35,20 +38,24 @@ export default {
3538
return {
3639
apiLocation: import.meta.env.VITE_API_LOCATION,
3740
datasets: [
38-
{ id: 0, description: "Non-simulation dataset", },
39-
{ id: 135, description: "Computational analysis of the human sinus node action potential - Model development and effects of mutations", },
40-
{ id: 157, description: "Fabbri-based composite SAN model", },
41-
{ id: 308, description: "Kember Cardiac Nerve Model", },
42-
{ id: 318, description: "Multi-scale rabbit cardiac electrophysiology models", },
43-
{ id: 320, description: "Multi-scale human cardiac electrophysiology models", },
41+
{ id: 0, label: "0", description: "Non-simulation dataset", preferredSolver: SimulationVuer.OSPARC_SOLVER },
42+
{ id: 135, label: "135", description: "Computational analysis of the human sinus node action potential - Model development and effects of mutations", preferredSolver: SimulationVuer.OSPARC_SOLVER },
43+
{ id: 157, label: "157", description: "Fabbri-based composite SAN model", preferredSolver: SimulationVuer.OSPARC_SOLVER },
44+
{ id: 308, label: "308", description: "Kember Cardiac Nerve Model", preferredSolver: SimulationVuer.OSPARC_SOLVER },
45+
{ id: 318, label: "318", description: "Multi-scale rabbit cardiac electrophysiology models", preferredSolver: SimulationVuer.OSPARC_SOLVER },
46+
{ id: 320, label: "320", description: "Multi-scale human cardiac electrophysiology models", preferredSolver: SimulationVuer.OSPARC_SOLVER },
47+
{ id: "workspace/b7c/rawfile/00e2d3c7774bb66400b5c925e43181d775695417/135.omex", label: "ISAN-135", description: "Example of a COMBINE archive with a simulation UI file", preferredSolver: SimulationVuer.LIBOPENCOR_SOLVER },
48+
{ id: "workspace/b7c/rawfile/00e2d3c7774bb66400b5c925e43181d775695417/157.omex", label: "ISAN-157", description: "Example of a COMBINE archive with a simulation UI file", preferredSolver: SimulationVuer.LIBOPENCOR_SOLVER },
49+
{ id: "workspace/b7c/rawfile/00e2d3c7774bb66400b5c925e43181d775695417/lorenz.omex", label: "ISAN-Lorenz", description: "Example of a COMBINE archive with a simulation UI file", preferredSolver: SimulationVuer.LIBOPENCOR_SOLVER },
50+
{ id: "workspace/b7c/rawfile/00e2d3c7774bb66400b5c925e43181d775695417/tt04.omex", label: "ISAN-TT04", description: "Example of a COMBINE archive with a simulation UI file", preferredSolver: SimulationVuer.LIBOPENCOR_SOLVER },
4451
],
4552
id: 0,
4653
ready: [],
4754
};
4855
},
4956
methods: {
5057
className(id) {
51-
return (id == this.datasets[0].id)?"first-dataset":"";
58+
return (id == this.datasets[0].id) ? "first-dataset" : "";
5259
},
5360
datasetUrl(id) {
5461
return `https://sparc.science/datasets/${id}?type=dataset`;
@@ -75,26 +82,32 @@ export default {
7582
-moz-osx-font-smoothing: grayscale;
7683
color: #2c3e50;
7784
}
85+
7886
.el-radio-button__inner {
7987
background-color: #f9f2fc;
8088
border-color: #8300bf;
8189
box-shadow: -1px 0 0 0 #8300bf !important;
8290
color: #8300bf;
8391
}
84-
.first-dataset > .el-radio-button__inner {
92+
93+
.first-dataset>.el-radio-button__inner {
8594
border-left: 1px solid #8300bf !important;
8695
}
96+
8797
.el-radio-button__original-radio:checked+.el-radio-button__inner {
8898
background-color: #8300bf;
8999
border-color: #8300bf;
90100
color: white;
91101
}
102+
92103
.el-radio-button__inner:hover {
93104
color: #8300bf;
94105
}
106+
95107
a {
96108
color: #2c3e50;
97109
}
110+
98111
div.app {
99112
text-align: center;
100113
}

0 commit comments

Comments
 (0)