aboutsummaryrefslogtreecommitdiff
path: root/data/vue/Plot.vue
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2026-04-16 18:04:07 +0200
committerPaul Oliver <contact@pauloliver.dev>2026-04-16 23:43:17 +0200
commite5b983979162cfadb628a835f666278700414e64 (patch)
tree25f88282f406dc2d4e164758b2cda617dbe4f1c3 /data/vue/Plot.vue
parent33976c784facea8294c84f4c0eacb7e3bb052728 (diff)
Improves web-ui input form usability
Diffstat (limited to 'data/vue/Plot.vue')
-rw-r--r--data/vue/Plot.vue18
1 files changed, 7 insertions, 11 deletions
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)