@opencor/opencor 0.20260416.3 → 0.20260417.0

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.
@@ -7908,7 +7908,7 @@ var Ji = null, Yi = null, Xi = null, Zi = null, Qi = null, $i = null, ea = (e) =
7908
7908
  },
7909
7909
  "./style.css": "./dist/opencor.css"
7910
7910
  },
7911
- version: "0.20260416.3",
7911
+ version: "0.20260417.0",
7912
7912
  scripts: {
7913
7913
  build: "vite build && bun scripts/generate.version.js",
7914
7914
  "build:lib": "vite build --config vite.lib.config.ts && bunx --bun vue-tsc --project tsconfig.lib.types.json",
@@ -36581,7 +36581,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
36581
36581
  }, null, 8, ["model"])
36582
36582
  ]));
36583
36583
  }
36584
- }), dC = (e) => (ae("data-v-6d8ff971"), e = e(), ie(), e), fC = { class: "h-full" }, pC = {
36584
+ }), dC = (e) => (ae("data-v-26c72025"), e = e(), ie(), e), fC = { class: "h-full" }, pC = {
36585
36585
  key: 1,
36586
36586
  class: "w-full h-full flex flex-col"
36587
36587
  }, mC = {
@@ -36647,7 +36647,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
36647
36647
  }), me();
36648
36648
  return;
36649
36649
  }
36650
- Je(!0);
36650
+ Ye(!0);
36651
36651
  }, _ = () => {
36652
36652
  let e = new Yi(), t = Sa(ve.path()).replace(/\.[^/.]+$/, ""), n = Oe.file();
36653
36653
  if (!n) {
@@ -36852,15 +36852,38 @@ var sC = { class: "flex flex-row h-full" }, cC = {
36852
36852
  voiExpression: t?.trim() || "voi",
36853
36853
  voiValues: new Float64Array(e.columns[0])
36854
36854
  });
36855
- for (let e of L.value.output.plots) {
36856
- let t = Ue(e.xValue, p), n = Ue(e.yValue, p);
36857
- t === e.xValue && n === e.yValue || (e.additionalTraces ||= [], !e.additionalTraces.some((e) => e.xValue === t && e.yValue === n) && e.additionalTraces.push({
36858
- xValue: t,
36859
- yValue: n,
36860
- name: `${n} <i>vs.</i> ${t}`
36861
- }));
36855
+ for (let e = 0; e < L.value.output.plots.length; ++e) {
36856
+ let t = L.value.output.plots[e];
36857
+ if (!t) continue;
36858
+ t.additionalTraces ||= [];
36859
+ let n = (e, t) => `${e}::${t}`, r = /* @__PURE__ */ new Set(), i = qe[e] ?? t.additionalTraces.length;
36860
+ r.add(n(t.xValue, t.yValue));
36861
+ for (let e = 0; e < i; ++e) {
36862
+ let i = t.additionalTraces[e];
36863
+ i && r.add(n(i.xValue, i.yValue));
36864
+ }
36865
+ let a = [{
36866
+ xValue: t.xValue,
36867
+ yValue: t.yValue
36868
+ }];
36869
+ for (let e = 0; e < i; ++e) {
36870
+ let n = t.additionalTraces[e];
36871
+ n && a.push({
36872
+ xValue: n.xValue,
36873
+ yValue: n.yValue
36874
+ });
36875
+ }
36876
+ for (let e = 0; e < a.length; ++e) {
36877
+ let i = a[e];
36878
+ if (!i) continue;
36879
+ let o = Ue(i.xValue, p), s = Ue(i.yValue, p);
36880
+ r.has(n(o, s)) || t.additionalTraces.push({
36881
+ xValue: o,
36882
+ yValue: s
36883
+ });
36884
+ }
36862
36885
  }
36863
- return Je(), Xe(), We.add(s), Promise.resolve(r());
36886
+ return Ye(), Ze(), We.add(s), Promise.resolve(r());
36864
36887
  } finally {
36865
36888
  Ge.delete(s);
36866
36889
  }
@@ -36902,10 +36925,15 @@ var sC = { class: "flex flex-row h-full" }, cC = {
36902
36925
  }
36903
36926
  });
36904
36927
  let Ke = e.computed(() => a.simulationOnly && Ee.value || !a.simulationOnly);
