code: function filterTimeseriesesByLine(timeseriesesByLine) {
    const result = [];
    for (const {lineDescriptor, timeserieses} of timeseriesesByLine) {
      const filteredTimeserieses = timeserieses.filter(ts => ts);
      if (filteredTimeserieses.length === 0) continue;
      result.push({lineDescriptor, timeserieses: filteredTimeserieses});
    }
    return result;
  }
docs: Remove empty elements.