106 | {(active) => {
107 | const classNames = ['jl-explorer-dataset'];
108 | if (active === url) {
109 | classNames.push('jl-explorer-active-dataset');
110 | }
111 |
112 | const dataset = registry.getURL(url);
113 | // Use label if it exists
114 | let label = labelDataType.getDataset(dataset);
115 | const displayURL = externalURLDataType.getDataset(dataset) || of(url);
116 | // otherwise use url
117 | if (!label) {
118 | label = combineLatest(displayURL, parentURL).pipe(
119 | map(([u, parentU]) =>
120 | u.startsWith(parentU) ? u.slice(parentU.length) : u
121 | )
122 | );
123 | }
124 | return (
125 | {
128 | e.stopPropagation();
129 | active$.next(url);
130 | }}
131 | >
132 |
133 |
134 | {(label_) => label_}
135 |
136 |
137 |
138 | {viewers.map(([label, view]) => (
139 |
140 | ))}
141 |
142 | {nestedURLs ? (
143 |
144 |
150 |
151 | ) : undefined}
152 |
153 | );
154 | }}
155 |
156 | );
157 | }
158 |
159 | function DatasetsComponent({
160 | active,
161 | registry,
162 | urls$,
163 | url,
164 | }: {
165 | active: IActiveDataset;
166 | registry: Registry;
167 | urls$: Observable