Geocene / trainset

A lightweight web application for brushing labels onto time series data; useful for building training sets.
https://trainset.geocene.com/
MIT License
162 stars 36 forks source link

Label selector does not show up when uploading a unique series. #105

Closed levaphenyl closed 2 years ago

levaphenyl commented 3 years ago

When uploading a CSV file with a unique value in the column series, the label selector does not show. Quite embarrassing! ;)

How to reproduce

Label selector does not show (bug):

series,timestamp,value,label
series_a,2019-01-14T16:26:37.000Z,29.4375,bar
series_a,2019-01-14T16:31:37.000Z,28.5625,
series_a,2019-01-14T16:36:37.000Z,21.8125,
series_a,2019-01-14T16:41:37.000Z,19.875,
series_a,2019-01-14T16:46:37.000Z,20.625,
series_a,2019-01-14T16:51:37.000Z,19.6875,
series_a,2019-01-14T16:56:37.000Z,20.125,
series_a,2019-01-14T17:01:37.000Z,19.9375,
series_a,2019-01-14T17:06:37.000Z,20.75,
series_a,2019-01-14T17:11:37.000Z,21.0625,foo
series_a,2019-01-14T17:16:37.000Z,20.3125,

It shows up when adding the workaround last line:

series,timestamp,value,label
series_a,2019-01-14T16:26:37.000Z,29.4375,bar
series_a,2019-01-14T16:31:37.000Z,28.5625,
series_a,2019-01-14T16:36:37.000Z,21.8125,
series_a,2019-01-14T16:41:37.000Z,19.875,
series_a,2019-01-14T16:46:37.000Z,20.625,
series_a,2019-01-14T16:51:37.000Z,19.6875,
series_a,2019-01-14T16:56:37.000Z,20.125,
series_a,2019-01-14T17:01:37.000Z,19.9375,
series_a,2019-01-14T17:06:37.000Z,20.75,
series_a,2019-01-14T17:11:37.000Z,21.0625,foo
series_a,2019-01-14T17:16:37.000Z,20.3125,
workaround,2019-01-14T17:16:37.000Z,20.3125,
daterdots commented 3 years ago

Nice find, @levaphenyl. @rushk014 would you be able to fix this? When using the attached CSV, the label selector tool fails to load. testset.csv

daterdots commented 3 years ago

image

levaphenyl commented 3 years ago

The problem is located in Labeler.vue. When there is only one series, the seriesSelector element is hidden: https://github.com/Geocene/trainset/blob/master/src/views/Labeler.vue#L404

This is fully correct. However, the problem is that the labelSelector is nested inside the seriesSelector here: https://github.com/Geocene/trainset/blob/master/src/views/Labeler.vue#L57

Consequently, when hiding the series selector, the labels selectors also gets hidden. Hence the bug!

I tried to fix this locally with the intent of opening a PR but un-nesting labelSelector messes up the CSS layout. I am not competent here :sweat_smile:.

abroekhof commented 3 years ago

I've created a PR to fix this, see above

daterdots commented 3 years ago

@abroekhof - we have penciled in a day this week to close out a lot of these PRs. Hopefully it's integrated and deployed by the end of the week.