class="name"><label for="${id}">${escapeHtml(headers[i])}</label></div>
          <input class="color" type="color" value="${state.datasetColors[i]}" data-color-col="${i}">
        `;
        container.appendChild(el);
      }
      renderDatasetColorEditors();
    }

    function renderDatasetColorEditors() {
      const colorWrap = $('#datasetColors');
      colorWrap.innerHTML = '';
      const headers = state.headers.length ? state.headers : state.rows[0].map((_, i) => `Column ${i+1}`);
      for (const