  // If less group in the new dataset, I delete the ones not in use anymore
  u
    .exit()
    .remove()
}

// Initialize the plot with the first dataset
update(data1)

</script></xmp></code></pre>
            <!-- ==================================== -->

            <!-- ========= show JS code v6 ==============  -->
            <pre
              class="language-js d-none d3v6-chunk"
            ><code id="code-js-v6" contenteditable="true"><xmp><script>

// create 2 data_set
const data1 = [
   {group: "