Allow transform to have supply layout defaults handler#1122
Conversation
- and pass it to supplyLayoutModuleDefaults
- which is now assumed to be in fullLayout
| _module = transformModules[i]; | ||
|
|
||
| if(_module.supplyLayoutDefaults) { | ||
| _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData, transitionData); |
There was a problem hiding this comment.
@rreusser I chose to only pass transitionData to transform module supplyLayoutDefaults, because that's the only place where we need them at the moment.
|
Looks good to me. Only exception is in plot_api/register.js. Can we add |
By check, you mean something like: if(typeof newModule.supplyLayoutDefaults !== 'function') {
throw new Error('supplyLayoutDefaults method is not a function');
}? Otherwise, |
|
I was referring to the fact that a transform that only has supplyLayoutDefaults (as this one does) fails unless it has a dummy no-op for either |
I would prefer keeping this as such. Transform modules should transform the data using |
|
Agreed, though the current use-case is an exception to that rule. I give it the 💃 though. |
|
🎉 thanks! |

a requirement for #1099
cc @rreusser