-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Array edits #1403
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
Array edits #1403
Changes from 1 commit
cc45189
13a87ce
61f250c
a9526bf
649a831
d55568c
2e6c030
f7e60fb
d7cdc0a
7ed9eb9
9f89dd6
46962af
1af058a
c6378b1
70c882b
5fb462f
d29cbae
3ef1c9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1911,6 +1911,8 @@ plots.doCalcdata = function(gd, traces) { | |
|
||
var trace, _module, i, j; | ||
|
||
var hasCategoryAxis = false; | ||
|
||
// XXX: Is this correct? Needs a closer look so that *some* traces can be recomputed without | ||
// *all* needing doCalcdata: | ||
var calcdata = new Array(fullData.length); | ||
|
@@ -1936,6 +1938,7 @@ plots.doCalcdata = function(gd, traces) { | |
// to be filled in later by ax.d2c | ||
for(i = 0; i < axList.length; i++) { | ||
axList[i]._categories = axList[i]._initialCategories.slice(); | ||
if(axList[i].type === 'category') hasCategoryAxis = true; | ||
} | ||
|
||
// If traces were specified and this trace was not included, | ||
|
@@ -2012,6 +2015,18 @@ plots.doCalcdata = function(gd, traces) { | |
|
||
calcdata[i] = cd; | ||
} | ||
|
||
// To handle the case of components using category names as coordinates, we | ||
// need to re-supply defaults for these objects now, after calc has | ||
// finished populating the category mappings | ||
// Any component that uses `Axes.coercePosition` falls into this category | ||
if(hasCategoryAxis) { | ||
var dataReferencedComponents = ['annotations', 'shapes', 'images']; | ||
for(i = 0; i < dataReferencedComponents.length; i++) { | ||
Registry.getComponentMethod(dataReferencedComponents[i], 'supplyLayoutDefaults')( | ||
gd.layout, fullLayout, fullData); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose I could list these components somehow in the registry... worth it or overkill? BTW you'll see I added category-name coordinates to image and shape test images, annotations didn't need this because 16.json already has it, and that's the failing test that prompted this fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave it like that for now. We could always add that list to the registry down the road if it comes up somewhere else. 👍 |
||
}; | ||
|
||
plots.rehover = function(gd) { | ||
|
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.
There's actually an issue for that one #1111
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.
ah thanks - comment-linked in 46962af