update: function(){ | |
d3.select(".yaxis").call(d3.axisLeft(this.yScale())); | |
var yScale = this.yScale(); | |
var line = d3.line() | |
.x(function(d){return xScale(d);}) | |
.y(function(d){return yScale(app.varVelocity(d));}); | |
svg.select(".velocity").attr("d", line(numberList)); | |
d3.select(".marker").attr("cx", xScale(this.positionX)).attr("cy", yScale(this.varVelocity(app.positionX))); | |
var axisline = d3.line().x(function(d){return xScale(d.x);}).y(function(d){return yScale(d.y);}); | |
svg.select(".velocitylines").attr("d", axisline([ | |
{x: 0, y: this.varVelocity(this.positionX)}, | |
{x: this.positionX, y: this.varVelocity(this.positionX)}, | |
{x: this.positionX, y: 0}])); | |
},
|
You can change the scale’s properties in a function:
Function updateScale(newDomain, newRange) {
myScale.domain (newDomain);
myScale.range(newRange);
}
--
Barend Köbben
--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
.x(function(d){return xScale(d);}) | |
.y(function(d){return self.yScale(app.varVelocity(d));}); |