36905
- F && (h(Ce, F), h(we, F, !0)), b(), e.watch(() => L.value, () => {
36906
- De.resetCompiledExpressions();
36907
- }, { deep: !0 });
36908
- let qe = (e, t) => {
36928
+ F && (h(Ce, F), h(we, F, !0)), b();
36929
+ let qe = [];
36930
+ e.watch(() => L.value, () => {
36931
+ De.resetCompiledExpressions(), qe = L.value.output.plots.map((e) => e.additionalTraces?.length ?? 0);
36932
+ }, {
36933
+ deep: !0,
36934
+ immediate: !0
36935
+ });
36936
+ let Je = (e, t) => {
36909
36937
  let n = e.length, r = new Float64Array(n), { x: i, y: a } = t, o = Math.min(i.length, a.length);
36910
36938
  if (o < 2) return r.fill(NaN), r;
36911
36939
  let s = !0;
@@ -36970,7 +36998,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
36970
36998
  r[t] = l[i] + (n - c[i]) * o;
36971
36999
  }
36972
37000
  return r;
36973
- }, Je = (e = !1) => {
37001
+ }, Ye = (e = !1) => {
36974
37002
  if (Me.value.length || !ge.value && !e) return;
36975
37003
  let t = {};
36976
37004
  for (let e = 0; e < L.value.input.length; ++e) {
@@ -37022,7 +37050,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37022
37050
  for (let e of r.dataSeries) s.has(e.name) && (c[e.name] = e.values);
37023
37051
  for (let n of r.data) {
37024
37052
  let r = c[n.name];
37025
- r && (t[n.id] = qe(e, {
37053
+ r && (t[n.id] = Je(e, {
37026
37054
  x: o,
37027
37055
  y: r
37028
37056
  }));
@@ -37148,7 +37176,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37148
37176
  return;
37149
37177
  }
37150
37178
  p("simulationData");
37151
- }, Ye = (e, t) => {
37179
+ }, Xe = (e, t) => {
37152
37180
  Ae[e] = t;
37153
37181
  let n = 0, r = 0, i = 0;
37154
37182
  for (let e in Ae) {
@@ -37163,9 +37191,9 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37163
37191
  left: r,
37164
37192
  right: i
37165
37193
  };
37166
- }, Xe = () => {
37167
- Ae = {}, je.value = void 0;
37168
37194
  }, Ze = () => {
37195
+ Ae = {}, je.value = void 0;
37196
+ }, Qe = () => {
37169
37197
  let e = {};
37170
37198
  for (let t = 0; t < L.value.input.length; ++t) {
37171
37199
  let n = L.value.input[t];
@@ -37215,39 +37243,39 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37215
37243
  tooltip: n,
37216
37244
  isLiveRun: !1
37217
37245
  });
37218
- }, Qe = (e) => {
37246
+ }, $e = (e) => {
37219
37247
  R.value.splice(e, 1);
37220
- }, $e = () => {
37248
+ }, et = () => {
37221
37249
  R.value.splice(1);
37222
- }, et = (e) => {
37250
+ }, tt = (e) => {
37223
37251
  let t = R.value[e];
37224
37252
  t && (t.isVisible = !t.isVisible);
37225
- }, tt = (e, t) => {
37253
+ }, nt = (e, t) => {
37226
37254
  let n = R.value[e];
37227
37255
  n && (n.color = t);
37228
- }, nt = (t, n) => {
37256
+ }, rt = (t, n) => {
37229
37257
  B.value = t, e.nextTick(() => {
37230
37258
  Le.value[t]?.toggle(n);
37231
37259
  });
37232
- }, rt = (t) => {
37260
+ }, it = (t) => {
37233
37261
  let n = JSON.stringify(e.toRaw(t)), r = n !== Ve.value;
37234
37262
  if (Ve.value = n, !r) {
37235
37263
  _e.value = !1;
37236
37264
  return;
37237
37265
  }
37238
- $e();
37266
+ et();
37239
37267
  let i = xe.maximumStep();
37240
37268
  be.setInitialTime(t.simulation.startingPoint), be.setOutputStartTime(t.simulation.startingPoint), be.setOutputEndTime(t.simulation.endingPoint), be.setNumberOfSteps(Math.max(1, Math.round((t.simulation.endingPoint - t.simulation.startingPoint) / t.simulation.pointInterval))), xe.setMaximumStep(t.solvers.cvodeMaximumStep), L.value = Oo(t.interactive.uiJson), ge.value = t.miscellaneous.liveUpdates, _e.value = !1, Me.value = Ao(t.interactive.uiJson, {
37241
37269
  allModelParameters: Ce.value,
37242
37270
  editableModelParameters: we.value
37243
- }), !(Me.value.length > 0) && (xe.maximumStep() !== i && (Se = ye.instantiate(), F = Se.task(0)), b(), Je(), !Ne.value.length && Xe());
37271
+ }), !(Me.value.length > 0) && (xe.maximumStep() !== i && (Se = ye.instantiate(), F = Se.task(0)), b(), Ye(), !Ne.value.length && Ze());
37244
37272
  };
37245
37273
  e.onMounted(() => {
37246
- me(), Je();
37274
+ me(), Ye();
37247
37275
  });
37248
- let it = _f();
37276
+ let at = _f();
37249
37277
  return e.onMounted(() => {
37250
- e.watch(() => it.value, (e) => {
37278
+ e.watch(() => at.value, (e) => {
37251
37279
  e || B.value !== -1 && (Le.value[B.value]?.hide(), B.value = -1);
37252
37280
  });
37253
37281
  }), da() && hf((e) => {
@@ -37315,7 +37343,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37315
37343
  possibleValues: wo(e) ? e.possibleValues : void 0,
37316
37344
  stepValue: Co(e) ? e.stepValue : void 0,
37317
37345
  class: S(t === 0 ? "" : "mt-6"),
37318
- onChange: n[6] ||= (e) => Je()
37346
+ onChange: n[6] ||= (e) => Ye()
37319
37347
  }, null, 8, [
37320
37348
  "modelValue",
37321
37349
  "onUpdate:modelValue",
@@ -37336,7 +37364,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37336
37364
  outlined: "",
37337
37365
  size: "small",
37338
37366
  title: "Track current run",
37339
- onClick: Ze
37367
+ onClick: Qe
37340
37368
  }), f(i, {
37341
37369
  class: "w-9!",
37342
37370
  icon: "pi pi-trash",
@@ -37344,7 +37372,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37344
37372
  severity: "danger",
37345
37373
  size: "small",
37346
37374
  title: "Remove all tracked runs",
37347
- onClick: $e,
37375
+ onClick: et,
37348
37376
  disabled: M(R).length === 1
37349
37377
  }, null, 8, ["disabled"])]),
37350
37378
  l("div", wC, [(w(!0), c(t, null, E(M(R), (e, n) => (w(), c("div", {
@@ -37374,7 +37402,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37374
37402
  size: "small",
37375
37403
  style: te(`color: ${e.color};`),
37376
37404
  title: `Change ${e.isLiveRun ? "live run" : "run"} colour`,
37377
- onClick: (e) => nt(n, e)
37405
+ onClick: (e) => rt(n, e)
37378
37406
  }, null, 8, [
37379
37407
  "style",
37380
37408
  "title",
@@ -37390,7 +37418,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37390
37418
  key: r,
37391
37419
  style: te(`background-color: ${r};`),
37392
37420
  title: t,
37393
- onClick: (e) => tt(n, r)
37421
+ onClick: (e) => nt(n, r)
37394
37422
  }, null, 14, OC))), 128))])]),
