mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Stats fixes
This commit is contained in:
parent
edfe2f3064
commit
4ea01f39b4
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// reason for no check is, that we have some mixing of typescript and chart js which seems to be not to be fixed that easy
|
// reason for no check is, that we have some mixing of typescript and chart js which seems to be not to be fixed that easy
|
||||||
import { ref, computed, onMounted } from "vue";
|
import { ref, computed, onMounted, nextTick } from "vue";
|
||||||
import { initWaterfall, setColormap } from "../../js/waterfallHandler.js";
|
import { initWaterfall, setColormap } from "../../js/waterfallHandler.js";
|
||||||
import { setActivePinia } from "pinia";
|
import { setActivePinia } from "pinia";
|
||||||
import pinia from "../../store/index";
|
import pinia from "../../store/index";
|
||||||
|
@ -168,14 +168,19 @@ const scatterChartData = computed(() => ({
|
||||||
],
|
],
|
||||||
}));
|
}));
|
||||||
var localSpectrum;
|
var localSpectrum;
|
||||||
|
//Define and generate a unique ID for canvas
|
||||||
|
const localSpectrumID = ref("");
|
||||||
|
localSpectrumID.value = "gridwfid-" + (Math.random() + 1).toString(36).substring(7);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// This code will be executed after the component is mounted to the DOM
|
// This code will be executed after the component is mounted to the DOM
|
||||||
// You can access DOM elements or perform other initialization here
|
// You can access DOM elements or perform other initialization here
|
||||||
//const myElement = this.$refs.waterfall; // Access the DOM element with ref
|
//const myElement = this.$refs.waterfall; // Access the DOM element with ref
|
||||||
|
|
||||||
// init waterfall
|
// init waterfall
|
||||||
localSpectrum = initWaterfall("waterfall-grid");
|
localSpectrum = initWaterfall(localSpectrumID.value);
|
||||||
window.addEventListener(
|
nextTick(() => {
|
||||||
|
|
||||||
|
window.addEventListener(
|
||||||
"wf-data-avail",
|
"wf-data-avail",
|
||||||
function (evt) {
|
function (evt) {
|
||||||
localSpectrum.addData(evt.detail);
|
localSpectrum.addData(evt.detail);
|
||||||
|
@ -183,6 +188,11 @@ onMounted(() => {
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
setColormap(settings.local.wf_theme.valueOf);
|
setColormap(settings.local.wf_theme.valueOf);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -336,7 +346,7 @@ onMounted(() => {
|
||||||
role="stats_tabpanel"
|
role="stats_tabpanel"
|
||||||
aria-labelledby="list-waterfall-list"
|
aria-labelledby="list-waterfall-list"
|
||||||
>
|
>
|
||||||
<canvas id="waterfall-grid" class="force-gpu"></canvas>
|
<canvas v-bind:id="localSpectrumID" class="force-gpu"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="tab-pane fade h-100 w-100"
|
class="tab-pane fade h-100 w-100"
|
||||||
|
|
|
@ -169,7 +169,7 @@ const scatterChartData = computed(() => ({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { initWaterfall } from "../js/waterfallHandler.js";
|
import { initWaterfall,setColormap } from "../js/waterfallHandler.js";
|
||||||
var localSpectrum;
|
var localSpectrum;
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -186,6 +186,11 @@ export default {
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
setColormap(settings.local.wf_theme.valueOf);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue