From e5b983979162cfadb628a835f666278700414e64 Mon Sep 17 00:00:00 2001
From: Paul Oliver <contact@pauloliver.dev>
Date: Thu, 16 Apr 2026 18:04:07 +0200
Subject: Improves web-ui input form usability

---
 data/vue/Plot.vue | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

(limited to 'data/vue/Plot.vue')

diff --git a/data/vue/Plot.vue b/data/vue/Plot.vue
index 5bbc89a..edc989d 100644
--- a/data/vue/Plot.vue
+++ b/data/vue/Plot.vue
@@ -20,11 +20,7 @@ const plot_container = useTemplateRef('plot_container')
 
 const plots = inject('plots')
 const heatmaps = inject('heatmaps')
-const entries = inject('entries')
-const x_axis = inject('x_axis')
-const hm_left = inject('hm_left')
-const hm_px_count = inject('hm_px_count')
-const hm_px_pow = inject('hm_px_pow')
+const params = inject('params')
 const data = inject('data')
 
 const plot_toggle_maximize = () => {
@@ -78,7 +74,7 @@ const update_plot = new_data => {
   const cols_count = cols.length
   const table_data = new_data.plot_values[plot_config.table]
   const traces = [...Array(cols_count).keys()]
-  const xs = Array(cols_count).fill(table_data.map(elem => elem[x_axis.value]))
+  const xs = Array(cols_count).fill(table_data.map(elem => elem[params.value.axis]))
   const ys = cols.map(column => table_data.map(elem => elem[column]))
 
   // Clear traces
@@ -91,19 +87,19 @@ const update_plot = new_data => {
     Plotly.restyle(plot_ref.value, restyle)
   }
 
-  Plotly.extendTraces(plot_ref.value, { x: xs, y: ys }, traces, entries.value)
+  Plotly.extendTraces(plot_ref.value, { x: xs, y: ys }, traces, params.value.rows)
 }
 
 const update_heatmap = new_data => {
   const heatmap_config = heatmaps.value[props.section][props.name]
   const table_data = new_data.heatmap_values[heatmap_config.table]
-  const ys = [table_data.map(elem => elem[x_axis.value])]
+  const ys = [table_data.map(elem => elem[params.value.axis])]
   const zs = [table_data.map(elem => elem.eva_render.split(' ').map(str => Number('0x' + str)))]
 
   if (new_data.redraw) {
-    const px_size = Math.pow(2, Number(hm_px_pow.value))
+    const px_size = Math.pow(2, Number(params.value.pixel_pow))
     const restyle = {
-      x: [Array.from(Array(Number(hm_px_count.value)).keys()).map(i => Number(hm_left.value) + i * px_size)],
+      x: [Array.from(Array(Number(params.value.pixels)).keys()).map(i => Number(params.value.left) + i * px_size)],
       y: [[]],
       z: [[]],
     }
@@ -111,7 +107,7 @@ const update_heatmap = new_data => {
     Plotly.restyle(plot_ref.value, restyle)
   }
 
-  Plotly.extendTraces(plot_ref.value, { y: ys, z: zs }, [0], entries.value)
+  Plotly.extendTraces(plot_ref.value, { y: ys, z: zs }, [0], params.value.rows)
 }
 
 watch(data, props.is_heatmap ? update_heatmap : update_plot)
-- 
cgit v1.2.1

