question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plots not updating on data changes

See original GitHub issue

Hi there! I think the calls to Plotly.react may be broken? (or I could be changing them incorrectly … I just started Vue.js)

Try this in your App.vue to recreate it

<template>
  <div id="app">
    <plotly :data="plot_data" :layout="layout"></plotly>
    <dat-gui closeText="Close controls" openText="Open controls" closePosition="bottom">
      <dat-string v-model="layout.title" label="Title" />
      <dat-number v-model="plot_data[0].y[0]" :min="-100" :max="100" :step="1" label="Offset y[0]"/>
    </dat-gui>
    <h3>{{layout}}</h3>
<h3>Y values are currently: {{this.plot_data[0].y}}</h3>

  </div>
</template>

<script>
// the javascript below goes here
</script>
import {Plotly}from "vue-plotly";
import Vue from "vue";
import DatGui from "@cyrilf/vue-dat-gui";
Vue.use(DatGui);

export default {
  name: "app",
  components: { Plotly },
  data() {
    return {
      layout: {
        title: 'Plot update test'
      },
      plot_data: [{
        x: [1,2,3,4],
        y: [10, 15, 13, 17],
        type: "scatter"
      }]
    };
  },
};

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:27 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tehsurfercommented, Jan 14, 2020

Have a look at this demo for what I used to make statnett’s version reactive

The code of interest is here (albeit a bit messy 😨): https://github.com/Tehsurfer/vue-plotsvy/blob/netlify-hosting/src/App.vue

1reaction
ped59430commented, Jan 14, 2020

Ok for statnett! I must have found a special case. I found another one with this wrapper too anyway (I ve posted my “special” case in this issue #11) I actually use this wrapper and build my own component around it to fetch the data. So now you handle the call to plot or replot on your own, and you have a complete control on options, resposiveness? Might be a good idea for me too…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Charts not updating when data is updated
Charts not updating when data is updated. Hello,. I have built an Excel dashboard template that has 46 charts referencing cells in a...
Read more >
Excel Chart Not Updating with New Data (2 Suitable Solutions)
2 Solutions If Excel Chart Is Not Updating with New Data. First, look at the following data and the corresponding chart. It's a...
Read more >
Plot not updating even after changing plot data - MathWorks
I am plotting lines on a surface plot in a GUI and trying to update the lines by changing XData,YData and ZData, but...
Read more >
Shiny plot not updating when inputs are changed
I am running into an issue where my plot is not updating when any of my inputs are changed. I think the issue...
Read more >
Graphs not updating when data changes - Mr. Excel
I have a workbook that looksup values and does reports and has some graphs in it. The graphs used to automatically update when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found