miunsi63 / gflot

Automatically exported from code.google.com/p/gflot
0 stars 0 forks source link

plot.redraw() throws Cannot read property 'nodeName' of undefined #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have a plot with (width and height set to 100%)
2. I set a series with some data and draw it
3. A user clicks a button and I: 
  seriesHandler.clear();
  for (int i = 1; i < data.length; i++) {
    seriesHandler.add(new DataPoint(i, data[i]));
  }
  plot.redraw()

What is the expected output? What do you see instead?
com.google.web.bindery.event.shared.UmbrellaException: Exception caught: 
(TypeError) @com.googlecode.gflot.client.jsni.Plot::setupGrid()([]): Cannot 
read property 'nodeName' of undefined
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:203)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEventFromSource(SimpleEventBus.java:96)
    at com.gwtplatform.mvp.client.PresenterWidget.fireEvent(PresenterWidget.java:252)
    at com.example.dtpet.client.app.CalculationCompletedEvent.fire(CalculationCompletedEvent.java:13)
    at com.example.dtpet.client.app.input.InputTabPresenter.onCalculate(InputTabPresenter.java:211)
    at com.example.dtpet.client.app.input.InputTabView.onCalculate(InputTabView.java:211)
    at com.example.dtpet.client.app.input.InputTabView_BinderImpl$Widgets$9.onClick(InputTabView_BinderImpl.java:99)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:56)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
    at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:722)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) 
@com.googlecode.gflot.client.jsni.Plot::setupGrid()([]): Cannot read property 
'nodeName' of undefined
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.googlecode.gflot.client.jsni.Plot$.setupGrid$(Plot.java)
    at com.googlecode.gflot.client.SimplePlot.redraw(SimplePlot.java:326)
    at com.example.dtpet.client.app.energy.EnergyTabView.setEnergyValues(EnergyTabView.java:111)
    at com.example.dtpet.client.app.energy.EnergyTabPresenter.populateTable(EnergyTabPresenter.java:80)
    at com.example.dtpet.client.app.energy.EnergyTabPresenter.onCalculationCompleted(EnergyTabPresenter.java:72)
    at com.example.dtpet.client.app.CalculationCompletedEvent.dispatch(CalculationCompletedEvent.java:27)
    at com.example.dtpet.client.app.CalculationCompletedEvent.dispatch(CalculationCompletedEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEventFromSource(SimpleEventBus.java:96)
    at com.gwtplatform.mvp.client.PresenterWidget.fireEvent(PresenterWidget.java:252)
    at com.example.dtpet.client.app.CalculationCompletedEvent.fire(CalculationCompletedEvent.java:13)
    at com.example.dtpet.client.app.input.InputTabPresenter.onCalculate(InputTabPresenter.java:211)
    at com.example.dtpet.client.app.input.InputTabView.onCalculate(InputTabView.java:211)
    at com.example.dtpet.client.app.input.InputTabView_BinderImpl$Widgets$9.onClick(InputTabView_BinderImpl.java:99)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:56)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
    at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:722)

What version of the product are you using? On what operating system?
I tried it with 3.0.1 and 2.4.3 
on chromium on ubuntu

Please provide any additional information below.
I now just create the plot from scratch whenever I need to change something, 
which seems to work

Original issue reported on code.google.com by ama...@gmail.com on 18 Feb 2013 at 3:41

GoogleCodeExporter commented 9 years ago
I can't reproduce the problem.
Are you doing anything special ? Is your plot visible when you call redraw ?

Original comment by nmr.morel on 18 Feb 2013 at 8:57

GoogleCodeExporter commented 9 years ago
no it is not visible.
Let me know if you need me to try anything or provide more detail.

Original comment by ama...@gmail.com on 18 Feb 2013 at 9:03

GoogleCodeExporter commented 9 years ago
Can you defer the redraw and wait that the plot become visible ?
Flot requires the container to be visible. It is somewhere in their FAQ.
It's odd than creating a new plot is working. it should also fail.

Original comment by nmr.morel on 18 Feb 2013 at 9:07

GoogleCodeExporter commented 9 years ago
ok thanks, I didn't see that.

Original comment by ama...@gmail.com on 18 Feb 2013 at 9:16

GoogleCodeExporter commented 9 years ago
even updating the model while the graph is not visable (on another tab) throws 
an exception:

java.lang.IncompatibleClassChangeError: Found interface 
com.googlecode.gflot.client.DataPoint, but class was expected 
happens on this line:
seriesHandler.add(DataPoint.of(1.0, 123.0));

In my case I'm quite happy to just re-create the graph so I think we can close 
this. Hopefully this bug is useful for other people in the future.

Original comment by ama...@gmail.com on 18 Feb 2013 at 10:44