Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

GoCity: Turn your Golang program into a 3D city

Save for later
  • 2 min read
  • 05 Nov 2018

article-image

A team from Federal University of Minas Gerais (UFMG) created a Code City metaphor for visualizing Golang source code called GoCity. You simply paste the IRL to a GitHub repository and GoCity plots it out as a city with districts and buildings. It allows you to visualize your code as a neat three-dimensional city.

GoCity represents a program written in Go as a city:

  • The folders are represented as districts
  • Files in the program are shown as buildings of varying heights, shapes, and sizes
  • The structs are represented as buildings stacked on the top of their files

Characteristics of the structures

  • The Number of Lines of Source Code (LOC) represents the building color. Higher values make the building dark.
  • Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at €18.99/month. Cancel anytime
  • The Number of Variables (NOV) in the program affects the building's base size.
  • The Number of methods (NOM) in the program affects the height of the.

The UI/front-end


The UI for GoCIty is built with React and uses babylon.js to plot the 3D structures. The source code for the front-end is available in the front-end branch on GitHub.

What the users are saying


A comment on Hacker news by user napsterbr reads: “Cool! Interestingly I always use a similar metaphor on my own projects. For instance, the event system may be seen as the roads linking different blocks (domains), each with their own building (module).

The Kubernetes repository does seem to take a toll as it forms a lot of buildings spaced out. “The granddaddy of them all, Kubernetes, takes quite a toll performance-wise. https://go-city.github.io/#/github.com/kubernetes/kubernetes.”

But like another user jackwilsdon pointed out on Reddit: “Try github.com/golang/go if you want some real browser-hanging action!

For more details, visit the GitHub repository. For an interactive live demonstration, visit the Go City website.

Golang plans to add a core implementation of an internal language server protocol

Why Golang is the fastest growing language on GitHub

GoMobile: GoLang’s Foray into the Mobile World