pkgviz 0.7.2 → 0.7.3
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/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/webpack/client-production/7.pack +0 -0
- package/.next/cache/webpack/client-production/8.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/11.pack +0 -0
- package/.next/cache/webpack/server-production/12.pack +0 -0
- package/.next/cache/webpack/server-production/13.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app-paths-manifest.json +1 -1
- package/.next/server/chunks/610.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/trace +2 -2
- package/package.json +2 -3
- package/src/app/actions/graph.actions.ts +25 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +77 -0
- package/src/app/layout.tsx +30 -0
- package/src/app/page.tsx +5 -0
- package/src/app/utils/buildGraph.ts +119 -0
- package/src/app/utils/getParsedFileStructure.ts +225 -0
- package/src/app/utils/markCyclicPackages.ts +275 -0
- package/src/app/utils/parser/cpp/extractCppPackageFromImport.ts +18 -0
- package/src/app/utils/parser/cpp/parseCppFile.ts +150 -0
- package/src/app/utils/parser/delphi/extractPackageFromImport.ts +21 -0
- package/src/app/utils/parser/delphi/parseFile.ts +179 -0
- package/src/app/utils/parser/java/extractJavaPackageFromImport.ts +39 -0
- package/src/app/utils/parser/java/findEntryPoint.ts +24 -0
- package/src/app/utils/parser/java/getIntrinsicPackagesRecursive.ts +33 -0
- package/src/app/utils/parser/java/parseJavaFile.ts +114 -0
- package/src/app/utils/parser/kotlin/extractPackageFromImport.ts +19 -0
- package/src/app/utils/parser/kotlin/parseFile.ts +147 -0
- package/src/app/utils/parser/python/extractPythonPackageFromImport.ts +18 -0
- package/src/app/utils/parser/python/parseFile.ts +171 -0
- package/src/app/utils/parser/typescript/extractTypeScriptPackageFromImport.ts +18 -0
- package/src/app/utils/parser/typescript/parseFile.ts +130 -0
- package/src/components/Breadcrumb.tsx +34 -0
- package/src/components/Cytoscape.tsx +23 -0
- package/src/components/Header.tsx +28 -0
- package/src/components/Loader.tsx +10 -0
- package/src/components/Setting.tsx +17 -0
- package/src/components/Settings.tsx +189 -0
- package/src/components/Switch.tsx +31 -0
- package/src/components/ThemeToggle.tsx +25 -0
- package/src/components/ZoomInput.tsx +94 -0
- package/src/components/useCytoscape.ts +343 -0
- package/src/contexts/SettingsContext.tsx +88 -0
- package/src/i18n/en.ts +27 -0
- package/src/i18n/i18n.ts +12 -0
- package/src/layouts/breadthfirst/layout.ts +30 -0
- package/src/layouts/breadthfirst/style.ts +8 -0
- package/src/layouts/circle/layout.ts +11 -0
- package/src/layouts/circle/style.ts +18 -0
- package/src/layouts/concentric/layout.ts +10 -0
- package/src/layouts/concentric/style.ts +16 -0
- package/src/layouts/constants.ts +17 -0
- package/src/layouts/elk/layout.ts +55 -0
- package/src/layouts/elk/style.ts +14 -0
- package/src/layouts/getLayoutStyle.ts +19 -0
- package/src/layouts/getWeightBuckets.ts +58 -0
- package/src/layouts/grid/layout.ts +11 -0
- package/src/layouts/grid/style.ts +20 -0
- package/src/layouts/index.ts +14 -0
- package/src/layouts/style.ts +191 -0
- package/src/screens/home/Home.tsx +48 -0
- package/src/shared/constants/index.ts +7 -0
- package/src/shared/types/index.ts +68 -0
- package/src/shared/utils/detectLanguage.ts +255 -0
- package/src/shared/utils/getJsonAsync.ts +13 -0
- package/src/shared/utils/getProjectName.ts +3 -0
- package/src/shared/utils/parseEnv.ts +91 -0
- package/src/shared/utils/parseProjectPath.ts +8 -0
- package/src/store/useLocalStorage.ts +29 -0
- package/src/utils/filter/filterByPackagePrefix.ts +23 -0
- package/src/utils/filter/filterEmptyPackages.ts +36 -0
- package/src/utils/filter/filterSubPackagesFromDepth.ts +170 -0
- package/src/utils/filter/filterVendorPackages.ts +17 -0
- package/src/utils/filter/toggleCompoundNodes.ts +40 -0
- package/src/utils/hasChildren.ts +7 -0
- /package/.next/static/{VVBfFRai9p1x3oVXujjYO → cGbLRcmdy7k8HGus5vhzm}/_buildManifest.js +0 -0
- /package/.next/static/{VVBfFRai9p1x3oVXujjYO → cGbLRcmdy7k8HGus5vhzm}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ElementsDefinition } from 'cytoscape';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Toggles display of compound nodes ('parent' attribute) in the node
|
|
5
|
+
* @param elements - Cytoscape elements (nodes and edges)
|
|
6
|
+
* @param show - Whether to show compound nodes
|
|
7
|
+
* @param currentPackage - Current package path to adjust node names when showing compound nodes
|
|
8
|
+
* @returns Updated Cytoscape elements with compound nodes toggled
|
|
9
|
+
*/
|
|
10
|
+
export function toggleCompoundNodes(
|
|
11
|
+
{ nodes, edges }: ElementsDefinition,
|
|
12
|
+
show: boolean,
|
|
13
|
+
currentPackage: string
|
|
14
|
+
): ElementsDefinition {
|
|
15
|
+
const updatedNodes = nodes.map(node => {
|
|
16
|
+
if (!node.data.idInactive) node.data.idInactive = node.data.id;
|
|
17
|
+
// ACTIVE Compound Nodes
|
|
18
|
+
if (show && node.data.parentInactive) {
|
|
19
|
+
node.data.parent = node.data.parentInactive;
|
|
20
|
+
node.data.parentInactive = undefined;
|
|
21
|
+
} else if (!show && node.data.parent) {
|
|
22
|
+
node.data.parentInactive = node.data.parent;
|
|
23
|
+
node.data.parent = undefined;
|
|
24
|
+
}
|
|
25
|
+
return node;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const labelledNodes = updatedNodes.map(node => {
|
|
29
|
+
if (show) {
|
|
30
|
+
node.data.name = node.data.idInactive.split('.').pop();
|
|
31
|
+
} else {
|
|
32
|
+
node.data.name = node.data.idInactive.slice(
|
|
33
|
+
currentPackage.length ? currentPackage.length + 1 : 0
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return node;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return { nodes: labelledNodes, edges };
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NodeDataDefinition, NodeDefinition } from 'cytoscape';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a node (package) has children based on id prefix.
|
|
5
|
+
*/
|
|
6
|
+
export const hasChildren = (node: NodeDefinition, nodes: NodeDataDefinition[]) =>
|
|
7
|
+
nodes.some(n => n.data.id?.startsWith(`${node.data.id}.`));
|
|
File without changes
|
|
File without changes
|