-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymer Array changes doesn't reflect in the chart #181
Comments
Yeah... That's the currently working-as-intended behavior but I'm open to suggestions on how you would like to see it changed. One issue with slice listening is that it may cause unnecessary churn. chart.rows = [];
chart.push('rows', myNewRow); // Does nothing.
chart.rows = [myNewRow]; // Updates the chart data. Doing this will update the view for you. I have a changelist #164 to break out the data handling portion of the element which will allow us to create a better API into the data handling as well as making it more modular. |
It's worth noting, that force skipping dirty checking should work, too. |
Thanks for the explanation.
This makes sense. #164 is nice thing to have in google-chart. I was looking for this kind of data handling functionality when was going through the docs. Any update on when it'll be released? |
In short, whenever it gets reviewed. But really, I think it makes sense to leave v1 as it is (all-inclusive-y) and save big changes like #164 for v2. I have started documenting my plans for v2 of the element here. If you want to take a look and let me know what you think, that'd be cool. I plan to continue development and testing, soon. It's essentially a revamp of #91, #100, and #164. |
Hey, I got the initial stuff (with the intended feature parity) working here. See if it works like you would think when using the You should now be able to do: data.push('rows', myNewRow); And it will be reflected in the chart. |
I have been in troubles with the property binding as well. I actually did not succeed to get it to work, unless i bind to the The only way I got it to work was with the dirty check. Another was to change the observers: [
'_draw(_chart, _dataView)',
'_subOptionChanged(options.*)',
'_rowsOrColumnsChanged(rows.*)' // new registration of the observer
], Doing so I got all my mutations reflected in the chart. I don't know how it would behave with big amount of data, but from my perspective, it is sounds better to use the google-chart using the standard data-flow instead of forcing a dirty check. |
@vtellier The problem with watching slice changes is gonna be that not every slice change should trigger a redraw. I don't understand why you would ever need to bind to the attribute unless you're getting the property to trigger because it's re-deserializing your JSON every time at that point. You might be able to get by with a slice on the original array. But I'm not sure what your setup looks like without a demo on which to comment. There are definitely cases which are less than ideal for the dirty checking but I do think, in general, they are better than slice watching. Especially when charts grow large or there are multiple charts on a page. |
If we bind ploymer array property to the
google-chart
element, Initially it loads whatever data polymer array holds but subsequent changes to that array property doesn't reflect in the chart.steps to reproduce:
rows
property.P.S : Tried calling
redraw()
, it didn't helpThe text was updated successfully, but these errors were encountered: