Skip to content

Instantly share code, notes, and snippets.

@dukevis
dukevis / brush.js
Last active April 25, 2020 01:20 — forked from enjalot/brush.js
d3 Tutorial: Coordinated Views
if(!d3.chart) d3.chart = {};
d3.chart.brush = function() {
var g;
var data;
var width = 600;
var height = 30;
var dispatch = d3.dispatch(chart, "filter");
function chart(container) {
@dukevis
dukevis / README.md
Last active October 18, 2019 15:45 — forked from mbostock/.block
ITS Network Visualization

#ITS Network Visualization

####Force Layout

This visualization is based on the force layout by Mike Bostock, described as:

This example demonstrates how to create a force layout of a hierarchy whose internal nodes are collapsible. Leaf nodes are shown in orange, while internal nodes (packages) are shown in blue. Clicking on an internal node (without dragging) causes that node to expand or collapse, toggling the visibility of its descendant nodes.

We use the force layout as the basis of our visualization. Departments are shown by the larger, blue nodes, while individuals are shown as smaller orange nodes.

@dukevis
dukevis / README.md
Last active December 13, 2017 21:43 — forked from mbostock/.block
Chord Diagram

Chord diagrams show directed relationships among a group of entities. This example also demonstrates simple interactivity by using mouseover filtering. Layout inspired by Martin Krzywinski's beautiful work on Circos.

@dukevis
dukevis / code.js
Last active May 17, 2017 19:22
Autism bigram network with Cytoscape.js
$(function(){ // on dom ready
//console.log(network_data_file)
var colors2 = ["#8dd3c7","#bc80bd","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#ffed6f"]
var node_group = network_data_file.elements.nodes;
for (var i = 0; i < node_group.length; i++)
{
@dukevis
dukevis / index.html
Last active January 4, 2016 17:19
ClippingMask
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title Here</title>
<script type="text/javascript" src="../d3.v3/d3.v3.js"></script>
<style type="text/css">
.axis path,
.axis line{
fill: none;
@dukevis
dukevis / index.html
Last active January 4, 2016 15:09
Transitions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title Here</title>
<script type="text/javascript" src="../d3.v3/d3.v3.js"></script>
</head>
@dukevis
dukevis / index.html
Last active January 4, 2016 01:39
Scatter With Labels
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
.axis path,
.axis line{
fill: none;
stroke: black;
shape-rendering: crispEdges;
@dukevis
dukevis / accvisual.css
Last active December 31, 2015 15:19
ACC Tournament Chord Diagram
.chord path {
fill-opacity: .67;
stroke: #000;
stroke-width: .5px;
}
.ticks {
font-family: sans-serif;
}
@dukevis
dukevis / README.md
Last active December 28, 2015 09:39 — forked from mbostock/.block
Super Formulas

#Super Formulas

####Old Implementation: Christophe Viau implemented a new shape type as a D3 plugin based on superformulas. One nice property of these shapes is that you can easily tween between two shapes by simply interpolating the control points. Click on the blue shapes to try it!

####New Additions: We edited the Super Formulas from above so that when you click the main shape, it would alternate between a circle and a square. This was done in hopes of being used in the Force Layout, as an animation for each node.

@dukevis
dukevis / index.html
Last active September 21, 2015 01:35 — forked from mbostock/.block
Hierarchical Edge Bundling
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
font: 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.link {
stroke: steelblue;