Open NoobTW opened 6 years ago
@NoobTW can you share the code you have written to hide the Treemap?
Not sure if I did this right, but here's the code: https://github.com/NoobTW/od-freq/blob/master/src/App.js#L110
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:
const handleClick = this.handleClick.bind(this);
And then try this for your click function:
on:
click: function(d) {
this._tooltipClass.data([]).render();
handleClick(d);
}
}
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
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.
}
}
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.