Giter VIP home page Giter VIP logo

interactive-uk-cartogram-2015's Introduction

interactive-election2015-uk-cartogram

UK cartogram for constituency explorer and seat change mapper:

what did the opinion polls say about your seat?

Getting started

If you haven't already installed the following requirements:

Next, install all the dependency packages and start the app:

> npm install
> bower install
> grunt

You can now view the example project running at [http://localhost:9000/]

Project structure

The interactive template comes with a sample project that loads a template HTML file, local JSON and remote JSON. Modify, replace or delete whatever you need for your project.

The template uses requireJS to namespace, concatenate and minify the final output code, it also allows the simplified inclusion of third-party libraries via bower. Therefore, it would be preferable if you write your code as AMD modules.

/build (grunt build output folder)
/src
    - boot.js (the main boot.js for inline loading, see Loading interactives)
    - index.html (used for local testing of boot.js)
    /embed
        - index.html (used for iframe embed loading)
        - boot.js (used for iframe embed loading)
    /js
        - main.js (the starting point for the whole interactive)
        - require.js (requireJS config paths to third-party libraries)
        /data (sample local data)
        /templates (sample template HTML)
    /imgs
    /css
        - main.scss (the main interactive's SASS CSS styles)
        /modules (additional SASS CSS modules)

Installing additional libraries

If you need to use any additional libraries such as D3 or jquery then use:

bower install d3 --save

That will update the bower.json dependency file and allow requirejs to bundle the library into the main js.

You can then require the library directly into your code via the define function:

define(['d3', function(d3) {
  var chart = d3.box();
});

interactive-uk-cartogram-2015's People

Contributors

littleark avatar pomme15 avatar seanclarkeguardian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.