feat: add support for series

This commit is contained in:
2025-04-30 21:16:34 +02:00
committed by Louis Heredero
parent fef6c727cb
commit d0723e5179
11 changed files with 339 additions and 27 deletions

View File

@ -113,6 +113,7 @@ export class Track {
"warning"
)
value = lang
this.editValue(field.key, value)
}
}
@ -140,19 +141,21 @@ export class Track {
this.table.editTrack(this.idx, key, value)
const input = this.row.querySelector(`[data-key='${key}']`)
const fieldType = this.table.getFieldProps(key).type
switch (fieldType) {
case "bool":
input.checked = value
break
default:
input.value = value
break
if (input) {
const fieldType = this.table.getFieldProps(key).type
switch (fieldType) {
case "bool":
input.checked = value
break
default:
input.value = value
break
}
}
}
improveName() {
this.table.editor.integrity_mgr.improveName(this)
this.table.editor.integrityMgr.improveName(this)
}
}
@ -184,9 +187,10 @@ export default class TracksTable {
this.table = document.getElementById(tableId)
this.headers = this.table.querySelector("thead tr")
this.body = this.table.querySelector("tbody")
this.fields = []
this.tracks = []
this.dataKey = dataKey
this.tracks = []
this.fields = []
this.onehots = {}
}
@ -195,8 +199,8 @@ export default class TracksTable {
}
loadTracks(tracks) {
this.tracks = tracks.map((t, i) => new Track(this, i, t))
this.clear()
this.tracks = tracks.map((t, i) => new Track(this, i, t))
if (tracks.length === 0) {
return
}
@ -208,9 +212,11 @@ export default class TracksTable {
}
clear() {
this.tracks = []
this.fields = []
this.onehots = {}
this.headers.innerHTML = ""
this.body.innerHTML = ""
this.fields = []
}
detectFields() {