Skip to content

Commit e06f237

Browse files
author
Manuel Hartmann
committed
add some log messages
1 parent be799d9 commit e06f237

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/js/mucmap.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
179179

180180
// When clicked, zoom in
181181
function clicked(d) {
182+
console.log({ type: 'clicked', d: d, context: this });
183+
182184
var x, y, k;
183185

184186
// Compute centroid of the selected path
@@ -218,6 +220,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
218220
// });
219221

220222
function mouseover(d) {
223+
console.log({ type: 'mouseover', d: d, context: this });
224+
221225
d3.select(this).style('cursor', 'pointer');
222226

223227
// Highlight hovered province
@@ -228,6 +232,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
228232
}
229233

230234
function mouseout(d) {
235+
console.log({ type: 'mouseout', d: d, context: this });
236+
231237
d3.select(this).style('cursor', 'default');
232238

233239
// Reset province color
@@ -249,6 +255,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
249255
}
250256

251257
function mousemove(d) {
258+
// console.log({ type: 'mousemove', d: d, context: this });
259+
252260
var district = getDistrict(d);
253261

254262
div.style('left', d3.event.pageX + 10 + 'px');

website/js/mucmap.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
179179

180180
// When clicked, zoom in
181181
function clicked(d) {
182+
console.log({ type: 'clicked', d: d, context: this });
183+
182184
var x, y, k;
183185

184186
// Compute centroid of the selected path
@@ -218,6 +220,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
218220
// });
219221

220222
function mouseover(d) {
223+
console.log({ type: 'mouseover', d: d, context: this });
224+
221225
d3.select(this).style('cursor', 'pointer');
222226

223227
// Highlight hovered province
@@ -228,6 +232,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
228232
}
229233

230234
function mouseout(d) {
235+
console.log({ type: 'mouseout', d: d, context: this });
236+
231237
d3.select(this).style('cursor', 'default');
232238

233239
// Reset province color
@@ -249,6 +255,8 @@ var Mucmap = (function(App, d3, window, document, undefined) {
249255
}
250256

251257
function mousemove(d) {
258+
// console.log({ type: 'mousemove', d: d, context: this });
259+
252260
var district = getDistrict(d);
253261

254262
div.style('left', d3.event.pageX + 10 + 'px');

0 commit comments

Comments
 (0)