Giter VIP home page Giter VIP logo

carthagogram's Introduction

Carthagogram

A JavaScript Cartogram Generator in the browser

This is mostly based on Scape Toad a GPL-licensed Cartogram Generator written in Java.

Quickstart:

python run.py

Serves carthagogram on localhost:8000 and opens it in a browser.

The algorithm is based on Gastner et al. paper "Diffusion-based method for producing density-equalizing maps".

Carthagogram tries to improve on the following:

  • web-based: accessible to everyone in an easy way
  • SVG files as input
  • area value editor

Uses Web Workers to perform calculation in background. Calculation takes about 3-5 minutes in Chrome.

Code is a quick-and-dirty translation from Java to JavaScript mainly converting Java classes to JavaScript modules. There are some TODOs in the code in places where original functionality was removed in order to make it work. These places need to be adressed some time.

Note: The (over)use of the module pattern in the code might make it memory intensive because functions are not reused for the same object types.

Currently only SVGs where no path has holes are known to work. Berlin is an example of that. SVGs with paths that have holes go crazy.

The index.html represents an example interface. Due to ajax svg loading it works only when executed on a webserver (like localhost), not via file:///.

build.sh uses sprocketize to insert the separate js modules into one web worker. Web worker have an own dependency API that could be used. build.sh also uses closure compiler to make the code smaller and faster.

The included image of Cato is from wikimedia and in the public domain.

carthagogram's People

Contributors

stefanw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

adg29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.