May 2019
Beginner to intermediate
650 pages
14h 50m
English
Now we need to update the data every time the view changes. Let's start by making some improvements in the graphical interface, such as disabling a button when its ID is equal to current.id and enabling all buttons that have a different ID. These commands need to be placed in one of the functions called when the button is clicked. It can be anywhere in configureView(), as in the example:
function configureView() { // ... // 3) Disable button for currently displayed planet d3.selectAll("button").property("disabled", false); d3.select("button#"+current.id).property("disabled", true);}
When changing views, you will notice that new planets are being drawn over the previous ones. If you inspect the circle in your browser's development ...
Read now
Unlock full access