From cf8ce5c8249e899c00dbc8ecf4866bbaf1ee8317 Mon Sep 17 00:00:00 2001 From: adharshachu <163978878+adharsh242001@users.noreply.github.com> Date: Thu, 25 Jun 2026 14:31:41 +0530 Subject: [PATCH 01/13] Add NuGet cache and project specification files for sample project - Created project.nuget.cache to store package cache information. - Added sample.csproj.nuget.dgspec.json for project restore specifications. - Introduced sample.csproj.nuget.g.props for project properties related to NuGet. - Included sample.csproj.nuget.g.targets for importing necessary targets from NuGet packages. --- ...CoreApp,Version=v8.0.AssemblyAttributes.cs | 4 + .../obj/Debug/net8.0/sample.AssemblyInfo.cs | 22 + .../net8.0/sample.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 28 + .../obj/Debug/net8.0/sample.GlobalUsings.g.cs | 17 + .../obj/Debug/net8.0/sample.assets.cache | Bin 0 -> 11664 bytes .../sample.csproj.AssemblyReference.cache | Bin 0 -> 7573 bytes tests/fixtures/obj/project.assets.json | 998 ++++++++++++++++++ tests/fixtures/obj/project.nuget.cache | 31 + .../obj/sample.csproj.nuget.dgspec.json | 108 ++ .../fixtures/obj/sample.csproj.nuget.g.props | 22 + .../obj/sample.csproj.nuget.g.targets | 6 + 12 files changed, 1237 insertions(+) create mode 100644 tests/fixtures/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.GlobalUsings.g.cs create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.assets.cache create mode 100644 tests/fixtures/obj/Debug/net8.0/sample.csproj.AssemblyReference.cache create mode 100644 tests/fixtures/obj/project.assets.json create mode 100644 tests/fixtures/obj/project.nuget.cache create mode 100644 tests/fixtures/obj/sample.csproj.nuget.dgspec.json create mode 100644 tests/fixtures/obj/sample.csproj.nuget.g.props create mode 100644 tests/fixtures/obj/sample.csproj.nuget.g.targets diff --git a/tests/fixtures/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/tests/fixtures/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 000000000..2217181c8 --- /dev/null +++ b/tests/fixtures/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs new file mode 100644 index 000000000..55643ef96 --- /dev/null +++ b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("sample")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bc362cbb74d3eb6697e507ff72f0088ac7ba17bb")] +[assembly: System.Reflection.AssemblyProductAttribute("sample")] +[assembly: System.Reflection.AssemblyTitleAttribute("sample")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache new file mode 100644 index 000000000..7b085a7cd --- /dev/null +++ b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +1704e5137b2a677b5fd29e4ed7938d675abb55e240329e43cb05986a9f370c40 diff --git a/tests/fixtures/obj/Debug/net8.0/sample.GeneratedMSBuildEditorConfig.editorconfig b/tests/fixtures/obj/Debug/net8.0/sample.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 000000000..1baac3029 --- /dev/null +++ b/tests/fixtures/obj/Debug/net8.0/sample.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,28 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetFrameworkIdentifier = .NETCoreApp +build_property.TargetFrameworkVersion = v8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = true +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property.EntryPointFilePath = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = sample +build_property.RootNamespace = sample +build_property.ProjectDir = D:\Private\graphify\tests\fixtures\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.RazorLangVersion = 8.0 +build_property.SupportLocalizedComponentNames = +build_property.GenerateRazorMetadataSourceChecksumAttributes = +build_property.MSBuildProjectDirectory = D:\Private\graphify\tests\fixtures +build_property._RazorSourceGeneratorDebug = +build_property.EffectiveAnalysisLevelStyle = 8.0 +build_property.EnableCodeStyleSeverity = + +[D:/Private/graphify/tests/fixtures/sample.razor] +build_metadata.AdditionalFiles.TargetPath = c2FtcGxlLnJhem9y +build_metadata.AdditionalFiles.CssScope = diff --git a/tests/fixtures/obj/Debug/net8.0/sample.GlobalUsings.g.cs b/tests/fixtures/obj/Debug/net8.0/sample.GlobalUsings.g.cs new file mode 100644 index 000000000..5e6145d2a --- /dev/null +++ b/tests/fixtures/obj/Debug/net8.0/sample.GlobalUsings.g.cs @@ -0,0 +1,17 @@ +// +global using Microsoft.AspNetCore.Builder; +global using Microsoft.AspNetCore.Hosting; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Routing; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; +global using System; +global using System.Collections.Generic; +global using System.IO; +global using System.Linq; +global using System.Net.Http; +global using System.Net.Http.Json; +global using System.Threading; +global using System.Threading.Tasks; diff --git a/tests/fixtures/obj/Debug/net8.0/sample.assets.cache b/tests/fixtures/obj/Debug/net8.0/sample.assets.cache new file mode 100644 index 0000000000000000000000000000000000000000..1fed093dd2d9fbe7a1a4a7d9e59a885a3935f21f GIT binary patch literal 11664 zcmdT~OLH4V5Kh336GB1~Cr%(CwqrX_vWnw4FG4`E6QjKBiXRl9qG~0Ll}%Q=TiR6| z7e#TR_z6(Oi4zz81XunF7m5SLfdl>RvsapxMz(_$Rdq=_>Yn+gx2LCjdKMnc<=@`1 zW5?>=!L_@8j{W}S&yM>~;mnV@rGHQV`rBWle;i->d*s)J3!je@Q}{VR-(St#EH1mE z?iTZl%Zno`g_Zd`^Yagin$@TZujuII=XzDR#Z|K*EboPG8Wr6$Y^yjqsol^n6-}d5 zw1jt^e%|w0R$>;dVw!J;L+zyRH;C}uN7PUBP;uy*s2I9eFHT<8E+->irJs-df1dDx zc2UO|Xn+Uh#sr49h=5@) z(GNRSK^Wz_?b@rJrn?SlwrtmhrZ>E&q<*99>t1`d=9PqA7xg0PJy8i>!lPI`?>di# zHv{o}TKxW+cgGj!pkX`!y^jc>_Y?inJ!tXL6P8N`;%XJ)2&*Ej^15L?6J=P9rk7k_ zwP0um{%+FEY}`#D?k3N=;gfiWK=Vn!!oTZ&5(c663~#+=SA?0ye2o-76gGAqN7UDD4w$?<+v!9dli^>@9lh|jXwB(C%JsxfXd4!(7?%IIU zYBcR?)v&7S=pF_F9M@12uA}t)?Iv+Kb=$Mcw%LW=79tUj?N}4Gcj@`3&A!+eoMzKv zGAiVnELuwHN=%^6QwN0#IV^O*fxp)T{5U*CfC#U9Wl^pj~Z8~w> zv|x*ijGwt~Y6d??HA*Pp%uKMPD8dvWV(Tnq%#J3?sVwEJ>gXG2`kesGSS@xhz@ zU+mqfl<>yz;r6~wcFxdnJKt9OW|+8rZ=+o^MBJ|N4iRY|lShG$0|tCxYzLa-b^I|9 z2DbQpuqDVv>qU9r84)HV&L6OQ0 zF)&VKF{T0{a1Lj2hQSGVMzeV0y%$`$j$B%5hlb3_ESbQSfaPGq5^i8<9g^=R`0J$n zFO8b9(ST*NJqx*faE-L*S}uTTxPvDI4?Nw`W@F3+`6cqi^F*-f3q;5tKOnkDq!Hza zE)h)#~lfsU3Paqqv_E>yB5Q;=in!(dGeY_>EVzb*ViYfT#A#J7aKmu(6b$ zjm=Z~-c02gSXd<91T6CPNZ}cHp2GJ+>dv6?)V()Sb_R~8?5c5XElz&Yq3woKb%uwh z>Z;LO7M?f@ZjH1P$DQ8tHAQ;i)#gxK|z= zQT+ok3qCwJLcEKZ?<&zXqU%IAh;9;nNVIjq69d45CjdZQL-8r8xO94 z4fPTkwvVX2H-j%W86JFLGN_}-CUcwGUytC7O^yd=m>kjz+2lT^_Ff3y7<3-I0Xpg~ zGU%UBdv64H3_K6+03P)i8TdT4t9sh3IAO!VAHzFDIFNzhoC$bQr;*{kL+z^jXBOT~ z1&0hX4-SDD^&1)H8EWs{;E_#;2alK#>N>Is%~Ja|1(ysh4=#Zg^&T18yVS0{L2V}Z zWY~D{32Y-7*zQrgswUfqgWc9TP*I3t4IZ2VE$TxuP0mrf>f&pUc7wqy!#qw{;4lzS z1M>ut4D+YdzK!SZ4Do3~!V#mMBtwj2P*s<_<-sq*%Y$EN_*@3w`_#@q59ne4_Kg>ua&zA)ja{IDxH!W|0P z>8?*MDn<}jYhj|_zo>IIWM}o=SS)o>r@I`S4O6!*bkh~Pp9t4BUx-TIQoSMi;8brbmVs8~H#esh#cQeCmtUw##TLVk zy4v4j%&1w;D2^zPP=YvWPu_Kfx3unvfqH{(_SM9m8QWQZXqR=f&m)B%qEfVHSpMzG z#YPG0JuKUw_Oe~*Nc20kwM=%sH{3`hx^(Sl6Up{Y`dk)ci_aa);$)6A)8(gpBP*$< q!6jTR4(?Re=!x4plCUsebgI4Mz(Sj7&l0+e@%CJS3m8*a*Z%=m6%Ky@ literal 0 HcmV?d00001 diff --git a/tests/fixtures/obj/Debug/net8.0/sample.csproj.AssemblyReference.cache b/tests/fixtures/obj/Debug/net8.0/sample.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..ed5ed7f55dd22109f8f551285483b139b4db7bd9 GIT binary patch literal 7573 zcmds*2~-p37RMQ6u^=E8S`HS4C+d?Wl0CsjBvdS$@MM!3&`D;9k(gjI0kKdJ1+-!n zHv~~Qq9UkZ!40IK0?!RMWP_zs7wfuPzV6%Lv*^0^sIHS4hH~W zLGqsByxlGLm&h`_uK~l+|CG@2W6R`<>yLq;cSCiu4MFpa=8lEt&PD!lvh|P&5t#&L ziC`Hb0fkPs0Wz*o!1ICQg2YjL}rVik% zp@a)zNB|-d4v|D4;mXm_Q$OsNS-4>76PK;L-6|K%Q284$Lh)$Teh@lkY!+R!umYdz zPLByYn|x6CEU(FUN<&A{%mUVmlEO(1i#?r%zNUn;=j}G6TmH+NXq0@b^j1~Tp|cj_ zjD}U}Mt)Tl_BVs=X1}&ahg_UinEcW!pf&c=4qk-CbIBs`?$luOwir=!hvlPYz|&{3 z?e@eoF8OxgkF)J>vg_x*xlo1abTr$2=bfU0cECp&VIO(W^k^mzm&*hxM34$IKoF$E zBt>@A<>6~54}m8Zp(yYWDM$V{h`l3Bihv>rlt6OndiCXPLJ13E5iSf$U5>fmb;9r`{Q7kEd%UvR`tvd6XLF3YUu z1Z7o>f64yek4ae_7GcGEJZBGEUcD8mZC?r286gwI+M&GF(C+qX&-FjR6ethZS79<@i~;H$N_brbn% zV`5#`w5?>EvT4+)CD+?cX_f(5JiboZuZ;>=UeX9RR)a-epr z-05vkqZ}MZ&Dd81J9gI$*AFkm&>&VbLiW*SQUSgu;p0SLY1f1ZGLaieW>9G$M5a+- zGF6c;^_N20V2M~D6^mkFE+U^LXn}+`>J|!fvB`xLXCg27NtuF)@gGZyn&;4kV!lT4 ze<3P<*81h5UM7TMK3^c>YhEFI6%IHECJoaLC_otdu|z0+hAsl!0V4lG;wKJL{Ah_7 z5%a`CEvi94uL}+USQ(`R!0uydP@~XSYA+#=79HH4`p7Ftbcb9gz27=y;6&DlBqDE_jNGhE|W>RQmIxW(L^1+6YrlVLI3rgp6WxOaM+F8Jx4CvQ< zKH5{D5vX`i0bRUs0{hta=_;UK%k6P_-;dD(_<8@FWdl8(LcqRp=$b8B0{ z)D1bQk6!t7x_Rc*h!&@Jr?YFTWD&2eUuOx=ls|5z1RtT;NVM*ssIu=vOXot+#Oqb+&&oJv-HNTOFn~7fwKswX*d9*ni--@K};H5uQe(QRxt! zLZ>iY=u{?Iku~*2p{6rHX&)iq7oHD`wAFqFEW+gv8+An~zg_=XK)pUE0p?#H@i?@Z z(-b#WKWTG*m-w7zdRn>T+b~YO4J#wn%yikY)weHAg0gGMS`w+k=IthM$9bP!lbhZ= zn#LB-xyxv)ACd6GiqSH z0)7aB1P$Ne{X-xVXv;vb7mmQPv`!@gw*99e*z0o=aQDGFv*ad51KW20;^&L(ow#nb z^|a`xfenXN31>qwhnET$WUo&pKD*Q=++fH(&>zeWha6F-aw&$0ss^enZ#oKy>Z3{Kuzet*UvsBlnk^(m)tXfGL;zd~53>;{b;z-Q>r= 11.9.0", + "MediatR >= 12.2.0", + "Microsoft.AspNetCore.Authentication.JwtBearer >= 8.0.0", + "Swashbuckle.AspNetCore >= 6.5.0" + ] + }, + "packageFolders": { + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj", + "projectName": "sample", + "projectPath": "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj", + "packagesPath": "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\", + "outputPath": "D:\\Private\\graphify\\tests\\fixtures\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\ASUS VIVOBOOK\\AppData\\Roaming\\NuGet\\NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "framework": "net8.0", + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "10.0.300" + }, + "frameworks": { + "net8.0": { + "framework": "net8.0", + "targetAlias": "net8.0", + "dependencies": { + "FluentValidation": { + "target": "Package", + "version": "[11.9.0, )" + }, + "MediatR": { + "target": "Package", + "version": "[12.2.0, )" + }, + "Microsoft.AspNetCore.Authentication.JwtBearer": { + "target": "Package", + "version": "[8.0.0, )" + }, + "Swashbuckle.AspNetCore": { + "target": "Package", + "version": "[6.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.NETCore.App.Host.win-x64", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.NETCore.App.Ref", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.WindowsDesktop.App.Ref", + "version": "[8.0.28, 8.0.28]" + } + ], + "frameworkReferences": { + "Microsoft.AspNetCore.App": { + "privateAssets": "none" + }, + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.301/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/tests/fixtures/obj/project.nuget.cache b/tests/fixtures/obj/project.nuget.cache new file mode 100644 index 000000000..a03a4b5b9 --- /dev/null +++ b/tests/fixtures/obj/project.nuget.cache @@ -0,0 +1,31 @@ +{ + "version": 2, + "dgSpecHash": "cXGfyMvFzK0=", + "success": true, + "projectFilePath": "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj", + "expectedPackageFiles": [ + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\fluentvalidation\\11.9.0\\fluentvalidation.11.9.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\mediatr\\12.2.0\\mediatr.12.2.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\mediatr.contracts\\2.0.1\\mediatr.contracts.2.0.1.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\8.0.0\\microsoft.aspnetcore.authentication.jwtbearer.8.0.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.extensions.apidescription.server\\6.0.5\\microsoft.extensions.apidescription.server.6.0.5.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.0\\microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.abstractions\\7.0.3\\microsoft.identitymodel.abstractions.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\7.0.3\\microsoft.identitymodel.jsonwebtokens.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.logging\\7.0.3\\microsoft.identitymodel.logging.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.0.3\\microsoft.identitymodel.protocols.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.0.3\\microsoft.identitymodel.protocols.openidconnect.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.identitymodel.tokens\\7.0.3\\microsoft.identitymodel.tokens.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.openapi\\1.2.3\\microsoft.openapi.1.2.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\swashbuckle.aspnetcore\\6.5.0\\swashbuckle.aspnetcore.6.5.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\swashbuckle.aspnetcore.swagger\\6.5.0\\swashbuckle.aspnetcore.swagger.6.5.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\swashbuckle.aspnetcore.swaggergen\\6.5.0\\swashbuckle.aspnetcore.swaggergen.6.5.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\swashbuckle.aspnetcore.swaggerui\\6.5.0\\swashbuckle.aspnetcore.swaggerui.6.5.0.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.0.3\\system.identitymodel.tokens.jwt.7.0.3.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.netcore.app.ref\\8.0.28\\microsoft.netcore.app.ref.8.0.28.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\8.0.28\\microsoft.windowsdesktop.app.ref.8.0.28.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\8.0.28\\microsoft.aspnetcore.app.ref.8.0.28.nupkg.sha512", + "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\microsoft.netcore.app.host.win-x64\\8.0.28\\microsoft.netcore.app.host.win-x64.8.0.28.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/tests/fixtures/obj/sample.csproj.nuget.dgspec.json b/tests/fixtures/obj/sample.csproj.nuget.dgspec.json new file mode 100644 index 000000000..c85fe5486 --- /dev/null +++ b/tests/fixtures/obj/sample.csproj.nuget.dgspec.json @@ -0,0 +1,108 @@ +{ + "format": 1, + "restore": { + "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj": {} + }, + "projects": { + "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj", + "projectName": "sample", + "projectPath": "D:\\Private\\graphify\\tests\\fixtures\\sample.csproj", + "packagesPath": "C:\\Users\\ASUS VIVOBOOK\\.nuget\\packages\\", + "outputPath": "D:\\Private\\graphify\\tests\\fixtures\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\ASUS VIVOBOOK\\AppData\\Roaming\\NuGet\\NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "framework": "net8.0", + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "10.0.300" + }, + "frameworks": { + "net8.0": { + "framework": "net8.0", + "targetAlias": "net8.0", + "dependencies": { + "FluentValidation": { + "target": "Package", + "version": "[11.9.0, )" + }, + "MediatR": { + "target": "Package", + "version": "[12.2.0, )" + }, + "Microsoft.AspNetCore.Authentication.JwtBearer": { + "target": "Package", + "version": "[8.0.0, )" + }, + "Swashbuckle.AspNetCore": { + "target": "Package", + "version": "[6.5.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.NETCore.App.Host.win-x64", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.NETCore.App.Ref", + "version": "[8.0.28, 8.0.28]" + }, + { + "name": "Microsoft.WindowsDesktop.App.Ref", + "version": "[8.0.28, 8.0.28]" + } + ], + "frameworkReferences": { + "Microsoft.AspNetCore.App": { + "privateAssets": "none" + }, + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.301/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/tests/fixtures/obj/sample.csproj.nuget.g.props b/tests/fixtures/obj/sample.csproj.nuget.g.props new file mode 100644 index 000000000..b65a1eade --- /dev/null +++ b/tests/fixtures/obj/sample.csproj.nuget.g.props @@ -0,0 +1,22 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\ASUS VIVOBOOK\.nuget\packages\ + PackageReference + 7.0.0 + + + + + + + + + + C:\Users\ASUS VIVOBOOK\.nuget\packages\microsoft.extensions.apidescription.server\6.0.5 + + \ No newline at end of file diff --git a/tests/fixtures/obj/sample.csproj.nuget.g.targets b/tests/fixtures/obj/sample.csproj.nuget.g.targets new file mode 100644 index 000000000..eea8d7621 --- /dev/null +++ b/tests/fixtures/obj/sample.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 250b8b39c30c39ea4bd740cf3d0f079bdc519fa4 Mon Sep 17 00:00:00 2001 From: adharshachu <163978878+adharsh242001@users.noreply.github.com> Date: Tue, 30 Jun 2026 12:34:44 +0530 Subject: [PATCH 02/13] fix: update AssemblyInformationalVersion and cache hash for sample project --- tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs | 2 +- tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs index 55643ef96..ba762f6ed 100644 --- a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs +++ b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfo.cs @@ -13,7 +13,7 @@ [assembly: System.Reflection.AssemblyCompanyAttribute("sample")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bc362cbb74d3eb6697e507ff72f0088ac7ba17bb")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cf8ce5c8249e899c00dbc8ecf4866bbaf1ee8317")] [assembly: System.Reflection.AssemblyProductAttribute("sample")] [assembly: System.Reflection.AssemblyTitleAttribute("sample")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache index 7b085a7cd..76d57f652 100644 --- a/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache +++ b/tests/fixtures/obj/Debug/net8.0/sample.AssemblyInfoInputs.cache @@ -1 +1 @@ -1704e5137b2a677b5fd29e4ed7938d675abb55e240329e43cb05986a9f370c40 +e421c3744f06759564471f9b4a9a107e37193bfd4082ee2de3eac4efa3b6d354 From 50b5bd935df073b083050e9a33af5cab5d26b901 Mon Sep 17 00:00:00 2001 From: adharshachu <163978878+adharsh242001@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:09:42 +0530 Subject: [PATCH 03/13] Refactor code structure for improved readability and maintainability --- graphify/export.py | 1270 +++++++++++++---- .../obj/Debug/net8.0/sample.AssemblyInfo.cs | 2 +- .../net8.0/sample.AssemblyInfoInputs.cache | 2 +- worked/httpx/graph.html | 966 +++++++++++++ worked/karpathy-repos/graph.html | 966 +++++++++++++ worked/mixed-corpus/graph.html | 966 +++++++++++++ worked/rsl-siege-manager/graph.html | 1189 +++++++++++---- 7 files changed, 4796 insertions(+), 565 deletions(-) create mode 100644 worked/httpx/graph.html create mode 100644 worked/karpathy-repos/graph.html create mode 100644 worked/mixed-corpus/graph.html diff --git a/graphify/export.py b/graphify/export.py index 17798d6b8..07dff95bf 100644 --- a/graphify/export.py +++ b/graphify/export.py @@ -151,6 +151,8 @@ def _yaml_str(s: str) -> str: COMMUNITY_COLORS = [ "#4E79A7", "#F28E2B", "#E15759", "#76B7B2", "#59A14F", "#EDC948", "#B07AA1", "#FF9DA7", "#9C755F", "#BAB0AC", + "#6366f1", "#ec4899", "#14b8a6", "#f97316", "#84cc16", + "#06b6d4", "#d946ef", "#22c55e", "#eab308", "#64748b", ] MAX_NODES_FOR_VIZ = 5_000 @@ -174,287 +176,894 @@ def _viz_node_limit() -> int: def _html_styles() -> str: return """""" def _hyperedge_script(hyperedges_json: str) -> str: - return f"""""" + if hyperedges_json.strip() in ("[]", "null", ""): + return "" + return f""" +const RAW_HYPEREDGES = {hyperedges_json}; +""" def _html_script(nodes_json: str, edges_json: str, legend_json: str) -> str: - return f""" +""" +} +function updateSelectAllState() { + const total = state.communities.length, hidden = state.hiddenCommunities.size; + const cb = document.getElementById('select-all-cb'); cb.checked = hidden === 0; cb.indeterminate = hidden > 0 && hidden < total; +} +function toggleAllCommunities(hide) { + document.querySelectorAll('.legend-item').forEach(item => item.classList.toggle('dimmed', hide)); + document.querySelectorAll('.legend-cb').forEach(cb => cb.checked = !hide); + state.communities.forEach(c => { if (hide) state.hiddenCommunities.add(c.cid); else state.hiddenCommunities.delete(c.cid); }); + rebuildQuadtree(); updateSelectAllState(); render(); +} + +function setupSearch() { + const input = document.getElementById('search'), results = document.getElementById('search-results'); + input.addEventListener('input', () => { + const q = input.value.toLowerCase().trim(); results.innerHTML = ''; + if (!q) { results.style.display = 'none'; return; } + const matches = state.nodes.filter(n => n.label.toLowerCase().includes(q)).slice(0, 20); + if (!matches.length) { results.style.display = 'none'; return; } + results.style.display = 'block'; + matches.forEach(n => { + const el = document.createElement('div'); el.className = 'search-item'; + el.innerHTML = ''+esc(n.label)+''+n.file_type+''; + el.addEventListener('click', () => { focusNodeOn(n.id, 2.5); state.selectedNode = n; results.style.display = 'none'; input.value = ''; render(); }); + results.appendChild(el); + }); + }); + document.addEventListener('click', (e) => { if (!results.contains(e.target) && e.target !== input) results.style.display = 'none'; }); +} + +function showInfo(nodeId) { + const n = state.nodeMap.get(nodeId); if (!n) return; + const neighborItems = []; + state.edges.forEach(e => { + let nb = null; + if (e.sourceNode.id === nodeId) nb = e.targetNode; + if (e.targetNode.id === nodeId) nb = e.sourceNode; + if (nb) neighborItems.push(''); + }); + const relCount = neighborItems.length; + const neighborsHtml = relCount ? '
Connected Nodes
'+neighborItems.join('')+'
' : ''; + document.getElementById('info-content').innerHTML = '
'+esc(n.label)+'
'+n.file_type+''+n.community_name+'
File'+esc(n.source_file||'-')+'
Degree'+n.degree+'
Relationships'+relCount+'
'+neighborsHtml; + document.querySelectorAll('.neighbor-link').forEach(el => { + el.addEventListener('click', () => { const id = el.dataset.id; focusNodeOn(id, 2); state.selectedNode = state.nodeMap.get(id); render(); }); + }); +} + +let statsAnimated = false; +function animateStats() { + if (statsAnimated) return; statsAnimated = true; + const counts = { + nodes: state.nodes.length, edges: state.edges.length, + communities: state.communities.length, + files: new Set(state.nodes.filter(n => n.file_type === 'code').map(n => n.source_file)).size, + types: new Set(state.nodes.map(n => n.file_type)).size, + }; + Object.entries(counts).forEach(([key, target]) => { + const el = document.getElementById('stat-' + key); if (!el) return; + const duration = 1200, start = performance.now(); + function update() { + const t = Math.min(1, (performance.now() - start) / duration); + el.textContent = Math.floor((1 - Math.pow(1 - t, 3)) * target); + if (t < 1) requestAnimationFrame(update); else el.textContent = target; + } + update(); + }); +} + +function setupTimeline() { + const bar = document.getElementById('timeline-bar'), playBtn = document.getElementById('tl-play'); + const slider = document.getElementById('timeline-slider'), label = document.getElementById('timeline-label'); + let playing = false, animId = null; + playBtn.addEventListener('click', () => { playing = !playing; playBtn.textContent = playing ? '\u23F8' : '\u25B6'; if (playing) animateTimeline(); }); + slider.addEventListener('input', () => { const t = parseFloat(slider.value); label.textContent = Math.round(t*100)+'%'; setTimelineProgress(t); }); + function animateTimeline() { + if (!playing) return; + const val = parseFloat(slider.value) + 0.005; + if (val >= 1) { playing = false; playBtn.textContent = '\u21BB'; slider.value = 1; label.textContent = '100%'; setTimelineProgress(1); return; } + slider.value = val; label.textContent = Math.round(val*100)+'%'; setTimelineProgress(val); + animId = requestAnimationFrame(animateTimeline); + } + function setTimelineProgress(t) { + state.nodes.forEach((n, i) => { n.opacity = Math.min(1, (t * state.nodes.length - i + 10) / 10); n.scale = Math.min(1, (t * state.nodes.length - i + 5) / 5); }); + state.edges.forEach((e, i) => { e.opacity = Math.min(1, (t * state.edges.length - i + 5) / 5); }); + render(); + } + window.showTimeline = () => { bar.classList.add('visible'); }; + window.hideTimeline = () => { bar.classList.remove('visible'); playing = false; if (animId) cancelAnimationFrame(animId); }; +} + +const SHORTCUTS = { + 'f': () => fitGraph(), 'r': () => resetView(), 's': () => document.getElementById('search').focus(), + 'Escape': () => { resetView(); document.getElementById('search').blur(); document.getElementById('search-results').style.display = 'none'; }, + 't': () => document.getElementById('timeline-bar').classList.toggle('visible'), + 'b': () => document.getElementById('sidebar').classList.toggle('collapsed'), + 'p': () => exportPNG(), + '?': () => showShortcuts(), +}; +document.addEventListener('keydown', (e) => { + if (e.key === 'F11') { e.preventDefault(); toggleFullscreen(); return; } + const key = e.key === ' ' ? 'Space' : e.key; + const combo = e.ctrlKey ? 'ctrl+'+key.toLowerCase() : key.toLowerCase(); + if (SHORTCUTS[combo]) { e.preventDefault(); SHORTCUTS[combo](); } +}); +function showShortcuts() { + const items = [['F','Fit graph'],['R','Reset view'],['S','Search'],['Esc','Reset & close'],['T','Toggle timeline'],['B','Toggle sidebar'],['F11','Fullscreen'],['P','Export PNG'],['?','Show shortcuts']]; + const html = '
Keyboard Shortcuts
'+items.map(([k,d]) => '
'+d+''+k+'
').join('')+'
'; + showToast(html, 5000); +} + +function showContextMenu(e, node) { + const menu = document.getElementById('context-menu'); + const items = node ? [ + ['\u25C9', 'Focus node', function() { focusNodeOn(node.id, 2.5); }], + ['\u229E', 'Fit to node', function() { focusNodeOn(node.id, 2.5); }], + null, + ['\u2B07', 'Export PNG', exportPNG], + ['📄', 'Export SVG', exportSVG], + ] : [ + ['\u229E', 'Fit graph', fitGraph], + ['\u27F2', 'Reset view', resetView], + ['\u26F6', 'Fullscreen', toggleFullscreen], + null, + ['\u2B07', 'Export PNG', exportPNG], + ['📄', 'Export SVG', exportSVG], + null, + ['\u2600', 'Toggle theme', toggleTheme], + ]; + menu.innerHTML = items.map(item => { + if (!item) return '
'; + return '
'+item[0]+''+item[1]+'
'; + }).join(''); + menu.style.display = 'block'; + menu.style.left = Math.min(e.clientX, window.innerWidth - 200) + 'px'; + menu.style.top = Math.min(e.clientY, window.innerHeight - 200) + 'px'; + Array.from(menu.querySelectorAll('.ctx-item')).forEach((el, i) => { + const realIdx = items.filter(Boolean).length <= i ? -1 : items.filter(item => item !== null).indexOf(items.filter(item => item !== null)[i]); + const item = items.filter(item => item !== null)[i]; + if (item) el.addEventListener('click', function() { menu.style.display = 'none'; item[2](); }); + }); + document.addEventListener('click', function handler() { menu.style.display = 'none'; document.removeEventListener('click', handler); }, { once: true }); +} +canvas.addEventListener('contextmenu', (e) => { + e.preventDefault(); + const rect = canvas.getBoundingClientRect(); + const node = findNodeAt(e.clientX - rect.left, e.clientY - rect.top); + showContextMenu(e, node); +}); + +function toggleTheme() { + const root = document.documentElement; + const isDark = root.style.getPropertyValue('--bg-primary') !== '#ffffff'; + if (isDark) { + root.style.setProperty('--bg-primary', '#ffffff'); root.style.setProperty('--bg-secondary', '#f8f8fb'); + root.style.setProperty('--surface','rgba(0,0,0,0.03)'); root.style.setProperty('--surface-hover','rgba(0,0,0,0.06)'); root.style.setProperty('--surface-active','rgba(0,0,0,0.1)'); + root.style.setProperty('--border','rgba(0,0,0,0.08)'); root.style.setProperty('--border-hover','rgba(0,0,0,0.15)'); + root.style.setProperty('--text-primary','rgba(0,0,0,0.92)'); root.style.setProperty('--text-secondary','rgba(0,0,0,0.55)'); root.style.setProperty('--text-tertiary','rgba(0,0,0,0.30)'); + canvas.style.background = '#ffffff'; showToast('Light theme'); + } else { + root.style.setProperty('--bg-primary','#07070d'); root.style.setProperty('--bg-secondary','#0c0c1a'); + root.style.setProperty('--surface','rgba(255,255,255,0.04)'); root.style.setProperty('--surface-hover','rgba(255,255,255,0.08)'); root.style.setProperty('--surface-active','rgba(255,255,255,0.12)'); + root.style.setProperty('--border','rgba(255,255,255,0.06)'); root.style.setProperty('--border-hover','rgba(255,255,255,0.12)'); + root.style.setProperty('--text-primary','rgba(255,255,255,0.92)'); root.style.setProperty('--text-secondary','rgba(255,255,255,0.55)'); root.style.setProperty('--text-tertiary','rgba(255,255,255,0.30)'); + canvas.style.background = '#07070d'; showToast('Dark theme'); + } +} + +function showToast(msg, duration) { + const container = document.getElementById('toast-container'); + const el = document.createElement('div'); + el.className = 'toast'; + el.innerHTML = msg; + container.appendChild(el); + setTimeout(() => el.remove(), duration || 3000); +} + +function exportPNG() { + const dpr = window.devicePixelRatio || 1; + const w = canvas.width / dpr, h = canvas.height / dpr; + const offscreen = document.createElement('canvas'); + offscreen.width = canvas.width; offscreen.height = canvas.height; + const offCtx = offscreen.getContext('2d'); + offCtx.setTransform(dpr, 0, 0, dpr, 0, 0); + offCtx.fillStyle = '#07070d'; offCtx.fillRect(0, 0, w, h); + offCtx.save(); + offCtx.translate(state.transform.x, state.transform.y); + offCtx.scale(state.transform.k, state.transform.k); + state.edges.forEach(e => { + if (state.hiddenCommunities.has(e.sourceNode.community)) return; + offCtx.globalAlpha = 0.2; + const col = state.communityColors.get(e.sourceNode.community) || '#64748b'; + offCtx.strokeStyle = col; offCtx.lineWidth = 1; + offCtx.beginPath(); offCtx.moveTo(e.sourceNode.x, e.sourceNode.y); offCtx.lineTo(e.targetNode.x, e.targetNode.y); offCtx.stroke(); + }); + state.nodes.forEach(n => { + if (state.hiddenCommunities.has(n.community)) return; + offCtx.globalAlpha = n.opacity; offCtx.fillStyle = n.color; + offCtx.beginPath(); offCtx.arc(n.x, n.y, n.radius * n.scale, 0, Math.PI * 2); offCtx.fill(); + }); + offCtx.restore(); + const link = document.createElement('a'); + link.download = 'graphify-export.png'; link.href = offscreen.toDataURL('image/png'); link.click(); + showToast('Exported PNG'); +} + +function exportSVG() { + let svg = ''; + state.edges.forEach(e => { + if (state.hiddenCommunities.has(e.sourceNode.community)) return; + const col = state.communityColors.get(e.sourceNode.community) || '#64748b'; + svg += ''; + }); + state.nodes.forEach(n => { + if (state.hiddenCommunities.has(n.community)) return; + svg += ''; + }); + svg += ''; + const blob = new Blob([svg], { type: 'image/svg+xml' }); + const link = document.createElement('a'); + link.download = 'graphify-export.svg'; link.href = URL.createObjectURL(blob); link.click(); + URL.revokeObjectURL(link.href); + showToast('Exported SVG'); +} + +function toggleFullscreen() { + if (document.fullscreenElement) document.exitFullscreen(); + else document.documentElement.requestFullscreen(); +} + +function setQuality(level) { + if (level === 'low') { CFG.particleCount = 0; CFG.glowIntensity = 0; CFG.communityHaloOpacity = 0; } + else if (level === 'medium') { CFG.particleCount = 50; CFG.glowIntensity = 0.3; CFG.communityHaloOpacity = 0.03; } + else { CFG.particleCount = 150; CFG.glowIntensity = 0.6; CFG.communityHaloOpacity = 0.06; } + showToast('Quality: '+level); +} + +function setLoadStep(n) { + state.loadStep = n; + const steps = document.querySelectorAll('.step'); + steps.forEach((s, i) => { + s.classList.remove('active', 'done'); + if (i < n) s.classList.add('done'); + else if (i === n) s.classList.add('active'); + }); + document.querySelector('.progress-fill').style.width = (n / 7) * 100 + '%'; +} + +function animate(time) { + if (!state.running) return; + state.time = time; + if (CFG.particleCount > 0) { + state.particlePositions.forEach(p => { + p.t += p.speed; + if (p.t > 1) { + p.t = 0; + const edge = state.edges[Math.floor(Math.random() * state.edges.length)]; + if (edge) p.edgeIdx = state.edges.indexOf(edge); + } + }); + } + render(); + requestAnimationFrame(animate); +} + +function init() { + setLoadStep(0); + setTimeout(() => { + setLoadStep(1); processData(); + setLoadStep(2); createSimulation(); + setLoadStep(3); resizeCanvas(); resizeMinimap(); rebuildQuadtree(); + setLoadStep(4); buildCommunityList(); setupSearch(); setupTimeline(); + setLoadStep(5); + state.simulation.restart(); + let stabilized = false; + state.simulation.on('end', () => { + if (stabilized) return; stabilized = true; + setLoadStep(6); state.initialized = true; + state.nodes.forEach((n, i) => { setTimeout(() => { n.opacity = 1; n.scale = 1; }, i * 8); }); + state.edges.forEach((e, i) => { setTimeout(() => { e.opacity = 1; }, i * 4 + 200); }); + setTimeout(() => { + setLoadStep(7); fitGraph(); animateStats(); + setTimeout(() => { document.getElementById('loading-screen').classList.add('hidden'); }, 500); + }, state.nodes.length * 8 + 400); + requestAnimationFrame(animate); + }); + setTimeout(() => { if (state.simulation) state.simulation.alphaTarget(0).stop(); }, 4000); + }, 300); +} + +window.addEventListener('resize', () => { resizeCanvas(); resizeMinimap(); render(); }); +window.addEventListener('load', init); +window.fitGraph = fitGraph; window.resetView = resetView; +window.toggleFullscreen = toggleFullscreen; window.exportPNG = exportPNG; +window.exportSVG = exportSVG; window.toggleAllCommunities = toggleAllCommunities; +window.focusNodeOn = focusNodeOn; window.showInfo = showInfo; window.setQuality = setQuality; +""".replace('__NODES_JSON__', nodes_json).replace('__EDGES_JSON__', edges_json).replace('__LEGEND_JSON__', legend_json) _CONFIDENCE_SCORE_DEFAULTS = {"EXTRACTED": 1.0, "INFERRED": 0.5, "AMBIGUOUS": 0.2} @@ -730,13 +1339,10 @@ def to_html( vis_nodes.append({ "id": node_id, "label": label, - "color": {"background": color, "border": color, "highlight": {"background": "#ffffff", "border": color}}, - "size": round(size, 1), - "font": {"size": font_size, "color": "#ffffff"}, - "title": _html.escape(label), "community": cid, "community_name": sanitize_label((community_labels or {}).get(cid, f"Community {cid}")), "source_file": sanitize_label(str(data.get("source_file") or "")), + "source_location": sanitize_label(str(data.get("source_location", "") or "")), "file_type": data.get("file_type", ""), "degree": deg, }) @@ -754,17 +1360,18 @@ def to_html( vis_edges.append({ "from": true_src, "to": true_tgt, - "label": relation, - "title": _html.escape(f"{relation} [{confidence}]"), - "dashes": confidence != "EXTRACTED", - "width": 2 if confidence == "EXTRACTED" else 1, - "color": {"opacity": 0.7 if confidence == "EXTRACTED" else 0.35}, + "relation": relation, "confidence": confidence, + "weight": data.get("weight", 1.0), }) # Build community legend data legend_data = [] - for cid in sorted((community_labels or {}).keys()): + all_cids = set() + for n in vis_nodes: + if n["community"] is not None: + all_cids.add(n["community"]) + for cid in sorted(all_cids): color = COMMUNITY_COLORS[cid % len(COMMUNITY_COLORS)] lbl = _html.escape(sanitize_label((community_labels or {}).get(cid, f"Community {cid}"))) n = member_counts.get(cid, len(communities.get(cid, []))) if member_counts else len(communities.get(cid, [])) @@ -781,35 +1388,100 @@ def _js_safe(obj) -> str: title = _html.escape(sanitize_label(str(output_path))) stats = f"{G.number_of_nodes()} nodes · {G.number_of_edges()} edges · {len(communities)} communities" + file_type_counts = Counter(n.get("file_type", "unknown") for n in vis_nodes) + stats_data = { + "nodes": G.number_of_nodes(), + "edges": G.number_of_edges(), + "communities": len(communities), + "files": len({n.get("source_file", "") for n in vis_nodes if n.get("source_file")}), + "types": len(file_type_counts), + } + html = f""" -graphify - {title} - + +graphify — knowledge graph {_html_styles()} -
-