group);
                    }
                });
                allThematicGroups = Array.from(thematicSet).sort();
            }

            function extractPopularTags() {
                // Count tag occurrences
                const tagCounts = {};
                datasets.forEach(dataset => {
                    if (dataset.tags) {
                        // Convert tags to array if it's a string
                        const tagsArray = Array.isArray(dataset.tags)
                            ? data