Skip to content

Conversation

@Indigo744
Copy link
Collaborator

This PR implements some various internal improvements.

The main enhancement concerns the option: each element option is stored in the element object, alongside mapElem and textElem. This allows to simplify quite a bit of various other stuff related to the options, like HTML links options, tooltip options, event handlers...

Also, the getBBoxCenter is removed (fix #340).

@Indigo744 Indigo744 requested a review from neveldo October 30, 2017 22:04
@Indigo744 Indigo744 mentioned this pull request Oct 31, 2017
8 tasks
Copy link
Owner

@neveldo neveldo left a comment

Choose a reason for hiding this comment

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

Wow, what a new huge piece of work, thanks @Indigo744 ! All seems to be good to me (just a little question on a specific point).

I think I will have to take the time to dive deeply into the whole code in order to get all the parts in my mind since your last major (and great !) refactorings :)

if (elem.options.text) elem.options.text.attrs.cursor = "pointer";
} else {
// No HTML links, check if a cursor was defined to pointer
if (elem.mapElem.attrs.cursor === 'pointer') {
Copy link
Owner

Choose a reason for hiding this comment

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

Why did you add this check before setting the cursor style to 'auto' ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In case the user did set the cursor to something other than pointer (like help...)...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In order to avoid overriding the user attribute.

Copy link
Owner

Choose a reason for hiding this comment

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

Ok thanks, I got it ! It will not work for the users who willingly set cursor to 'pointer', but it should be a very unusual case, and its still better than before :)

@neveldo
Copy link
Owner

neveldo commented Nov 1, 2017

Storing the area / plot options within the objects next to mapElem and textElem is a great idea that allowed you to introduce a lot of simplifications , the elements configuration parts are a lot more clear now. I'm also glad to see the code factorization within the two new functions that you have introduced (setPlotAttributes and setPlotCoords).

@Indigo744 Indigo744 merged commit 6bbc79b into neveldo:master Nov 1, 2017
@Indigo744 Indigo744 deleted the improvements branch November 1, 2017 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raphael getBBox

2 participants