Skip to content

Instantly share code, notes, and snippets.

View wcjohnson11's full-sized avatar
🦕

wcj wcjohnson11

🦕
View GitHub Profile
<script>
import * as d3 from 'd3';
export default {
name: 'LineChart',
props: {
data: {
required: true,
type: Array,
},
<script>
import * as d3 from 'd3';
const data = [99, 71, 78, 25, 36, 92];
export default {
name: 'WrongLineChart',
props: {
data: {
required: true,
type: Array,
@wcjohnson11
wcjohnson11 / Cherry Picking Multiple Commits.md
Created April 15, 2016 00:51 — forked from grafikchaos/Cherry Picking Multiple Commits.md
Cherry pick multiple commits from a remote or upstream branch
@wcjohnson11
wcjohnson11 / geoData.json
Last active August 29, 2015 14:27 — forked from blehman/geoData.json
d3 map (basic)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wcjohnson11
wcjohnson11 / README.md
Last active August 29, 2015 14:26 — forked from Neilos/README.md
Bi-directional hierarchical sankey diagram

This is a demonstration of a bi-directional hierarchical sankey diagram produced in javascript, html and css using d3. (Refresh page to generate new random data)

Sankey diagrams represent flows between nodes by varying the thickness of the connecting links.

This diagram was based off of Mike Bostock's sankey diagram, but additionally incorporates bi-directionality into the flow and caters for hierarchical relationships between nodes to allow drill down into the data.

All javascript code to generate the diagram markup is contained in the app.js file, but the underlying calculations are performed using a custom plugin: bihisankey.js.

@wcjohnson11
wcjohnson11 / README.md
Last active August 29, 2015 14:26 — forked from mbostock/.block
Random Tree

This example builds a random tree using the Reingold-Tilford "tidy" algorithm, as described in "Tidier Drawings of Trees" and implemented by d3.layout.tree. As each node is added to the graph, it enters from the previous position of the parent node. Thus, the existing nodes and the new node transition smoothly to their new positions. The animation stops when 500 nodes have been added to the tree.

Fine-grained control of randomly entering and exiting things in D3.js, for impeccable object constancy. Adapted from an example co-authored with Mike Bostock.

/**
* Original author: David Eads (https://github.com/eads)
*
* Wrap D3 charting components in a simple Backbone view interface
*
* Provides a redrawing path, data sync, and fallback for non-d3 browsers.
*
* Views that extend ChartView should implement their own "draw" function and go to work.
*
* var collection = new Backbone.Collection([ ["Maria", 33], ["Heather", 29] ]);