37395
37423
  _: 2
37396
37424
  }, 1536)) : s("", !0),
@@ -37401,7 +37429,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37401
37429
  severity: e.isVisible ? "info" : "secondary",
37402
37430
  size: "small",
37403
37431
  title: `${e.isVisible ? "Hide" : "Show"} ${e.isLiveRun ? "live run" : "run"}`,
37404
- onClick: (e) => et(n)
37432
+ onClick: (e) => tt(n)
37405
37433
  }, null, 8, [
37406
37434
  "icon",
37407
37435
  "severity",
@@ -37416,7 +37444,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37416
37444
  severity: "danger",
37417
37445
  size: "small",
37418
37446
  title: "Remove run",
37419
- onClick: (e) => Qe(n)
37447
+ onClick: (e) => $e(n)
37420
37448
  }, null, 8, ["onClick"]))
37421
37449
  ])
37422
37450
  ])], 2))), 128))]),
@@ -37432,8 +37460,8 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37432
37460
  class: "w-full min-h-0",
37433
37461
  margins: M(je),
37434
37462
  data: M(ze)[t] || { traces: [] },
37435
- onMarginsUpdated: (e) => Ye(`plot_${t}`, e),
37436
- onResetMargins: n[7] ||= () => Xe()
37463
+ onMarginsUpdated: (e) => Xe(`plot_${t}`, e),
37464
+ onResetMargins: n[7] ||= () => Ze()
37437
37465
  }, null, 8, [
37438
37466
  "margins",
37439
37467
  "data",
@@ -37525,7 +37553,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37525
37553
  voiUnit: M(F) ? M(F).voiUnit() : "",
37526
37554
  allModelParameters: M(Ce),
37527
37555
  editableModelParameters: M(we),
37528
- onOk: rt,
37556
+ onOk: it,
37529
37557
  onClose: n[9] ||= (e) => _e.value = !1
37530
37558
  }, null, 8, [
37531
37559
  "visible",
@@ -37539,7 +37567,7 @@ var sC = { class: "flex flex-row h-full" }, cC = {
37539
37567
  ]))]);
37540
37568
  };
37541
37569
  }
37542
- }), [["__scopeId", "data-v-6d8ff971"]]), PC = {
37570
+ }), [["__scopeId", "data-v-26c72025"]]), PC = {
37543
37571
  key: 0,
37544
37572
  class: "h-full"
37545
37573
  }, FC = ["value"], IC = {
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "./style.css": "./dist/opencor.css"
44
44
  },
45
- "version": "0.20260416.3",
45
+ "version": "0.20260417.0",
46
46
  "scripts": {
47
47
  "build": "vite build && bun scripts/generate.version.js",
48
48
  "build:lib": "vite build --config vite.lib.config.ts && bunx --bun vue-tsc --project tsconfig.lib.types.json",