Permalink
Browse files

Introduce Improved Chord Diagram

This chart extends the basic `Chord` by simply wrapping it and altering
its behavior through the exposed API.
  • Loading branch information...
jugglinmike committed Mar 3, 2013
1 parent f6994da commit fb3a460677b6b5f1b822055491e3bf202d1558b4
Showing with 22 additions and 0 deletions.
  1. +1 −0 index.html
  2. +3 −0 scripts/app.js
  3. +18 −0 scripts/improved-chord-diagram.js
View
@@ -9,6 +9,7 @@
<script src="scripts/bar-chart.js"></script>
<script src="scripts/fading-bar-chart.js"></script>
<script src="scripts/chord-diagram.js"></script>
<script src="scripts/improved-chord-diagram.js"></script>
<link rel="stylesheet" href="styles/index.css"></link>
</head>
<body>
View
@@ -59,4 +59,7 @@
});
myCustomChord(matrix);
var myImprovedChord = ImprovedChord();
myImprovedChord(matrix);
}(this));
@@ -0,0 +1,18 @@
window.ImprovedChord = function(options) {
"use strict";
var Chord = window.Chord;
var improvedChord = Chord(options);
improvedChord.colors = ["#000000", "#FFDD89", "#957244", "#F26224"];
improvedChord.layers.ticks.on("enter", function() {
this.each(function(data, idx, group) {
d3.select(this)
.style("font-weight", "bold")
.attr("fill", improvedChord.colors[group]);
});
});
return improvedChord;
};

0 comments on commit fb3a460

Please sign in to comment.