8000 plots: expose list of data / layout array containers · uwevil/plotly.js@133bf1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 133bf1a

Browse files
committed
plots: expose list of data / layout array containers
- to be used in relayout / restyle
1 parent ec0b0a4 commit 133bf1a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/plots/plots.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,9 @@ plots.extendObjectWithContainers = function(dest, src, containerPaths) {
14241424
return dest;
14251425
};
14261426

1427+
plots.dataArrayContainers = ['transforms'];
1428+
plots.layoutArrayContainers = ['annotations', 'shapes', 'images', 'sliders', 'updatemenus'];
1429+
14271430
/*
14281431
* Extend a trace definition. This method:
14291432
*
@@ -1433,7 +1436,7 @@ plots.extendObjectWithContainers = function(dest, src, containerPaths) {
14331436
* The result is the original object reference with the new contents merged in.
14341437
*/
14351438
plots.extendTrace = function(destTrace, srcTrace) {
1436-
return plots.extendObjectWithContainers(destTrace, srcTrace, ['transforms']);
1439+
return plots.extendObjectWithContainers(destTrace, srcTrace, plots.dataArrayContainers);
14371440
};
14381441

14391442
/*
@@ -1446,13 +1449,7 @@ plots.extendTrace = function(destTrace, srcTrace) {
14461449
* The result is the original object reference with the new contents merged in.
14471450
*/
14481451< 78B3 code class="diff-text syntax-highlighted-line">
plots.extendLayout = function(destLayout, srcLayout) {
1449-
return plots.extendObjectWithContainers(destLayout, srcLayout, [
1450-
'annotations',
1451-
'shapes',
1452-
'images',
1453-
'sliders',
1454-
'updatemenus'
1455-
]);
1452+
return plots.extendObjectWithContainers(destLayout, srcLayout, plots.layoutArrayContainers);
14561453
};
14571454

14581455
/**

0 commit comments

Comments
 (0)
0