Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit b3a17f8

Browse files
authored
Merge pull request #889 from appirio-tech/tom-graph-fixes
Topcoder 30055407.
2 parents 71856fb + c29edf9 commit b3a17f8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

app/directives/history-graph/history-graph.directive.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip.js
245245
return y
246246
}
247247
}
248-
248+
249249
/* render react tooltip component */
250250
ReactDOM.unmountComponentAtNode(document.getElementById('chart-tooltip'))
251-
ReactDOM.render(<Tooltip popMethod='click'>
251+
ReactDOM.render(<Tooltip popMethod='hover'>
252252
<div className='tooltip-target'></div>
253253
<div className='tooltip-body'>
254254
<div className='tooltip-rating'></div>
@@ -259,7 +259,7 @@ import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip.js
259259
</div>
260260
</Tooltip>
261261
, document.getElementById('chart-tooltip'))
262-
262+
263263
svg.selectAll('circle')
264264
.data(history)
265265
.enter()
@@ -270,6 +270,7 @@ import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip.js
270270
.attr('cy', function(d) {
271271
return y(d.newRating)
272272
})
273+
.attr('r', 5.5)
273274
.attr('fill', function(d) {
274275
return ratingToColor($scope.colors, d.newRating)
275276
})
@@ -283,18 +284,18 @@ import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip.js
283284
else
284285
location.href = $filter('challengeLinks')({id: d.challengeId, 'track': $state.params.track, 'subTrack': $state.params.subTrack}, 'detail')
285286
})
286-
287+
287288
/* update tooltip location on mouseover, feature currently not inbuilt in react tooltip component */
288289
d3.select('#chart-tooltip')
289-
.style('left', (d3.event.pageX-5) + 'px')
290+
.style('left', (d3.event.pageX-5) + 'px')
290291
.style('top', (d3.event.pageY-5) + 'px')
291292
d3.select('#chart-tooltip .tooltip-container')
292-
.style('left', '20px !important')
293+
.style('left', '20px !important')
293294
.style('top', '-20px !important')
294295
d3.select('#chart-tooltip .tooltip-container .tooltip-pointer')
295-
.style('left', '-5.5px !important')
296+
.style('left', '-5.5px !important')
296297
.style('bottom', '25px !important')
297-
298+
298299
d3.select('#chart-tooltip .challenge-name').text($scope.historyChallenge)
299300
d3.select('#chart-tooltip .challenge-date').text(moment(d.ratingDate).format('MMM DD, YYYY'))
300301
d3.select('#chart-tooltip .tooltip-rating').text($scope.historyRating)
@@ -307,7 +308,7 @@ import Tooltip from 'appirio-tech-react-components/components/Tooltip/Tooltip.js
307308
$scope.$digest()
308309
})
309310

310-
/* hide tooltip when clicked anywhere outside */
311+
/* hide tooltip when clicked anywhere outside */
311312
d3.select('body').on('click', function(){
312313
if((d3.event.target.classList[0] != 'tooltip-target') && !$('#chart-tooltip .tooltip-container').hasClass('tooltip-hide') &&
313314
(d3.event.target.tagName.toLowerCase()!='circle') && !(d3.event.target.tagName.toLowerCase()=='rect' && d3.event.target.classList[0] == 'hover')) {

assets/css/directives/history-graph.scss

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
}
9292

9393
circle {
94-
r: 5.5px;
9594
stroke: $white;
9695
stroke-width: 1.5px;
9796
}

0 commit comments

Comments
 (0)