Skip to content

Map of ZIP codes of cities in Slovakia visualized with d3.js

Notifications You must be signed in to change notification settings

lucyia/zip-map-slovakia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Map of ZIP codes

Interactive map of ZIP codes of cities in Slovakia; inspired by the book Visualizing data by Ben Fry.

About

The visualization helps to analyze the system of ZIP codes of Slovakia (or in Slovak, PSČ - Poštovné smerovacie číslo) which consist of five numbers.

When interacting with the visualization, you can find the answers to the following questions:

  • Is there any pattern in the ZIP code system?
  • Where is a particular ZIP code and to what city it belongs to?
  • What is the population of a given city with given ZIP code?

Implementation

Data for this visualization was extracted from Wikipedia's list of municipalities and towns in Slovakia.

The code is written as single IIFE where data is extracted from CSV file, then visualized. Pan & zoom is provided by D3. Custom tooltip displaying information about cities provided by D3-tip. Vis is updated according to the number and checkbox inputs, see Options.

Dependencies

  • D3.js
  • D3-tip.js

Options

The visualization is updated according to three inputs:

  • Number input - ZIP code made out of five digits (starting by 0, 9 or 8)
  • Population - choice for scaling a circle representing a city according to its population
  • Color of the next number - choice for matching the next number of a ZIP code to a color to see if there is any particular logic of ZIP code numbers

Life demo

Visualization of ZIP codes of Slovakia

Demo: ZIP codes of Slovakia

First number coloured: ZIP codes of Slovakia - first number coloured

Second number coloured: ZIP codes of Slovakia - second number coloured

Licence

MIT