New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legend: fix drag movement when editable: true
#487
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice move.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
nicely done 💃 after ⚡ ing that |
7f3392f
to
ee0b452
Compare
Legends were changed to use a
<g>
, so the drag function now needs to usetranslate
for positioning.The cursor classes don't seem to work when in the middle of a click-drag, so instead we add the
move
cursor to the entire legend element wheneditable
.