google-chart icon indicating copy to clipboard operation
google-chart copied to clipboard

Allow access to TreeMap's other methods (e.g. `goUpAndDraw`)

Open NamTThai opened this issue 9 years ago • 4 comments

https://jsfiddle.net/8vhn8fry/ I'm not sure if this is a bug or I'm just using it wrong. Try click on a category, and then right click on the map to go back to All Categories. Now click the redraw button. Instead of staying in "All Categories" view, the redrawn treemap will be at the sub-category that you just clicked on.

On a sidenote, treemap API has a lot of additional methods: https://developers.google.com/chart/interactive/docs/gallery/treemap#methods

How do I access these methods in google-chart Polymer wrapper?

NamTThai avatar Nov 15 '16 23:11 NamTThai

Yes, there is currently a bug in the TreeMap selection for which I have a change open (but it has comments to address... sigh). I think you are seeing the same bug... It's a bummer. The work-around is to reset selection on redraw. As for the extra methods, they are not currently exposed. I was thinking about having the google-chart element listen for a chart-action event that it would then pass along internally. What do you think?

wesalvaro avatar Nov 17 '16 09:11 wesalvaro

Yeah if that works. I think another way would be having a tree-map element, and line-chart element, etc. They can all share a google-chart-behavior

NamTThai avatar Nov 17 '16 16:11 NamTThai

Yeah, I think that's definitely an alternative. I think the event model is probably fine for this particular use-case, though, because it's methods are not called through document bindings.

wesalvaro avatar Nov 18 '16 02:11 wesalvaro

So, apologies, I just got around to looking at the steps in your bug. This is not due to the selection bug that I thought it was. Haha. However, I will add your issue to my selection fix, too. I'm not sure when it will land in the public release, though.

wesalvaro avatar Nov 19 '16 03:11 wesalvaro