Recently delving into Backbone.js for a data visualization school project, I've integrated require.js with guidance from a useful tutorial at
After reorganizing my code structure according to the tutorial, an error has cropped up that has me stumped. My project involves using Datamaps () to create a world map. Although I've included all necessary scripts in the require define() function, it seems like there's a mistake somewhere.
The problematic section of code is as follows :
define([
'jquery',
'underscore',
'backbone',
'd3',
'c3',
'topojson',
'datamaps',
'jqueryui',
'text!templates/map.html'
], function($, _, Backbone, mapTemplate){
var MapView = Backbone.View.extend({
el: $('.container'),
initialize: function(){
var _this = this;
var map = new Datamap({ ... })
...
The browser throws an error stating "Uncaught ReferenceError: Datamap is not defined". It was running smoothly previously, but ever since integrating require, the functionality seems to have broken down. It's highly likely that I missed a parameter or made some other oversight.
Your assistance with this predicament would be greatly appreciated ;)
Thank you in anticipation!