Giter Site home page Giter Site logo

pcpgeojson's Introduction

Parallel Coordinate Plots for GeoJSON Feature Collections

This is an extremely simple plug-in for D3 that generates an SVG-based parallel coordinate plot for a GeoJSON Feature Collection.

This code was heavily influenced by Jason Davies' Parallel Coordinates example. In fact, you might even say I just straight-up copied the code and changed it to meet my needs. Because, that's exactly what I did. Thank you, Jason, for this example.

Again, this is an extremely simple implementation of a Parallel Coordinate Plot. If you need something more complex or detailed, I suggest you take a look at Syntagmatic's Parallel Coordinates plug-in.

API

# d3.pcpGeoJson(collection[, options])

Creates a parallel coordinate plot for the properties, with values of type Number, of each Features in a Feature Collection. Returns a reference to

The collection parameter is required and must be a GeoJSON Feature collection. Behavior is undefined if this parameter is not a Feature Collection.

The options parameter is an optional object that allows you to define the following properties:

  • id : [String] The ID of the container for the PCP, defaults to 'body'
  • keys : [Array] List of all property names to be used as dimensions of the PCP, defaults to all properties in the first feature that has data of type Number
  • buffers : [Array] Array of numbers, must specify all; [top, right, bottom, left], defaults to [30, 10, 10, 10]
  • width : [Number] Width of the plot, defaults to 960
  • height : [Number] Height of the plot, defaults to 500
  • linker : [Function] Details to come...

Linking Functionality

Details to come.

Example Usage

<html lang="en">
<head>
  <script src="//d3.v3.min.js" charset="utf-8"></script>
  <script src="//d3.pcpGeoJson.min.js"></script>
  <link href="//d3.pcpGeoJson.css" rel='stylesheet' />
</head>
<body>
  <script type="text/javascript">
    d3.json('collection.json', function (error, collection) {
      if (error) {
        return console.warn(error);
      }

      d3.pcpGeoJson(collection);
    })
  </script>
</body>
</html>

pcpgeojson's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pcpgeojson's Issues

FR: Add support for brushing events

The axes support brushing functionality, which allows some data to be focused on while the rest is pushed to the back. Adding support to the linking functionality and updating the return variable to allow access to the selected data would make this tool far more useful.

FR: Add support for axis title click events

When someone clicks on the title of an axis, the title should become selected and the linker should send an event notifying other views in the app that the selected title has changed.

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.