GithubHelp home page GithubHelp logo

sebastiannjose / angular-mappy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maeishoj/angular-mappy

0.0 2.0 0.0 217 KB

Vector-based choropleth world map with hover tooltips in AngularJS

License: MIT License

Shell 0.79% CSS 6.32% HTML 9.54% CoffeeScript 83.35%

angular-mappy's Introduction

angular-mappy

Vector-based world map with hover tooltips in AngularJS

Requires jQuery >1.9.1

Screenshot

screenshot

Example HTML

Simplest format:

<mappy data="data" map-data="mapPathData"></mappy>

See Attributes section and example.html for more info

Attributes

map-data

This is the path data used to draw the map. I've included a miller projection world map in a separate file.

data

The data used to color the map. It can be defined in multiple formats:

  1. Primitive

     data = {
       'GB' : 5,
       'US' : 3,
     }
    
  2. Objects (html requires the 'key' attribute)

     data = {
       'GB' : {metric: 5},
       'US' : {metric: 3},
     }
    
  3. Sub-categories (html requires the 'sub-category' attribute)

     data = {
       2005: {
         'GB': 5,
         'US': 3
       },
       2006: {
         'GB': 7,
         'US': 5
       }
     }
    
  4. A combination of 2&3

key (optional)

used in conjunction with the data attribute

####sub-category (optional)#### used in conjunction with the data attribute

####colors (optional)#### An array of hex strings can be passed to the directive for the color calculation in the format [minColor, midColor1, ..., maxColor]. This defaults to ["#FFFF00", "#FF0000"]. The color will calculated based on where the value lies on the specified range.

min (optional)

value to map to the minimum color as specified in the color range

####max (optional)#### value to map to the maximum color as specified in the color range

####humanize-fn (optional)#### angular expression that takes a parameter 'val' and returns the tooltip text

####normalize-fn (optional)#### angular expression that takes a parameter 'val' and returns a mapped value between 0 and 1. defaults to linear normalization between min/max (calculated from the given data unless explicitly specified)

angular-mappy's People

Contributors

mattosborn avatar

Watchers

 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.