Published
Edited
Nov 19, 2018
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function setScale1(){
xScale.domain([0, 1000]).range([0, width-(margin.left+margin.right)])
yScale.domain([0, 1000]).range([height-(margin.top+margin.bottom), 0])
xAxisCall.scale(xScale)
yAxisCall.scale(yScale)
}
Insert cell
Insert cell
function updateAxis(){
var t = d3.transition()
.duration(500)

d3.select(".x")
.transition(t)
.call(xAxisCall)

d3.select(".y")
.transition(t)
.call(yAxisCall)
}
Insert cell
{
var vis = d3.select(example1)
setScale1()
initAxis()

function initAxis() {
vis.append("g")
.attr("class", "x axis")
.attr("transform", "translate("+[margin.left, height-margin.top]+")")
.call(xAxisCall)

vis.append("g")
.attr("class", "y axis")
.attr("transform", "translate("+[margin.left, margin.top]+")")
.call(yAxisCall)
}

return md`Initialization code.`
}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more