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

Fixed issue #814 - [$100] Topcoder Member Profile: Redesign ratings graph #815

Merged
merged 18 commits into from
May 25, 2016

Conversation

smtryingcode
Copy link
Contributor

No description provided.

@vikasrohit
Copy link
Contributor

@smtryingcode Can you please fix the lint errors suggested in travis-ci checks above?

@smtryingcode
Copy link
Contributor Author

smtryingcode commented May 21, 2016

@vikasrohit Ohhh, sorry. Fixing this.

@smtryingcode
Copy link
Contributor Author

Also, there is a bug with eslint-plugin-react which is giving linting error and that import react line is mandatory. Trying to fix that.

babel/babel-eslint#6

@smtryingcode
Copy link
Contributor Author

@vikasrohit errors are fixed, and merge request is updated

@vikasrohit
Copy link
Contributor

Thanks @smtryingcode

@smtryingcode
Copy link
Contributor Author

@vikasrohit your feedback is implemented, and merge request is updated

@vikasrohit
Copy link
Contributor

Thanks @smtryingcode. Still on of the main requirements is not fulfilled which is to make the tooltip be clickable.

@vikasrohit
Copy link
Contributor

@smtryingcode Reviewed your submission. There are few missing things, however, overall it looks good. Please resubmit as soon as you are done with those changes.

@smtryingcode
Copy link
Contributor Author

@vikasrohit Fixed issues and updated merge request.

@vikasrohit
Copy link
Contributor

Thanks @smtryingcode

@vikasrohit
Copy link
Contributor

@smtryingcode It is opening multiple tabs when clicking on the tooltip. Steps to reproduce:

  1. Click on tooltip for one data point, it opens the single challenge tab
  2. Now click on tooltip for another data point, now it opens two challenge tabs
  3. It continues to increase the number of tabs in proportion to the number of time the data points are clicked.

@vikasrohit
Copy link
Contributor

And it seems to take two clicks to show the tooltip.

@smtryingcode
Copy link
Contributor Author

@vikasrohit Fixed both the issues and updated merge request.

@@ -36,3 +36,5 @@ html
.fold-pusher

div(ui-view="footer")

#chart-tooltip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think chart tooltip element does not makes sense in all pages, can we move it to profile page's jade file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we can't do that as we need it the end of body, to position it relatively to body. Otherwise, it will not display at correct position.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, we would revisit this after this challenge.



d3.select('body').on('click', function(){
if((d3.event.target.classList[0] != 'tooltip-target') && !$('#chart-tooltip .tooltip-container').hasClass('tooltip-hide') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this logic can be simplified to a great extent by using traversing the event.target's parents. What I understood from this code is that you are trying to detected if the mouse is NOT clicked on the tooltip itself, for that, we can iterate the event.target's parents and check if we find the root class of the tooltip i.e. .tooltip-container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikasrohit I think there is no parent info for event.target in d3.js, I already tried many options. And we have to use d3.event.target to handle clicks inside the chart. Only, thing is we can optimize condition to shorten it, which I am doing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Try your best to optimize the condition so that it is more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, most of the conditions have different meaning other than the classes inside tooltip, so those can't be optimized more. It is because we have to handle clicks inside d3js svg also. I have done best possible as per my understanding.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Lets proceed without this optimization thing. Will take care of this after this challenge.

@vikasrohit
Copy link
Contributor

@smtryingcode Please try to put some inline comments on the non trivial code portions.

@smtryingcode
Copy link
Contributor Author

@vikasrohit fixed all, updated merge request

@vikasrohit
Copy link
Contributor

Awesome stuff @smtryingcode. Thanks.

@smtryingcode
Copy link
Contributor Author

@vikasrohit Thank you. I was a great learning for me also.

@vikasrohit vikasrohit merged commit a8d5005 into topcoder-archive:dev May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants