Skip to content

Commit 1314c4d

Browse files
Correcting data update bug
1 parent 8b24a5e commit 1314c4d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/components/Plotly.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div :id="id" v-resize:debounce.100="onResize" />
2+
<div
3+
:id="id"
4+
v-resize:debounce.100="onResize"
5+
/>
36
</template>
47
<script>
58
import Plotly from "plotly.js";
@@ -56,7 +59,8 @@ export default {
5659
},
5760
deep: true
5861
},
59-
layout() {
62+
layout(layout) {
63+
this.innerLayout = { ...layout };
6064
this.schedule({ relayout: true });
6165
}
6266
},
@@ -92,7 +96,7 @@ export default {
9296
} = this;
9397
this.scheduled = null;
9498
if (replot) {
95-
this.react(relayout ? this.layout : this.innerLayout);
99+
this.react();
96100
return;
97101
}
98102
this.relayout(this.layout);
@@ -120,7 +124,7 @@ export default {
120124
};
121125
},
122126
react(layout) {
123-
Plotly.react(this.$el, this.data, layout, this.options);
127+
Plotly.react(this.$el, this.data, this.innerLayout, this.options);
124128
}
125129
}
126130
};

0 commit comments

Comments
 (0)