Fixes #1324 which occurs due to a collision in the datafn. - #1337
Fixes #1324 which occurs due to a collision in the datafn.#1337rpaskowitz wants to merge 1 commit into
Conversation
| counterLetter = axes.counterLetter(axid), | ||
| vals = axes.calcTicks(ax), | ||
| datafn = function(d) { return d.text + d.x + ax.mirror; }, | ||
| datafn = function(d) { return [d.text, d.x, ax.mirror].join('\u0000'); }, |
There was a problem hiding this comment.
Nice fix 🎉
I'm curious to hear why you chose \u0000 instead of say - here?
There was a problem hiding this comment.
We used \u0000 as a workaround but putting it on the end of our ticktext values, but not causing any visible change. No solid reason we couldn't use something else here.
There was a problem hiding this comment.
Ok. In this case, I would prefer changing the join argument to - if you don't mind.
There was a problem hiding this comment.
Actually, perhaps a character that's not possible in a stringified number, like '_'? It would be rather pathological, but Imagine you had
xaxis: {
type: 'linear',
title: 'Grade',
tickvals: [-1, 1],
ticktext: ['A', 'A-']
}(Nice debugging BTW @rpaskowitz !)
There was a problem hiding this comment.
|
@rpaskowitz It would be nice to add an image test for 🔒ing down this behavior. To do so, add an image test mock data/layout JSON in the |
f5ad68f to
53fa350
Compare
|
Added a mock and tested it pre/post change and confirmed it's working as intended. I don't think I'll be able to get to generating the baseline however. Any recommendation on adding that in a separate PR, sending me a baseline and my adding it to this PR, other...? |
No worries, we'll take it from here once #1337 (comment) is addressed. Thanks again for this awesome PR! |
In the example Jan 11 is at x = 0 while Jan 1 is at x = 10. Concatenating the two results in both being "Jan 110".
53fa350 to
2c549b2
Compare
|
@rpaskowitz I added the baseline image in #1347 which includes your commit. I will close this PR and merge #1347 Thanks again 🍻 |


In the example Jan 11 is at x = 0 while Jan 1 is at x = 10. Concatenating the two results in both being "Jan 110".
Join the fields with \u0000 instead of simple concatenation to prevent the collision.