TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Visualizing a Codebase

283 pointsby wattenbergeralmost 4 years ago
I explored an alternative way to view codebases to the typical folder&#x2F;file list, showing a bird&#x27;s-eye-view of its structure.<p>https:&#x2F;&#x2F;octo.github.com&#x2F;projects&#x2F;repo-visualization

38 comments

wattenbergeralmost 4 years ago
We always look at our code in a file&#x2F;folder list - I explored an alternative way to view codebases, showing a bird&#x27;s-eye-view of its structure. This write-up walks through the motivations, ways to use the visualization, and potential future directions (there are many!).<p>There&#x27;s also an interactive tool to check out your own repos and a GitHub Action if you want to integrate a diagram into a README.
hsn915almost 4 years ago
I honestly don&#x27;t understand the point of this.<p>Is it just a visualization of the directory structure?<p>I expect code visualization to more or less ignore the file structure and focus on semantic analysis. For example, show the major components of the system and how they interact. Perhaps the major components are represented by some kind of a module, or a collection of modules. I don&#x27;t have any concrete ideas. But I was expecting something in this vicinity.
评论 #28089682 未加载
hevalonalmost 4 years ago
Personally I find it interesting as tools like these have been helping me to understand the team&#x27;s and delivery dynamics when I&#x27;m joining new dev-teams.<p>This particular is great, as it reminds me of a book that I had read a while back; Your Code as a Crime Scene [1] by Adam Tornhill.<p>Adam is trying to explain something similar, but takes the whole concept onto the next level by explaining how tech debt and hidden coupling can be discovered using the git history and similar file structure visualisations.<p>[1] <a href="https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;atcrime&#x2F;your-code-as-a-crime-scene&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;atcrime&#x2F;your-code-as-a-crime-sce...</a>
评论 #28081365 未加载
breckalmost 4 years ago
This is so cool. I really appreciate how they added the &quot;Search for a file&quot; and &quot;Excluded paths&quot; to the demo. Makes it a lot more useful while still so simple to use.<p>Edit: the more I play with it the more I like it. Also just noticed their feature to deep link to repos (example: <a href="https:&#x2F;&#x2F;octo-repo-visualization.vercel.app&#x2F;?repo=owid%2Fowid-grapher" rel="nofollow">https:&#x2F;&#x2F;octo-repo-visualization.vercel.app&#x2F;?repo=owid%2Fowid...</a>). The future directions they mention also sound really exciting. Seeing files that cause a lot of CI failures, files by # of authors, files by # of changes, all that stuff would be really cool.
rckrdalmost 4 years ago
My favorite tool for visualizing a codebase is Gource. Here&#x27;s a 1 minute visualization of the Linux Kernel repository from 1991-2015 <a href="https:&#x2F;&#x2F;twitter.com&#x2F;mattrickard&#x2F;status&#x2F;1423366779590430721" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;mattrickard&#x2F;status&#x2F;1423366779590430721</a>
评论 #28081756 未加载
评论 #28080648 未加载
taericalmost 4 years ago
I really really want to like these sorts of visualizations. But they just fall flat on me.<p>The &quot;you can see really quickly...&quot; text is scrolling by and I&#x27;m like... &quot;Nope, that picture still means nothing to me.&quot; :(. It starts highlighting different parts and I&#x27;m completely at a loss on what is highlighted.<p>I do think this can be very effective once I&#x27;m trained on it. Such that I plan to play with it. But I just don&#x27;t visually think of programs in anything close to this manner.<p>Anyone know if studies that explore how we think of our programs?
评论 #28087367 未加载
akdasalmost 4 years ago
I worked on something like this a few years ago, only in VR so you could walk around the visualization and use your spatial recognition abilities in 3D.<p>One part we struggled with was evolving the visualization with the codebase. I see in the demos at the bottom that small changes to the codebase can have a large impact on the visualization (unless I&#x27;m missing something), making it difficult to treat the visualization as a fingerprint over time. I wonder if there are plans to address this.<p>This is an area I&#x27;m very interested in, happy to chat about it any time.
评论 #28081155 未加载
评论 #28080493 未加载
dvtalmost 4 years ago
Apologies for the hot take, but imo GitHub has been really knocking it out of the park with terrible ideas lately (remember how everyone fell all over themselves during the Copilot release?). This is an absolutely worthless visualization that only impresses those that haven&#x27;t heavily worked with visualizations. A few points right off the bat:<p><pre><code> - Labels are way too small, so you&#x27;ll need to zoom in.. - ...but if you zoom in, you&#x27;ll need to pan... - ...and if you need to pan, you lose context - Hovering over &quot;connected files&quot; is just a jumbled mess </code></pre> Case in point: look at the `paperjs&#x2F;paper.js` example they themselves provide. There&#x27;s a big circle called &quot;packages&quot; and inside that circle, two smaller circles that all contain the exact same files: &quot;package.json,&quot; &quot;index.js,&quot; and &quot;README.md&quot; -- how is this insightful in any way? I need to go to the repo to actually see that one of the folders is called &quot;paper-jsdom&quot; and the other one &quot;paper-jsdom-canvas.&quot; The visualization literally confuses me more than just looking at the repo.<p>I don&#x27;t mean to be overly negative, but it&#x27;s just not a good visualization and no one will ever seriously use this.
评论 #28083806 未加载
评论 #28081731 未加载
评论 #28085742 未加载
评论 #28081818 未加载
评论 #28081753 未加载
评论 #28081997 未加载
评论 #28090416 未加载
评论 #28084094 未加载
gus_massaalmost 4 years ago
I tried with <a href="https:&#x2F;&#x2F;github.com&#x2F;racket&#x2F;racket" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;racket&#x2F;racket</a> and for some reason it puts all the content of the subfolder &quot;racket&quot;&#x2F;&quot;src&quot; in a vertical strip near the middle of the circle instead of spreading the parts evenly. How is each part arranged?
评论 #28075612 未加载
noprotoalmost 4 years ago
Took a look at my own codebase, which is 99% Rust. All gray, I&#x27;m guessing Rust isn&#x27;t currently a recognized file type? Either way, very nice! I currently use the &quot;dirtree&quot; tool (<a href="https:&#x2F;&#x2F;github.com&#x2F;emad-elsaid&#x2F;dirtree" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;emad-elsaid&#x2F;dirtree</a>) to generate diagrams like this of my codebase for documentation: <a href="https:&#x2F;&#x2F;github.com&#x2F;WhiteBeamSec&#x2F;WhiteBeam&#x2F;wiki&#x2F;Code-layout" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WhiteBeamSec&#x2F;WhiteBeam&#x2F;wiki&#x2F;Code-layout</a><p>The &quot;eralchemy&quot; tool (<a href="https:&#x2F;&#x2F;github.com&#x2F;Alexis-benoist&#x2F;eralchemy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Alexis-benoist&#x2F;eralchemy</a>) is also excellent at visualizing SQL databases: <a href="https:&#x2F;&#x2F;github.com&#x2F;WhiteBeamSec&#x2F;WhiteBeam&#x2F;wiki&#x2F;SQL-schema" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WhiteBeamSec&#x2F;WhiteBeam&#x2F;wiki&#x2F;SQL-schema</a>
评论 #28082018 未加载
firealmost 4 years ago
Oddly enough, the page partially loads, hangs, crashes the tab and attempts to reload, hangs, and then crashes the entire running mobile chrome instance on my phone.<p>I don&#x27;t think I&#x27;ve ever seen that before! I&#x27;m guessing the page is just memory heavy and android 11&#x27;s memory manager can&#x27;t figure out how to deal with it.<p>( chrome mobile, pixel 3 xl, android 11 )
评论 #28081320 未加载
评论 #28085812 未加载
pronalmost 4 years ago
That&#x27;s the same visualisation used by CodeScene (<a href="https:&#x2F;&#x2F;codescene.com&#x2F;how-it-works&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codescene.com&#x2F;how-it-works&#x2F;</a>), but there is a more elaborate one that represents affinity (number of connections) as distance to create something like a geographical map: <a href="https:&#x2F;&#x2F;homepages.ecs.vuw.ac.nz&#x2F;~craig&#x2F;publications&#x2F;vissoft2015-hawes.pdf" rel="nofollow">https:&#x2F;&#x2F;homepages.ecs.vuw.ac.nz&#x2F;~craig&#x2F;publications&#x2F;vissoft2...</a>
er4hnalmost 4 years ago
Very fun! Would a similar visualization work for showing the insides of a go binary?<p>It would be super cool to have a way to visualize how different modules add bloat in size (and may pull in other bloaty modules as well)
juancampaalmost 4 years ago
This is cool but using rectangles instead of circles would help this visualization. Circles waste real estate and not friendly to labels (e.g. curved text that is harder to read)
评论 #28079296 未加载
评论 #28081309 未加载
评论 #28084383 未加载
graderjsalmost 4 years ago
I found this useful on my project. I realized I have many &#x27;dusts&#x27; files in directories. Tiny little guys just like grains of sand nestling among the larger circles, looking to be useful. Beautiful structure and images! I love seeing my beautiful work in this beautiful format. It really brings out the beauty! :)
arriualmost 4 years ago
Very cool! Reminds me a little bit of gource.<p><a href="https:&#x2F;&#x2F;gource.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gource.io&#x2F;</a>
agucovaalmost 4 years ago
This is actually something I&#x27;d consider adding to all of my big projects. It really does help with discoverability.
gnrlstalmost 4 years ago
Random nitpick: the issue with color coding files is that you may have many different file types leading to colors that overlap.<p>Case in point in the author&#x27;s create-react-app example: in one of the scrolling &quot;comment boxes&quot;, the author calls out that the &quot;tasks&#x2F;&quot; folder is mainly CSS files which made me raise an eyebrow...why would a tasks folder be mainly CSS files? -- and upon closer inspection of the colored legend .sh files are a VERY similar green. Just to satisfy my curiosity I visited the repo and sure enough, it was just .sh files, without a single .css file.<p>It makes me doubt the experience of the author...how can a folder called tasks&#x2F; (in any repo) be .css files?
devsatishalmost 4 years ago
This is cool . I remember using “Understand for C++” that does something like this , a full source code graph visualization- function flow etc. This of course starts as a folder visualization , but I see the value- seeing the big picture
ThePhysicistalmost 4 years ago
Did something similar some time ago: <a href="http:&#x2F;&#x2F;quantifiedcode.github.io&#x2F;code-is-beautiful&#x2F;" rel="nofollow">http:&#x2F;&#x2F;quantifiedcode.github.io&#x2F;code-is-beautiful&#x2F;</a>
评论 #28079061 未加载
评论 #28078929 未加载
nvartolomeialmost 4 years ago
The best tool I found for exploring code bases and navigating large projects is <a href="https:&#x2F;&#x2F;www.sourcetrail.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.sourcetrail.com&#x2F;</a>.
评论 #28078948 未加载
nephrenkaalmost 4 years ago
That&#x27;s a great visual presentation, but not really an innovation. The CodeScene tool has that built in together with a set of deep analyses on top (see <a href="https:&#x2F;&#x2F;codescene.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codescene.com&#x2F;</a>).<p>There are several public conference talks that cover this visualization and related use cases: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=fl4aZ2KXBsQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=fl4aZ2KXBsQ</a>
padatoralmost 4 years ago
Shameless plug, but this was also showing the content of the file! <a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;pfff&#x2F;wiki&#x2F;CodeMap" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;pfff&#x2F;wiki&#x2F;CodeMap</a><p>There are lots of examples of OSS projects visualized here: <a href="https:&#x2F;&#x2F;github.com&#x2F;facebookarchive&#x2F;pfff&#x2F;wiki&#x2F;Examples" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebookarchive&#x2F;pfff&#x2F;wiki&#x2F;Examples</a>
KronisLValmost 4 years ago
I find that it&#x27;s useful not just to look at the current contents of codebase, but how it has evolved over time. For example, after being onboarded, this lets me see where most of the current effort on a codebase is concentrated and what the biggest recent changes have been.<p>For this, i believe that Gource is a lovely tool, which you can just point at a Git repository and it will visualize it: <a href="https:&#x2F;&#x2F;gource.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gource.io&#x2F;</a>
anigbrowlalmost 4 years ago
Nice implementation. I especially like the curved directory titles.
hashharalmost 4 years ago
I like the quick insights I can gain from this! Very promising. It&#x27;s very basic in it&#x27;s current implementation but I see a lot of potential specially about the &quot;how files are linked&quot; part.<p>It&#x27;s a nice bird&#x27;s eye view. One thing I&#x27;d like is for there to be multiple metrics to use for the size of packages e.g. lines of code, number of files, number of methods etc.<p>That way you can make sense of what are the heavyweight parts of the codebase.
eyelidlessnessalmost 4 years ago
Weird seeing this as a Show HN. That said: since MS and GitHub are the same company… one of the things I really want is to be able to opt in to reference&#x2F;search into dependencies. I don’t need visualization, I need “yes show me node_modules&#x2F;*&#x2F;*.js when normally I wouldn’t want that.” I use a VSCode extension that does this in the file browser, but I want it across everything that determines whether something is hidden.
banana_giraffealmost 4 years ago
Perhaps it&#x27;s not fair, but the first repo I thought of trying, aws&#x2F;aws-cli caused it to freeze my browser&#x27;s tab. When it finally unfroze, I&#x27;m presented with a few large circles and way too many tiny dots to be useful.<p>Guess there&#x27;s an upper limit on the size of the repo, or perhaps it&#x27;s more geared to different &quot;shapes&quot; of layouts.
zkldialmost 4 years ago
Is this site critically slow in firefox for anyone else or just me? It&#x27;s running at around 1fps...
slava_kiosealmost 4 years ago
Thank you very much for the article! Everything is available, very useful information!
imagineerschoolalmost 4 years ago
Very interesting and illuminating!<p>Please continue on this adventure, you&#x27;re onto something great!
snarkypixelalmost 4 years ago
So cool and useful!
cameronbrownalmost 4 years ago
Is there anything like this, but for visualising the connections between git commits, files, GitHub issues, maybe even classes etc...?
评论 #28134272 未加载
Waterluvianalmost 4 years ago
I got half way down the page to a full screen graph and it was impossible to scroll further.<p>Can we just not do these cute UI gimmicks?
butwhywhyohalmost 4 years ago
How is this any different from just showing the fully expanded tree of the folder structure?
arvindrajnaidualmost 4 years ago
Now if we can just click on those circles and start coding.
agustifalmost 4 years ago
I can&#x27;t access it, HN hug of death?
评论 #28079114 未加载
nathiasalmost 4 years ago
I prefer tree.