mobomo/d3-fakebook

Name: d3-fakebook

Owner: mobomo

Description: NO LONGER MAINTAINED: A useful collection of scripts to get you working with D3, quickly.

Created: 2014-02-12 00:04:56.0

Updated: 2017-06-14 20:54:21.0

Pushed: 2016-04-14 22:53:02.0

Homepage: http://intridea.github.io/d3-fakebook

Size: 204

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits
Mike Tierney2016-04-14 22:53:02.049

Other Committers

UserEmailMost Recent Commit# Commits

README

d3-fakebook

NOTICE

This project is no longer maintained. If you're interested in contributing (or possibly taking it over), please contact the current maintainers and let them know.


A useful collection of scripts to get you working with D3, quickly.

Read the docs for more information on how to use the API.

Basic usage:

<!-- in index.html -->
<div id="stocks"></div>

// in main.js
// From the D3 Basic Line Chart example: http://bl.ocks.org/mbostock/3883245
d3.tsv('./data/aapl_stock.tsv', function(error, data) {
  if (error) {
    console.error(error);
  } else {
    var chart = new D3Fakebook.TimeScaleLine('#stocks', {
      data : data,
      valueName : 'close',
      showPoints : false
    });
    chart.render();
  }
});
Styles

Until this issue is resolved, it's recommended that you pull in the styles found in the demo page CSS, which contains some very basic (but important) styles for the charts.

Installation
Bower
$ bower install d3-fakebook

This will install D3 Fakebook as well as both D3 and Underscore to a bower_components directory.

Build files

The production-ready files are stored in the dist directory.

Alternately, the coffeescript files in the src directory can be added to your coffeescript project. However, keep in mind that (currently) these aren't proper modules, and the specific chart-types are dependent on the core file, which is in turn dependent on the legend file.

Dependencies

This project depends on D3 (3.4.2 or newer) and Underscore (Lo-Dash should also work, though it hasn't been tested). Copies of each are included in the dist directory.

Development

You'll need to get your environment set up and working in order to work with the codebase. This project depends on node and npm, and through that it also depends on bower. Assuming you have node (and npm) installed, do the following:

$ npm install && bower install

This will download and install the packages that you need in order to work with the codebase.

PRs and Patches

Please be sure to include test cases for any patches that are submitted.

Gulp

We're using Gulp as the build tool and task runner for this project.

The default task will compile the coffeescript files and start a filewatcher. The files in the example directory will load this compiled code as well as D3 and Underscore (via Bower).

The available tasks are:

Testing

The test suite is built up with Mocha, using Chai and Sinon, using Karma as a test runner. All of the files in the test suite are loaded via Require.js (to help with isolation) and are compiled from CoffeeScript on the fly.

“Fakebook”?

The concept of a 'fake book' comes from Jazz improvisation - the intent was to provide a roadmap for the playing of Jazz standards, and then the musicians would improvise on top of the main melody, making the song their own.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.