Skip to content

Commit

Permalink
Version 2.2.2
Browse files Browse the repository at this point in the history
- More! Heatmap Improvements.
- Refactored dispatch.
- Added merge() to all parent charts.
  • Loading branch information
jamesleesaunders committed Jan 17, 2018
1 parent 9bf4af0 commit 94e7aa6
Show file tree
Hide file tree
Showing 37 changed files with 260 additions and 198 deletions.
180 changes: 107 additions & 73 deletions build/d3-ez.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/d3-ez.min.js

Large diffs are not rendered by default.

Binary file modified build/d3-ez.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/BarChartClusteredExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
.on("customSeriesClick", function(d) {
console.log(d);
});

Expand Down
12 changes: 6 additions & 6 deletions examples/BarChartStackedExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Add to page
d3.select("#chartholder")
Expand Down
12 changes: 6 additions & 6 deletions examples/BarChartVerticalExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d, i) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Add to page
function update() {
Expand Down
12 changes: 6 additions & 6 deletions examples/DonutChartExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Add to page
function update() {
Expand Down
12 changes: 6 additions & 6 deletions examples/HeatMapRadialExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Convert json to d3-ez data format
var data = d3.nest().key(function(d) {
Expand Down
2 changes: 1 addition & 1 deletion examples/HtmlListExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Create chart object
var myList = d3.ez.component.htmlList()
.classed("htmlList")
.on("customMouseOver", function(d) {
.on("customValueMouseOver", function(d) {
console.log(d);
});

Expand Down
4 changes: 2 additions & 2 deletions examples/HtmlTableExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
// Create chart object
var myTable = d3.ez.component.htmlTable()
.width(600)
.on("customMouseOver", function(d) {
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
.on("customSeriesClick", function(d) {
console.log(d);
});

Expand Down
12 changes: 6 additions & 6 deletions examples/LineChartExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

d3.select('#chartholder')
.datum(data)
Expand Down
12 changes: 6 additions & 6 deletions examples/PolarAreaChartExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Add to page
function update() {
Expand Down
12 changes: 6 additions & 6 deletions examples/PunchCardExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
.chart(chart)
.legend(legend)
.title(title)
.on("customMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customClick", function(d) {
console.log(d);
});
.on("customValueMouseOver", function(d) {
d3.select("#message").text(d.value);
})
.on("customSeriesClick", function(d) {
console.log(d);
});

// Convert json to d3-ez data format
var data = d3.nest().key(function(d) {
Expand Down
8 changes: 4 additions & 4 deletions examples/Showcase.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Setup chart components
myChart1 = d3.ez.component.htmlTable()
.width(400)
.on("customClick", function(d) {
.on("customSeriesClick", function(d) {
update5(data);
update2(d);
update3(d);
Expand All @@ -37,7 +37,7 @@
myChart2 = d3.ez.chart.barChartVertical()
.width(400)
.height(200)
.on("customMouseOver", function(d) {
.on("customValueMouseOver", function(d) {
console.log(d);
});

Expand All @@ -54,7 +54,7 @@
.width(400)
.height(200)
.yAxisLabel("Fruit")
.on("customClick", function(d) {
.on("customSeriesClick", function(d) {
update2(d);
update3(d);
update4(d);
Expand All @@ -75,7 +75,7 @@
.minRadius(2)
.useGlobalScale(true)
.maxRadius(18)
.on("customMouseOver", function(d) {
.on("customValueMouseOver", function(d) {
console.log(d);
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-ez",
"version": "2.2.1",
"version": "2.2.2",
"description": "D3 Easy Reusable Chart Library",
"license": "GPL-3.0",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ d3.ez.chart = function module() {
var colorScale = undefined;

// Dispatch (custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick", "customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

function init(data) {
canvasW = width - (margin.left + margin.right);
Expand Down
5 changes: 4 additions & 1 deletion src/chart/barChartClustered.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ d3.ez.chart.barChartClustered = function module() {
var categoryNames;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

// Other Customisation Options
var yAxisLabel = null;
Expand Down Expand Up @@ -144,8 +144,11 @@ d3.ez.chart.barChartClustered = function module() {
.classed("seriesGroup", true)
.attr("transform", function(d) { return "translate(" + xScale(d.key) + ", 0)"; })
.datum(function(d) { return d; })
.merge(seriesGroup)
.call(barsVertical);

seriesGroup.exit()
.remove();
});
}

Expand Down
5 changes: 4 additions & 1 deletion src/chart/barChartStacked.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ d3.ez.chart.barChartStacked = function module() {
var categoryNames;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

// Other Customisation Options
var yAxisLabel = null;
Expand Down Expand Up @@ -144,8 +144,11 @@ d3.ez.chart.barChartStacked = function module() {
.classed("seriesGroup", true)
.attr("transform", function(d) { return "translate(" + xScale(d.key) + ", 0)"; })
.datum(function(d) { return d; })
.merge(seriesGroup)
.call(barsStacked);

seriesGroup.exit()
.remove();
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/chart/barChartVertical.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ d3.ez.chart.barChartVertical = function module() {
var colorScale;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

// Other Customisation Options
var yAxisLabel;
Expand Down
2 changes: 1 addition & 1 deletion src/chart/donutChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ d3.ez.chart.donutChart = function module() {
var categoryNames = [];

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

function init(data) {
chartW = width - (margin.left + margin.right);
Expand Down
16 changes: 9 additions & 7 deletions src/chart/heatMapRadial.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ d3.ez.chart.heatMapRadial = function module() {
var thresholds;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

function init(data) {
chartW = width - (margin.left + margin.right);
Expand Down Expand Up @@ -122,15 +122,17 @@ d3.ez.chart.heatMapRadial = function module() {
.dispatch(dispatch);

var seriesGroup = chart.select(".circleRings").selectAll(".seriesGroup")
.data(function(d) { return d; })
.enter()
.append("g")
.attr("class", "seriesGroup");
.data(function(d) { return d; });

seriesGroup.datum(function(d) { return d; })
seriesGroup.enter()
.append("g")
.attr("class", "seriesGroup")
.merge(seriesGroup)
.datum(function(d) { return d; })
.call(heatMapRing);

seriesGroup.exit().remove();
seriesGroup.exit()
.remove();

// Circular Labels
var circularLabels = d3.ez.component.circularLabels()
Expand Down
34 changes: 19 additions & 15 deletions src/chart/lineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ d3.ez.chart.lineChart = function module() {
var groupNames;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

// Other Customisation Options
var yAxisLabel = null;
Expand Down Expand Up @@ -147,26 +147,30 @@ d3.ez.chart.lineChart = function module() {
.dispatch(dispatch);

var lineGroup = chart.selectAll(".lineGroup")
.data(function(d) { return d; })
.enter().append("g")
.attr("class", "lineGroup")
.style("fill", function(d) { return colorScale(d.key); });
.data(function(d) { return d; });

lineGroup.datum(function(d) { return d; })
.call(lineChart).call(scatterPlot);
lineGroup.enter().append("g")
.attr("class", "lineGroup")
.style("fill", function(d) { return colorScale(d.key); })
.datum(function(d) { return d; })
.merge(lineGroup)
.call(lineChart).call(scatterPlot);

lineGroup.exit().remove();
lineGroup.exit()
.remove();

var dotGroup = chart.selectAll(".dotGroup")
.data(function(d) { return d; })
.enter().append("g")
.attr("class", "dotGroup")
.style("fill", function(d) { return colorScale(d.key); });
.data(function(d) { return d; });

dotGroup.datum(function(d) { return d; })
.call(scatterPlot);
dotGroup.enter().append("g")
.attr("class", "dotGroup")
.style("fill", function(d) { return colorScale(d.key); })
.datum(function(d) { return d; })
.merge(gotGroup)
.call(scatterPlot);

dotGroup.exit().remove();
dotGroup.exit()
.remove();
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/chart/polarAreaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ d3.ez.chart.polarAreaChart = function module() {
var maxValue = 0;

// Dispatch (Custom events)
var dispatch = d3.dispatch("customMouseOver", "customMouseOut", "customClick");
var dispatch = d3.dispatch("customValueMouseOver", "customValueMouseOut", "customValueClick", "customSeriesMouseOver", "customSeriesMouseOut", "customSeriesClick");

// Other Customisation Options
var capitalizeLabels = false;
Expand Down
Loading

0 comments on commit 94e7aa6

Please sign in to comment.