@abi-software/simulationvuer 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/simulationvuer.common.js +125 -1619
- package/dist/simulationvuer.common.js.map +1 -1
- package/dist/simulationvuer.css +1 -1
- package/dist/simulationvuer.umd.js +125 -1619
- package/dist/simulationvuer.umd.js.map +1 -1
- package/dist/simulationvuer.umd.min.js +1 -6
- package/dist/simulationvuer.umd.min.js.map +1 -1
- package/package-lock.json +327 -207
- package/package.json +3 -4
- package/src/components/SimulationVuer.vue +25 -14
- package/src/components/SimulationVuerInput.vue +1 -1
- package/src/components/common.js +1 -1
- package/src/components/ui.js +9 -10
- package/vue.config.js +2 -2
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/simulationvuer",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve --mode static",
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
"lint": "vue-cli-service lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@abi-software/plotvuer": "^0.2.
|
|
12
|
+
"@abi-software/plotvuer": "^0.2.46",
|
|
13
13
|
"element-ui": "^2.14.1",
|
|
14
14
|
"jsonschema": "^1.4.0",
|
|
15
|
-
"vue": "^2.6.11"
|
|
16
|
-
"vue2-perfect-scrollbar": "^1.5.5"
|
|
15
|
+
"vue": "^2.6.11"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
18
|
"@vue/cli-plugin-babel": "~4.5.0",
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
<p class="default name">{{name}}</p>
|
|
7
7
|
<el-divider></el-divider>
|
|
8
8
|
<p class="default input-parameters">Input parameters</p>
|
|
9
|
-
<div class="input
|
|
10
|
-
<
|
|
11
|
-
<SimulationVuerInput v-for="(input, index) in simulationUiInfo.input" :defaultValue="input.defaultValue" :key="`input-${index}`" :name="input.name" :maximumValue="input.maximumValue" :minimumValue="input.minimumValue" :possibleValues="input.possibleValues" :stepValue="input.stepValue" />
|
|
12
|
-
</PerfectScrollbar>
|
|
9
|
+
<div class="input scrollbar">
|
|
10
|
+
<SimulationVuerInput v-for="(input, index) in simulationUiInfo.input" :defaultValue="input.defaultValue" :key="`input-${index}`" :name="input.name" :maximumValue="input.maximumValue" :minimumValue="input.minimumValue" :possibleValues="input.possibleValues" :stepValue="input.stepValue" />
|
|
13
11
|
</div>
|
|
14
12
|
<div class="primary-button">
|
|
15
13
|
<el-button type="primary" size="mini" @click="startSimulation()">Run Simulation</el-button>
|
|
@@ -41,13 +39,10 @@ import { Button, Divider, Loading } from "element-ui";
|
|
|
41
39
|
import { evaluateValue, evaluateSimulationValue, OPENCOR_SOLVER_NAME } from "./common.js";
|
|
42
40
|
import { validJson } from "./json.js";
|
|
43
41
|
import { initialiseUi, finaliseUi } from "./ui.js";
|
|
44
|
-
import PerfectScrollbar from "vue2-perfect-scrollbar";
|
|
45
|
-
import "vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css";
|
|
46
42
|
|
|
47
43
|
Vue.use(Button);
|
|
48
44
|
Vue.use(Divider);
|
|
49
45
|
Vue.use(Loading.directive);
|
|
50
|
-
Vue.use(PerfectScrollbar);
|
|
51
46
|
|
|
52
47
|
export default {
|
|
53
48
|
name: "SimulationVuer",
|
|
@@ -70,7 +65,7 @@ export default {
|
|
|
70
65
|
let name = undefined;
|
|
71
66
|
let uuid = undefined;
|
|
72
67
|
|
|
73
|
-
xmlhttp.open("GET", this.apiLocation + "/sim/dataset/" + this.id
|
|
68
|
+
xmlhttp.open("GET", this.apiLocation + "/sim/dataset/" + this.id, false);
|
|
74
69
|
xmlhttp.setRequestHeader("Content-type", "application/json");
|
|
75
70
|
xmlhttp.onreadystatechange = () => {
|
|
76
71
|
if (xmlhttp.readyState === 4) {
|
|
@@ -399,7 +394,7 @@ export default {
|
|
|
399
394
|
}
|
|
400
395
|
::v-deep .el-divider {
|
|
401
396
|
margin: -8px 0 8px 0 !important;
|
|
402
|
-
width:
|
|
397
|
+
width: 210px;
|
|
403
398
|
}
|
|
404
399
|
::v-deep .el-loading-spinner {
|
|
405
400
|
.path {
|
|
@@ -410,15 +405,13 @@ export default {
|
|
|
410
405
|
}
|
|
411
406
|
}
|
|
412
407
|
div.input {
|
|
408
|
+
border: 1px solid #dcdfe6;
|
|
413
409
|
padding: 4px;
|
|
414
410
|
height: 300px;
|
|
415
411
|
}
|
|
416
|
-
div.input-frame {
|
|
417
|
-
border: 1px solid #dcdfe6;
|
|
418
|
-
}
|
|
419
412
|
div.main {
|
|
420
413
|
display: grid;
|
|
421
|
-
--mainLeftWidth:
|
|
414
|
+
--mainLeftWidth: 243px;
|
|
422
415
|
grid-template-columns: var(--mainLeftWidth) calc(100% - var(--mainLeftWidth));
|
|
423
416
|
height: 100%;
|
|
424
417
|
}
|
|
@@ -462,7 +455,7 @@ div.primary-button,
|
|
|
462
455
|
div.secondary-button {
|
|
463
456
|
display: flex;
|
|
464
457
|
justify-content: flex-end;
|
|
465
|
-
width:
|
|
458
|
+
width: 210px;
|
|
466
459
|
}
|
|
467
460
|
div.primary-button {
|
|
468
461
|
margin-top: 14px;
|
|
@@ -486,6 +479,24 @@ div.secondary-button .el-button:hover {
|
|
|
486
479
|
background-color: #f9f2fc;
|
|
487
480
|
color: #8300bf;
|
|
488
481
|
}
|
|
482
|
+
div.scrollbar {
|
|
483
|
+
overflow-y: scroll;
|
|
484
|
+
scrollbar-width: thin;
|
|
485
|
+
}
|
|
486
|
+
div.scrollbar::-webkit-scrollbar {
|
|
487
|
+
width: 8px;
|
|
488
|
+
right: -8px;
|
|
489
|
+
background-color: #f5f5f5;
|
|
490
|
+
}
|
|
491
|
+
div.scrollbar::-webkit-scrollbar-thumb {
|
|
492
|
+
border-radius: 4px;
|
|
493
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
494
|
+
background-color: #979797;
|
|
495
|
+
}
|
|
496
|
+
div.scrollbar::-webkit-scrollbar-track {
|
|
497
|
+
border-radius: 10px;
|
|
498
|
+
background-color: #f5f5f5;
|
|
499
|
+
}
|
|
489
500
|
div.simulation-vuer {
|
|
490
501
|
height: 100%;
|
|
491
502
|
}
|
package/src/components/common.js
CHANGED
|
@@ -16,7 +16,7 @@ export function evaluateValue(parent, value) {
|
|
|
16
16
|
parent.simulationUiInfo.input.forEach((input) => {
|
|
17
17
|
++index;
|
|
18
18
|
|
|
19
|
-
value = doEvaluateValue(value, input.id, parent.$
|
|
19
|
+
value = doEvaluateValue(value, input.id, parent.$children[index].vModel);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
return Function("return " + value + ";")();
|
package/src/components/ui.js
CHANGED
|
@@ -13,6 +13,14 @@ export function initialiseUi(parent) {
|
|
|
13
13
|
++index;
|
|
14
14
|
|
|
15
15
|
parent.layout[index] = {
|
|
16
|
+
margin: {
|
|
17
|
+
t: 5,
|
|
18
|
+
l: 55,
|
|
19
|
+
r: 55,
|
|
20
|
+
b: 90,
|
|
21
|
+
pad: 4
|
|
22
|
+
},
|
|
23
|
+
dragmode: "pan",
|
|
16
24
|
xaxis: {
|
|
17
25
|
title: {
|
|
18
26
|
text: outputPlot.xAxisTitle,
|
|
@@ -48,15 +56,6 @@ export function finaliseUi(parent) {
|
|
|
48
56
|
|
|
49
57
|
updateUi(parent);
|
|
50
58
|
|
|
51
|
-
// Make sure that the (vertical) scrollbar's thumb is of the right length.
|
|
52
|
-
// Note: it may indeed be of the incorrect length if we hid some components
|
|
53
|
-
// in updateUi().
|
|
54
|
-
|
|
55
|
-
parent.$nextTick(() => {
|
|
56
|
-
parent.$refs.input.$el.scroll(0, 1);
|
|
57
|
-
parent.$refs.input.$el.scroll(0, -1);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
59
|
parent.hasFinalisedUi = true;
|
|
61
60
|
}
|
|
62
61
|
}
|
|
@@ -72,7 +71,7 @@ export function updateUi(parent) {
|
|
|
72
71
|
parent.simulationUiInfo.input.forEach((input) => {
|
|
73
72
|
++index;
|
|
74
73
|
|
|
75
|
-
parent.$
|
|
74
|
+
parent.$children[index].visible = (input.visible === undefined)?true:evaluateValue(parent, input.visible);
|
|
76
75
|
});
|
|
77
76
|
});
|
|
78
77
|
}
|
package/vue.config.js
CHANGED
|
@@ -3,7 +3,7 @@ const nodeExternals = require('webpack-node-externals');
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
configureWebpack: config => {
|
|
5
5
|
if (process.env.NODE_ENV === 'production') {
|
|
6
|
-
config.externals = [ nodeExternals({allowlist: [/^element-ui/, "@abi-software/plotvuer"
|
|
6
|
+
config.externals = [ nodeExternals({allowlist: [/^element-ui/, "@abi-software/plotvuer"]}) ];
|
|
7
7
|
}
|
|
8
8
|
},
|
|
9
9
|
chainWebpack: config => {
|
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
|
15
15
|
.use('base64-inline-loader')
|
|
16
16
|
.loader('base64-inline-loader')
|
|
17
17
|
.tap(options => {
|
|
18
|
-
// modify the options...
|
|
18
|
+
// modify the options...
|
|
19
19
|
return options
|
|
20
20
|
})
|
|
21
21
|
.end()
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/components/.DS_Store
DELETED
|
Binary file
|