Skip to content

Commit f87ef6b

Browse files
committed
Revert: Update calendar-heatmap.component.js
1 parent 2578858 commit f87ef6b

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/calendar-heatmap.component.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class CalendarHeatmap extends React.Component {
255255
this.drawChart()
256256
})
257257
.style('opacity', 0)
258-
.on('mouseover', (event, d) => {
258+
.on('mouseover', d => {
259259
if (this.in_transition) { return }
260260

261261
// Construct tooltip
@@ -377,7 +377,7 @@ class CalendarHeatmap extends React.Component {
377377
return yearScale(d.year())
378378
})
379379
.attr('y', this.settings.label_padding / 2)
380-
.on('mouseenter', (event, year_label) => {
380+
.on('mouseenter', year_label => {
381381
if (this.in_transition) { return }
382382

383383
this.items.selectAll('.item-block-year')
@@ -397,7 +397,7 @@ class CalendarHeatmap extends React.Component {
397397
.ease(d3.easeLinear)
398398
.style('opacity', 1)
399399
})
400-
.on('click', (event, d) => {
400+
.on('click', d => {
401401
if (this.in_transition) { return }
402402

403403
// Set in_transition flag
@@ -491,7 +491,7 @@ class CalendarHeatmap extends React.Component {
491491
.attr('fill', d => {
492492
return (d.total > 0) ? color(d.total) : 'transparent'
493493
})
494-
.on('click', (event, d) => {
494+
.on('click', d => {
495495
if (this.in_transition) { return }
496496

497497
// Don't transition if there is no data to show
@@ -512,11 +512,11 @@ class CalendarHeatmap extends React.Component {
512512
this.overview = 'day'
513513
this.drawChart()
514514
})
515-
.on('mouseover', (event, d) => {
515+
.on('mouseover', d => {
516516
if (this.in_transition) { return }
517517

518518
// Pulsating animation
519-
let circle = d3.select(event.currentTarget)
519+
let circle = d3.select(d3.event.currentTarget)
520520
let repeat = () => {
521521
circle = circle.transition()
522522
.duration(this.settings.transition_duration)
@@ -577,11 +577,11 @@ class CalendarHeatmap extends React.Component {
577577
.ease(d3.easeLinear)
578578
.style('opacity', 1)
579579
})
580-
.on('mouseout', (event, d) => {
580+
.on('mouseout', () => {
581581
if (this.in_transition) { return }
582582

583583
// Set circle radius back to what its supposed to be
584-
d3.select(event.currentTarget).transition()
584+
d3.select(d3.event.currentTarget).transition()
585585
.duration(this.settings.transition_duration / 2)
586586
.ease(d3.easeLinear)
587587
.attr('x', d => {
@@ -648,7 +648,7 @@ class CalendarHeatmap extends React.Component {
648648
return monthScale(i) + (monthScale(i) - monthScale(i - 1)) / 2
649649
})
650650
.attr('y', this.settings.label_padding / 2)
651-
.on('mouseenter', (event, d) => {
651+
.on('mouseenter', d => {
652652
if (this.in_transition) { return }
653653

654654
let selected_month = moment(d)
@@ -669,7 +669,7 @@ class CalendarHeatmap extends React.Component {
669669
.ease(d3.easeLinear)
670670
.style('opacity', 1)
671671
})
672-
.on('click', (event, d) => {
672+
.on('click', d => {
673673
if (this.in_transition) { return }
674674

675675
// Check month data
@@ -722,7 +722,7 @@ class CalendarHeatmap extends React.Component {
722722
.text(d => {
723723
return moment(d).format('dddd')[0]
724724
})
725-
.on('mouseenter', (event, d) => {
725+
.on('mouseenter', d => {
726726
if (this.in_transition) { return }
727727

728728
let selected_day = moment(d)
@@ -816,7 +816,7 @@ class CalendarHeatmap extends React.Component {
816816
return d.date
817817
})
818818
.attr('offset', 0)
819-
.on('click', (event, d) => {
819+
.on('click', d => {
820820
if (this.in_transition) { return }
821821

822822
// Don't transition if there is no data to show
@@ -871,11 +871,11 @@ class CalendarHeatmap extends React.Component {
871871
return color(d.value) || '#ff4500'
872872
})
873873
.style('opacity', 0)
874-
.on('mouseover', (event, d) => {
874+
.on('mouseover', d => {
875875
if (this.in_transition) { return }
876876

877877
// Get date from the parent node
878-
let parentNode = d3.select(event.currentTarget.parentNode)
878+
let parentNode = d3.select(d3.event.currentTarget.parentNode)
879879
let date = new Date(parentNode.attr('date'))
880880

881881
// Construct tooltip
@@ -948,7 +948,7 @@ class CalendarHeatmap extends React.Component {
948948
return weekScale(d.week())
949949
})
950950
.attr('y', this.settings.label_padding / 2)
951-
.on('mouseenter', (event, weekday) => {
951+
.on('mouseenter', weekday => {
952952
if (this.in_transition) { return }
953953

954954
this.items.selectAll('.item-block-month')
@@ -968,7 +968,7 @@ class CalendarHeatmap extends React.Component {
968968
.ease(d3.easeLinear)
969969
.style('opacity', 1)
970970
})
971-
.on('click', (event, d) => {
971+
.on('click', d => {
972972
if (this.in_transition) { return }
973973

974974
// Check week data
@@ -1015,7 +1015,7 @@ class CalendarHeatmap extends React.Component {
10151015
.text(d => {
10161016
return moment(d).format('dddd')[0]
10171017
})
1018-
.on('mouseenter', (event, d) => {
1018+
.on('mouseenter', d => {
10191019
if (this.in_transition) { return }
10201020

10211021
let selected_day = moment(d)
@@ -1106,7 +1106,7 @@ class CalendarHeatmap extends React.Component {
11061106
return d.date
11071107
})
11081108
.attr('offset', 0)
1109-
.on('click', (event, d) => {
1109+
.on('click', d => {
11101110
if (this.in_transition) { return }
11111111

11121112
// Don't transition if there is no data to show
@@ -1161,11 +1161,11 @@ class CalendarHeatmap extends React.Component {
11611161
return color(d.value) || '#ff4500'
11621162
})
11631163
.style('opacity', 0)
1164-
.on('mouseover', (event, d) => {
1164+
.on('mouseover', d => {
11651165
if (this.in_transition) { return }
11661166

11671167
// Get date from the parent node
1168-
let parentNode = d3.select(event.currentTarget.parentNode)
1168+
let parentNode = d3.select(d3.event.currentTarget.parentNode)
11691169
let date = new Date(parentNode.attr('date'))
11701170

11711171
// Construct tooltip
@@ -1177,7 +1177,7 @@ class CalendarHeatmap extends React.Component {
11771177
// Calculate tooltip position
11781178
let total = parseInt(parentNode.attr('total'))
11791179
itemScale.domain([0, total])
1180-
let x = parseInt(d3.select(event.currentTarget).attr('x')) + itemScale(d.value) / 4 + this.settings.tooltip_width / 4
1180+
let x = parseInt(d3.select(d3.event.currentTarget).attr('x')) + itemScale(d.value) / 4 + this.settings.tooltip_width / 4
11811181
while (this.settings.width - x < (this.settings.tooltip_width + this.settings.tooltip_padding * 3)) {
11821182
x -= 10
11831183
}
@@ -1240,7 +1240,7 @@ class CalendarHeatmap extends React.Component {
12401240
return weekScale(d.week())
12411241
})
12421242
.attr('y', this.settings.label_padding / 2)
1243-
.on('mouseenter', (event, weekday) => {
1243+
.on('mouseenter', weekday => {
12441244
if (this.in_transition) { return }
12451245

12461246
this.items.selectAll('.item-block-week')
@@ -1281,7 +1281,7 @@ class CalendarHeatmap extends React.Component {
12811281
.text(d => {
12821282
return moment(d).format('dddd')[0]
12831283
})
1284-
.on('mouseenter', (event, d) => {
1284+
.on('mouseenter', d => {
12851285
if (this.in_transition) { return }
12861286

12871287
let selected_day = moment(d)
@@ -1356,7 +1356,7 @@ class CalendarHeatmap extends React.Component {
13561356
return this.props.color
13571357
})
13581358
.style('opacity', 0)
1359-
.on('mouseover', (event, d) => {
1359+
.on('mouseover', d => {
13601360
if (this.in_transition) { return }
13611361

13621362
// Construct tooltip
@@ -1385,7 +1385,7 @@ class CalendarHeatmap extends React.Component {
13851385
if (this.in_transition) { return }
13861386
this.hideTooltip()
13871387
})
1388-
.on('click', (event, d) => {
1388+
.on('click', d => {
13891389
if (!!this.props.handler && typeof this.props.handler == 'function') {
13901390
this.props.handler(d)
13911391
}
@@ -1441,7 +1441,7 @@ class CalendarHeatmap extends React.Component {
14411441
return timeScale(i)
14421442
})
14431443
.attr('y', this.settings.label_padding / 2)
1444-
.on('mouseenter', (event, d) => {
1444+
.on('mouseenter', d => {
14451445
if (this.in_transition) { return }
14461446

14471447
let selected = itemScale(moment(d))
@@ -1497,7 +1497,7 @@ class CalendarHeatmap extends React.Component {
14971497
text_length = obj.node().getComputedTextLength()
14981498
}
14991499
})
1500-
.on('mouseenter', (event, project) => {
1500+
.on('mouseenter', project => {
15011501
if (this.in_transition) { return }
15021502

15031503
this.items.selectAll('.item-block')

0 commit comments

Comments
 (0)