Guest User

Untitled

a guest
Jul 15th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Vue.component("reactive-chart", {
  2. props: ["chart"],
  3. template: '<div :ref="chart.uuid"></div>',
  4. mounted() {
  5. Plotly.plot(this.$refs[this.chart.uuid], this.chart.traces);
  6. },
  7. watch: {
  8. chart: {
  9. handler: function() {
  10. Plotly.react(
  11. this.$refs[this.chart.uuid],
  12. this.chart.traces,
  13. this.chart.layout
  14. );
  15. },
  16. deep: true
  17. }
  18. }
  19. });
Add Comment
Please, Sign In to add comment