master
Tyler Wolf 11 years ago
parent a67a42333e
commit fb5897eb52

@ -9691,12 +9691,12 @@ nv.models.scatter = function() {
.attr('cy', function(d,i) { return y0(getY(d,i)) })
.attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI) });
points.exit().remove();
d3.transition(groups.exit().selectAll('path.nv-point'))
groups.exit().selectAll('path.nv-point').transition()
.attr('cx', function(d,i) { return x(getX(d,i)) })
.attr('cy', function(d,i) { return y(getY(d,i)) })
.remove();
points.attr('class', function(d,i) { return 'nv-point nv-point-' + i });
d3.transition(points)
points.transition()
.attr('cx', function(d,i) { return x(getX(d,i)) })
.attr('cy', function(d,i) { return y(getY(d,i)) })
.attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI) });
@ -10186,6 +10186,8 @@ nv.models.scatterChart = function() {
.color(data.map(function(d,i) {
return d.color || color(d, i);
}).filter(function(d,i) { return !data[i].disabled }))
.xDomain(null)
.yDomain(null)
wrap.select('.nv-scatterWrap')
.datum(data.filter(function(d) { return !d.disabled }))
@ -10195,14 +10197,17 @@ nv.models.scatterChart = function() {
//Adjust for x and y padding
if (xPadding) {
var xRange = x.domain()[1] - x.domain()[0];
x.domain([x.domain()[0] - (xPadding * xRange), x.domain()[1] + (xPadding * xRange)]);
scatter.xDomain([x.domain()[0] - (xPadding * xRange), x.domain()[1] + (xPadding * xRange)]);
}
if (yPadding) {
var yRange = y.domain()[1] - y.domain()[0];
y.domain([y.domain()[0] - (yPadding * yRange), y.domain()[1] + (yPadding * yRange)]);
scatter.yDomain([y.domain()[0] - (yPadding * yRange), y.domain()[1] + (yPadding * yRange)]);
}
wrap.select('.nv-scatterWrap')
.call(scatter);
//------------------------------------------------------------

4
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -296,7 +296,7 @@ nv.models.axis = function() {
//highlight zero line ... Maybe should not be an option and should just be in CSS?
if (highlightZero)
g.selectAll('.tick')
.filter(function(d) { return !parseFloat(Math.round(d*100000)/1000000) }) //this is because sometimes the 0 tick is a very small fraction, TODO: think of cleaner technique
.filter(function(d) { console.log(d); return !parseFloat(Math.round(d.__data__*100000)/1000000) }) //this is because sometimes the 0 tick is a very small fraction, TODO: think of cleaner technique
.classed('zero', true);
//store old scales for use in transitions on update

@ -367,12 +367,12 @@ nv.models.scatter = function() {
.attr('cy', function(d,i) { return y0(getY(d,i)) })
.attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI) });
points.exit().remove();
d3.transition(groups.exit().selectAll('path.nv-point'))
groups.exit().selectAll('path.nv-point').transition()
.attr('cx', function(d,i) { return x(getX(d,i)) })
.attr('cy', function(d,i) { return y(getY(d,i)) })
.remove();
points.attr('class', function(d,i) { return 'nv-point nv-point-' + i });
d3.transition(points)
points.transition()
.attr('cx', function(d,i) { return x(getX(d,i)) })
.attr('cy', function(d,i) { return y(getY(d,i)) })
.attr('r', function(d,i) { return Math.sqrt(z(getSize(d,i))/Math.PI) });

@ -224,6 +224,8 @@ nv.models.scatterChart = function() {
.color(data.map(function(d,i) {
return d.color || color(d, i);
}).filter(function(d,i) { return !data[i].disabled }))
.xDomain(null)
.yDomain(null)
wrap.select('.nv-scatterWrap')
.datum(data.filter(function(d) { return !d.disabled }))
@ -233,14 +235,17 @@ nv.models.scatterChart = function() {
//Adjust for x and y padding
if (xPadding) {
var xRange = x.domain()[1] - x.domain()[0];
x.domain([x.domain()[0] - (xPadding * xRange), x.domain()[1] + (xPadding * xRange)]);
scatter.xDomain([x.domain()[0] - (xPadding * xRange), x.domain()[1] + (xPadding * xRange)]);
}
if (yPadding) {
var yRange = y.domain()[1] - y.domain()[0];
y.domain([y.domain()[0] - (yPadding * yRange), y.domain()[1] + (yPadding * yRange)]);
scatter.yDomain([y.domain()[0] - (yPadding * yRange), y.domain()[1] + (yPadding * yRange)]);
}
wrap.select('.nv-scatterWrap')
.call(scatter);
//------------------------------------------------------------

Loading…
Cancel
Save