Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var VaccinePointsModel = function (vaccines, randomStartPoint, smartSpreadEnabled) {
this.randomStartPoint = randomStartPoint;
this.smartSpreadEnabled = smartSpreadEnabled;
this.vaccines = vaccines;
this.activeVaccines = [];
this.stamp = 0;
this.vaccineIndex = 0;
this.vaccinesOnPath = {};
console.time('vaccine sorting'); // eslint-disable-line
this.vaccines.sort(function (a, b) {
return a.startMomentUnix - b.startMomentUnix;
});
console.timeEnd('vaccine sorting'); // eslint-disable-line
};
var RefugeePointsModel = function(refugees, randomStartPoint, smartSpreadEnabled) {
this.randomStartPoint = randomStartPoint;
this.smartSpreadEnabled = smartSpreadEnabled;
this.refugees = refugees;
this.activeRefugees = [];
this.stamp = 0;
this.refugeeIndex = 0;
this.refugeesOnPath = {};
console.time('refugee sorting'); // eslint-disable-line
this.refugees.sort(function(a, b) {
return a.startMomentUnix - b.startMomentUnix;
});
console.timeEnd('refugee sorting'); // eslint-disable-line
};
initMapModel = () => {
console.time('init map model'); // eslint-disable-line
this.mapModel = new MapModel(this.features);
this.progress(20);
console.timeEnd('init map model'); // eslint-disable-line
window.setTimeout(this.initPointsList, 15);
}
componentDidMount: function() {
console.time('load json'); // eslint-disable-line
var promises = [];
promises.push(d3.jsonAsync(assets.data('topomap.json')).then(function(data) {
this.topomap = data;
}.bind(this)));
promises.push(d3.jsonAsync(assets.data('asylum.json')).then(function(data) {
this.asylumData = data;
}.bind(this)));
Promise.all(promises).then(function() {
console.timeEnd('load json'); // eslint-disable-line
this.dataLoaded();
}.bind(this), function(error){
throw error;
});
initPointsList = () => {
console.time('create points list'); // eslint-disable-line
this.pointList = this.createPointList(this.mapModel);
this.progress(85);
console.timeEnd('create points list'); // eslint-disable-line
window.setTimeout(this.initModels, 15);
}
componentDidMount() {
console.time('load json'); // eslint-disable-line
var promises = [];
// promises.push(d3.jsonAsync(assets.data('topomap.json')).then(function(data) {
promises.push(d3.jsonAsync(assets.data('chinamap.topo.json')).then(function (data) {
//console.log(data);
this.topomap = data;
}.bind(this)));
promises.push(d3.jsonAsync(assets.data('vaccine.data.json')).then(function (data) {
// amormaid
this.vaccine_countData = data;
}.bind(this)));
Promise.all(promises).then(function () {
console.timeEnd('load json'); // eslint-disable-line
this.dataLoaded();
}.bind(this), function (error) {
initPointsList: function() {
console.time('create points list'); // eslint-disable-line
this.pointList = this.createPointList(this.mapModel);
this.progress(85);
console.timeEnd('create points list'); // eslint-disable-line
window.setTimeout(this.initModels, 15);
},
initMapModel: function() {
console.time('init map model'); // eslint-disable-line
this.mapModel = new MapModel(this.features);
this.progress(20);
console.timeEnd('init map model'); // eslint-disable-line
window.setTimeout(this.initPointsList, 15);
},