Getting started:
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
Getting started:
Related tutorials:
license: gpl-3.0 |
d3.legend is a quick hack to add a legend to a d3
chart. Simply add a g
and .call(d3.legend)
. Any elements that have a title set in the "data-legend"
attribute will be included when d3.legend
is called. Each title will appear only once (even when multiple items define the same data-legend) as the process uses a set based on a existing names, not an array of all items.
By default the color in the legend will try to match the fill attribute or the stroke attribute of the relevant items. Color can be explicitly defined by attribute "data-legend-color"
The order of items in the legend will be sorted using the top of the bounding box for each included item. The order can be explicitly defined by attribute "data-legend-pos"
# Responsive Stacked Horizontal Bar Chart using D3.js and Bootstrap CSS | |
It uses the following: | |
* D3.js v3 | |
* Bootstrap CSS v3.3.5 | |
It has the following features: |
Example using spin.js during load of JSON data for a D3 chart
Showing the spinner/loader being triggered before the JSON callback, and stopped within the JSON callback (hence after the JSON data has been loaded):
// loader settings
var target = document.getElementById('#chart-id');
function init() {
This is a demonstration of how to create a combination town/county map from a shapefile using TopoJSON and d3.js.
It includes a simplified version of the code used for the Massachusetts special Senate election results on The Huffington Post.
Download a shapefile of Massachusetts towns from the state's GIS site:
wget http://wsgw.mass.gov/data/gispub/shape/census2000/towns/census2000towns_poly.exe
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'
/* | |
* File: bst.js | |
* | |
* A pure JavaScript implementation of a binary search tree. | |
* | |
*/ | |
/* | |
* Class: BST | |
* |