Jonathan Huang fc7911a2e0 Fix Pointmap Selection Tool Example 5 (#12)
* [EXAMPLES] fix selection tool example

* [TRAVIS] fixed file path for after success
2017-05-05 11:09:34 -07:00
2017-05-04 19:06:24 -07:00
2017-04-30 22:08:35 -07:00
2017-04-26 15:59:07 -07:00
2017-04-30 22:08:35 -07:00
2017-04-30 22:08:35 -07:00
2017-05-04 19:06:24 -07:00
2017-04-30 22:08:35 -07:00

MapD Charting

Dimensional charting built to work natively with crossfilter rendered using d3.js.

Table of Contents

Quick Start

Step 1: Install Dependencies
npm install #downloads all dependencies and devDependencies
npm install mapbox-gl@https://github.com/mapd/mapbox-gl-js/tarball/9c04de6949fe498c8c79f5c0627dfd6d6321f307 #downloads mapbox peer dependency
Step 2: Run Start Script
npm run start

Screenshots

Flights Dataset: Brushing on timeline with Bubble Chart and Row Chart

example1

Tweets Dataset: Brushing on timeline and hovering on Pointmap datapoint which displays row information

example2

Tweets Dataset: Using MapD-Draw tool on pointmap to select specific areas on a map

example5

Synopsis

MapD-Charting is a superfast charting library that works natively with crossfilter that is based off dc.js. It is designed to work with MapD-Connector and MapD-Crossfilter to create charts instantly with our MapD-Core SQL Database. Please see examples for further understanding to quickly create interactive charts.

Our Tweetmap Demo was made only using MapD-Charting.

Examples

Development Guidelines

Use Asynchronous Methods

Asynchronous methods must be used. Synchronous methods are depreacted and cause a bad user experience.

For instance, use the asynchronous versions of the render and redraw methods:

// bad
chart.render()
chart.redraw()

// good
chart.renderAsync()
chart.redrawAsync()

Since our version of DC must make asynchronous requests to get data, use the dataAsync() method for this request and only use data() as the cached result of dataAsync()

// bad
chart.data((group) => {
  return group.top()
})

// good
chart.dataAsync((group, callback) => {
  group.topAsync()
    .then(result => {
      chart.dataCache = result
      callback(null, result)
    })
    .catch(e => callback(e))
})

chart.data(() => chart.dataCache)

Testing

New components in MapD-Charting should be unit-tested and linted. All tests will be in the same folder as the new component.

+-- src
|   +-- /mixins/new-mixin-component.js
|   +-- /mixins/new-mixin-component.unit.spec.js

The linter and all tests run on

npm run test

To check only unit-tests run:

npm run test:unit

Linting

Please lint all your code in mapd-charting/. The lint config file can be found in .eslintrc.json. For new new components, please fix all lint warnings and errors.

Scripts

Command Description
npm run start Copies files for examples and then serves the example
npm run build Runs webpack and builds js and css in /dist
npm run docs Creates and opens docs
npm run nyc Runs coverage reporting for unit tests
npm run test Runs both linting and unit tests
npm run clean Removes node modules, dist, docs, and example files
Description
Dimensional charting built to work natively with crossfilter rendered using d3.js
Readme 259 MiB
Languages
JavaScript 90.2%
HTML 5.3%
SCSS 3.7%
Elixir 0.4%
CSS 0.4%