   --cięcie--
   function getLicense(d) {
     let license = d.license?.name;

     if (!license) {
       return "Brak licencji";
     } else {
       return license;
     }
   }

   let hiddenLicenses = new Set();

   function update(items) {
     let licenses = new Set(items.map(d => getLicense(d))); 

   --cięcie--

           p.append("span")
             .text(d => d)

           return p;
         }
       );

     d3.selectAll("#key input").on("change", (e, d) => {
       if (e.target.checked) {
         hiddenLicenses.delete(d);
       } else {
         hiddenLicenses.add(d);
       }

       console.log(hiddenLicenses);
       update(items);
     });
   }

   function getUrl() {
   --cięcie--
