@glossarist/concept-browser 0.7.30 → 0.7.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glossarist/concept-browser",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.31",
|
|
4
4
|
"description": "Vue SPA for browsing Glossarist terminology datasets with cross-reference resolution, graph visualization, and multi-language support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -314,8 +314,18 @@ const conceptUriValue = computed(() =>
|
|
|
314
314
|
conceptUri(props.concept, props.registerId, props.manifest.uriBase)
|
|
315
315
|
);
|
|
316
316
|
|
|
317
|
-
const outgoingEdges = computed(() => props.edges.filter(e => e.source === conceptUriValue.value && e.type !== 'domain' && e.type !== 'section'));
|
|
318
|
-
const incomingEdges = computed(() => props.edges.filter(e => e.target === conceptUriValue.value && e.type !== 'domain' && e.type !== 'section'));
|
|
317
|
+
const outgoingEdges = computed(() => dedupeEdges(props.edges.filter(e => e.source === conceptUriValue.value && e.type !== 'domain' && e.type !== 'section'), 'target'));
|
|
318
|
+
const incomingEdges = computed(() => dedupeEdges(props.edges.filter(e => e.target === conceptUriValue.value && e.type !== 'domain' && e.type !== 'section'), 'source'));
|
|
319
|
+
|
|
320
|
+
function dedupeEdges(edges: GraphEdge[], direction: 'source' | 'target'): GraphEdge[] {
|
|
321
|
+
const seen = new Set<string>();
|
|
322
|
+
return edges.filter(e => {
|
|
323
|
+
const key = `${e[direction]}\0${e.type}`;
|
|
324
|
+
if (seen.has(key)) return false;
|
|
325
|
+
seen.add(key);
|
|
326
|
+
return true;
|
|
327
|
+
});
|
|
328
|
+
}
|
|
319
329
|
|
|
320
330
|
function inverseEdgeType(type: string): string {
|
|
321
331
|
return INVERSE_RELATIONSHIPS[type] || type;
|