Legend: fix drag movement when editable: true#487
Merged
Conversation
430986b to
ab751c2
Compare
| // regex pattern for 'translate(123.45px, 543.21px)' | ||
| var re = /(.*\()(\d*\.?\d*)([^\d]*)(\d*\.?\d*)([^\d]*)/, | ||
| transform = legend.attr('transform') | ||
| .replace(re, function(match, p1, p2, p3, p4) { |
The legend container is now a `<g>` and position must be set using `translate` instead of `x` and `y` coordinates. The cursor is set to always be `move`.
ab751c2 to
7269c33
Compare
| y0, | ||
| lw, | ||
| lh; | ||
| var xf, yf, x0, y0; |
Contributor
There was a problem hiding this comment.
@mdtusz if you feel adventurous, maybe you add our first editable: true jasmine test ...
0c3fc59 to
7f3392f
Compare
| afterEach(destroyGraphDiv); | ||
|
|
||
| function checkIfEditable(elClass, text) { | ||
| console.log('checking editable', elClass); |
Contributor
|
nicely done 💃 after ⚡ ing that |
7f3392f to
ee0b452
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Legends were changed to use a
<g>, so the drag function now needs to usetranslatefor positioning.The cursor classes don't seem to work when in the middle of a click-drag, so instead we add the
movecursor to the entire legend element wheneditable.