Skip to content

Commit

Permalink
Introduce Improved Chord Diagram
Browse files Browse the repository at this point in the history
This chart extends the basic `Chord` by simply wrapping it and altering
its behavior through the exposed API.
  • Loading branch information
jugglinmike committed May 28, 2013
1 parent f6994da commit fb3a460
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@
});
myCustomChord(matrix);

var myImprovedChord = ImprovedChord();
myImprovedChord(matrix);

}(this));
18 changes: 18 additions & 0 deletions scripts/improved-chord-diagram.js
Original file line number Diff line number Diff line change
@@ -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.