Skip to content

Commit

Permalink
Added the ability to run CellML-based simulations using libOpenCOR.
Browse files Browse the repository at this point in the history
This relies on libOpenCOR's WASM module which is, for now, part of `SimulationVuer`.
  • Loading branch information
agarny authored Jul 9, 2024
2 parents 595ed45 + bb84c46 commit 884308e
Show file tree
Hide file tree
Showing 11 changed files with 671 additions and 328 deletions.
94 changes: 86 additions & 8 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abi-software/simulationvuer",
"version": "1.0.0",
"version": "2.0.0",
"private": false,
"scripts": {
"serve": "vite serve --host",
Expand All @@ -16,6 +16,7 @@
"@abi-software/plotvuer": "^1.0.0",
"element-plus": "^2.5.3",
"jsonschema": "^1.4.0",
"mathjs": "^13.0.2",
"unplugin-vue-components": "^0.26.0",
"vue": "^3.4.15"
},
Expand Down
35 changes: 24 additions & 11 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
<div class="app">
<h1>SimulationVuer</h1>
<el-radio-group v-model="id" size="small">
<el-radio-button :class="className(dataset.id)" v-for="dataset in datasets" v-bind:key="dataset.id" :label="dataset.id" />
<el-radio-button :class="className(dataset.id)" v-for="dataset in datasets" v-bind:key="dataset.id" :label="dataset.label" :value="dataset.id" />
</el-radio-group>
</div>
<hr />
<div v-for="dataset in datasets" v-bind:key="dataset.id">
<div v-if="initialised(dataset.id)" v-show="dataset.id == id">
<span>
<span v-if="typeof dataset.id === 'number'">
<strong>Dataset <a :href="datasetUrl(dataset.id)" target="_blank">{{ dataset.id }}</a>:</strong> {{ dataset.description }}
</span>
<span v-if="typeof dataset.id !== 'number'">
<strong>ISAN:</strong> {{ dataset.description }} {{ typeof dataset.id }}
</span>
<hr />
<SimulationVuer :apiLocation="apiLocation" :id="dataset.id" />
<SimulationVuer :apiLocation="apiLocation" :id="dataset.id" :preferredSolver="dataset.preferredSolver" style="height: 640px;" />
</div>
</div>
<hr />
Expand All @@ -35,20 +38,24 @@ export default {
return {
apiLocation: import.meta.env.VITE_API_LOCATION,
datasets: [
{ id: 0, description: "Non-simulation dataset", },
{ id: 135, description: "Computational analysis of the human sinus node action potential - Model development and effects of mutations", },
{ id: 157, description: "Fabbri-based composite SAN model", },
{ id: 308, description: "Kember Cardiac Nerve Model", },
{ id: 318, description: "Multi-scale rabbit cardiac electrophysiology models", },
{ id: 320, description: "Multi-scale human cardiac electrophysiology models", },
{ id: 0, label: "0", description: "Non-simulation dataset", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ id: 135, label: "135", description: "Computational analysis of the human sinus node action potential - Model development and effects of mutations", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ id: 157, label: "157", description: "Fabbri-based composite SAN model", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ id: 308, label: "308", description: "Kember Cardiac Nerve Model", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ id: 318, label: "318", description: "Multi-scale rabbit cardiac electrophysiology models", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ id: 320, label: "320", description: "Multi-scale human cardiac electrophysiology models", preferredSolver: SimulationVuer.OSPARC_SOLVER },
{ 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 },
{ 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 },
{ 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 },
{ 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 },
],
id: 0,
ready: [],
};
},
methods: {
className(id) {
return (id == this.datasets[0].id)?"first-dataset":"";
return (id == this.datasets[0].id) ? "first-dataset" : "";
},
datasetUrl(id) {
return `https://sparc.science/datasets/${id}?type=dataset`;
Expand All @@ -75,26 +82,32 @@ export default {
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
.el-radio-button__inner {
background-color: #f9f2fc;
border-color: #8300bf;
box-shadow: -1px 0 0 0 #8300bf !important;
color: #8300bf;
}
.first-dataset > .el-radio-button__inner {
.first-dataset>.el-radio-button__inner {
border-left: 1px solid #8300bf !important;
}
.el-radio-button__original-radio:checked+.el-radio-button__inner {
background-color: #8300bf;
border-color: #8300bf;
color: white;
}
.el-radio-button__inner:hover {
color: #8300bf;
}
a {
color: #2c3e50;
}
div.app {
text-align: center;
}
Expand Down
Loading

0 comments on commit 884308e

Please sign in to comment.