Skip to content

Commit a8a5624

Browse files
committed
Prevent mutations in gd.data and gd._fullData
1 parent acd90b7 commit a8a5624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/connectTraceToPlot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ export default function connectTraceToPlot(WrappedComponent) {
8181
const multiValuedFullContainer = deepCopyPublic(fullTrace);
8282
fullData.forEach(t =>
8383
Object.keys(t).forEach(key =>
84-
setMultiValuedContainer(multiValuedFullContainer, t, key, {
84+
setMultiValuedContainer(multiValuedFullContainer, deepCopyPublic(t), key, {
8585
searchArrays: true,
8686
})
8787
)
8888
);
8989
const multiValuedContainer = deepCopyPublic(trace);
9090
data.forEach(t =>
9191
Object.keys(t).forEach(key =>
92-
setMultiValuedContainer(multiValuedContainer, t, key, {
92+
setMultiValuedContainer(multiValuedContainer, deepCopyPublic(t), key, {
9393
searchArrays: true,
9494
})
9595
)

0 commit comments

Comments
 (0)