You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 1, 2025. It is now read-only.
hide tooltips associated with visualization when removing the visualization #18
Hi, I'm using treemap in this package. It works well but after I hide the treemap, the tooltip doesn't hide. The .d3plus-tooltip is still there in the DOM.
changed the title [-]d3plus-tooltip doesn't hide when d3plus hide[/-][+]hide tooltips associated with visualization when removing the visualization[/+]on Feb 13, 2018
Thanks for sharing @NoobTW. In the meantime, before the fix is implemented, you might be able to hack it (I haven't tested this though). At the top of the render function, save the handleClick function to a variable:
consthandleClick=this.handleClick.bind(this);
And then try this for your click function:
on:
click: function(d){this._tooltipClass.data([]).render();handleClick(d);}}
Thanks for the hack, but I'm unable to access this in click function.
on: {click: function(d){// this._tooltipClass.data([]).render();console.log(this)// This is undefined.handleClick(d);// Still works because I saved it to a variable.}}
Activity
davelandry commentedon Feb 13, 2018
@NoobTW can you share the code you have written to hide the Treemap?
[-]d3plus-tooltip doesn't hide when d3plus hide[/-][+]hide tooltips associated with visualization when removing the visualization[/+]NoobTW commentedon Feb 13, 2018
Not sure if I did this right, but here's the code: https://github.com/NoobTW/od-freq/blob/master/src/App.js#L110
davelandry commentedon Feb 15, 2018
Thanks for sharing @NoobTW. In the meantime, before the fix is implemented, you might be able to hack it (I haven't tested this though). At the top of the render function, save the
handleClickfunction to a variable:And then try this for your click function:
This is all based on the default internal click function, which has access to the tooltip through it's context: https://github.com/d3plus/d3plus-viz/blob/master/src/on/click.js
NoobTW commentedon Feb 19, 2018
Thanks for the hack, but I'm unable to access
thisinclickfunction.