June 2017
Beginner to intermediate
368 pages
8h 31m
English
D3.js being a JavaScript library, we need to implement a JavaScript function to load when the page is loaded to create the chart. The function can be loaded via an AMD module (refer to Chapter 5, Creative Teaching - Developing Custom Resources and Activities, for more details). Recall that the new module needs to reside in the /amd/src folder:

This is the JavaScript code (an AMD module) to display the chart:
define(['jquery'], function($) { var t = { drawChart: function(chartEl, dataset) { var dataset = $.parseJSON(dataset); var diameter = 600; var color = d3.scaleOrdinal(d3.schemeCategory20); var bubble = ...Read now
Unlock full access