pkgviz 0.8.0 → 0.8.1
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/_1rh2tf9._.js +1 -1
- package/.next/server/chunks/ssr/_1rh2tf9._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/{2sswp23h6zh08.js → 0_j-_aavigxqr.js} +1 -1
- package/package.json +1 -1
- package/src/features/graph-view/utils/projectVisibleGraph.ts +17 -2
- /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_buildManifest.js +0 -0
- /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementsDefinition } from 'cytoscape';
|
|
1
|
+
import type { ElementsDefinition, NodeDefinition } from 'cytoscape';
|
|
2
2
|
|
|
3
3
|
import { removeEmptyStructuralNodes } from '@/features/graph-view/utils/removeEmptyStructuralNodes';
|
|
4
4
|
import { filterByPackagePrefix } from '@/utils/filter/filterByPackagePrefix';
|
|
@@ -71,6 +71,7 @@ function labelVisibleNodes(
|
|
|
71
71
|
currentPackage: string
|
|
72
72
|
): ElementsDefinition {
|
|
73
73
|
const normalizedPackage = currentPackage.replaceAll('/', '.');
|
|
74
|
+
const visibleNodeIds = new Set(elements.nodes.map(node => String(node.data.id ?? '')));
|
|
74
75
|
|
|
75
76
|
return {
|
|
76
77
|
nodes: elements.nodes.map(node => ({
|
|
@@ -78,13 +79,27 @@ function labelVisibleNodes(
|
|
|
78
79
|
classes: node.classes ?? '',
|
|
79
80
|
data: {
|
|
80
81
|
...node.data,
|
|
81
|
-
label:
|
|
82
|
+
label: getVisibleNodeLabel(node, normalizedPackage, visibleNodeIds),
|
|
82
83
|
},
|
|
83
84
|
})),
|
|
84
85
|
edges: elements.edges,
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
/*** Resolves a node label from its visible compound context or the active package scope. */
|
|
90
|
+
function getVisibleNodeLabel(
|
|
91
|
+
node: NodeDefinition,
|
|
92
|
+
currentPackage: string,
|
|
93
|
+
visibleNodeIds: ReadonlySet<string>
|
|
94
|
+
): string {
|
|
95
|
+
const id = String(node.data.id ?? '');
|
|
96
|
+
const parent = typeof node.data.parent === 'string' ? node.data.parent : '';
|
|
97
|
+
|
|
98
|
+
return parent && visibleNodeIds.has(parent) && id.startsWith(`${parent}.`)
|
|
99
|
+
? id.slice(parent.length + 1)
|
|
100
|
+
: getRelativeNodeLabel(id, currentPackage);
|
|
101
|
+
}
|
|
102
|
+
|
|
88
103
|
/*** Resolves a readable label for the active package itself and for its descendants. */
|
|
89
104
|
function getRelativeNodeLabel(id: string, currentPackage: string): string {
|
|
90
105
|
if (!currentPackage) return id;
|
|
File without changes
|
/package/.next/static/{rjdzHqzPw2GCNhDbjcu0- → qznDSVYlkQxVdRx-TE_Wk}/_clientMiddlewareManifest.js
RENAMED
|
File without changes
|
|
File without changes
|