Giter Site home page Giter Site logo

Comments (4)

hari-rangarajan avatar hari-rangarajan commented on May 12, 2024

On second thoughts, is there a way to use 'shouldComponentUpdate' to prevent unnecessary updates?

from react-google-charts.

rakannimer avatar rakannimer commented on May 12, 2024

Hey @hari-rangarajan,

Re-creating a new visualization object on each re-draw would make the library feel sluggish, and all animations when changing the data will be lost, so I'm not sure it would be the best idea.

Can you provide me with some code that I can run to help debug this issue ?

Cheers !

from react-google-charts.

hari-rangarajan avatar hari-rangarajan commented on May 12, 2024

I don't how to package a runnable version but here is the idea to trigger the bug. Set new data when processing any event. The old tool tips get stuck. This is what the stack overflow link I posted earlier talks about.

componentDidMount: function() {
var chart_events = [
{
eventName : 'onmouseover',
callback : function(Chart) {
// Returns Chart so you can access props and the ChartWrapper object from chart.wrapper
console.log("mouseover the chart");
>>>>>> this.setState(columns: newColumnData); <<<<<<
}
}
];

},
render: function() {
<Chart chartType = "ScatterChart" rows = {this.state.rows} columns = {this.state.columns} options = {this.state.options} graph_id = "ScatterChart" width={"100%"} height={"400px"} chartEvents = {chart_events} />

}

from react-google-charts.

hari-rangarajan avatar hari-rangarajan commented on May 12, 2024

Another way to do it would be to create a component containing any html element and the google chart. When handling any event on the google chart, update the html element with a setState. This will force a redraw on the entire component and produce the problem.

from react-google-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.