Clear clickData in dcc.graph

I’ve scouted through this forum for an answer to clearing clickData by simple clicking/double-clicking the background of the dcc.graph but Iam unable to find threads with solutions.

Have I not looked enough or is it simply not possible?

What I want to use this for is to clear my selection. I have a bar plot, i click one of the bars, it is snapped up in my callback that then filters an ag.AgGrid table… But i can’t clear the filter since I cant get my code to notice when I click the background of the graph (clickData should be None ?).

Ok maybe I found a thread here:

But if anyone have another solution please share (i will try this meanwhile).

I didnt get it to work. Help please

Hey there!

Hello @JD222SD,

Welcome to the community!

clickData will only be triggered upon clicking a mapped point, so its difficult to clear the clickData for that purpose.

However, you could add an event listener to the div of the graph and implement your own logic for determining if the clickData should be cleared.

Hmm ok… I really wish Dash had the support for noticing when the user clicks the background of a html component such as graph.