Client side callbacks in embeddings?

Is it possible to integrate embeddings with a hosting app, i.e. to get a callback when a chart/table etc is clicked ?

Check out Embedding Metabase in other applications documentation, that’ll probably answer lots of questions.

Thanks,

I’d actually already read the docs & looked at the samples but didnt find anything there for client side callbacks, or events etc.
I guess next is to look at the source, but it’d be a great help to know if its a complete no no, or in the roadmap etc.

Regards

Look into Metabase’s API Documentation for ways to add or manipulate things programmatically. Also ran across this possibly applicable post response some time ago that basically says Metabase’s front end isn’t meant for embed.

Neither I think. AFAIK you're the first to suggest frontend click callbacks ... e.g. via JavaScript postMessage. If that’s what you have in mind?

Closest existing proposal I know of is “Action Buttons” if it got implemented as HTTP POSTs, not database writes - as I proposed on the GitHub issue:

It would be interesting to know a bit more about the use case you’re aiming to solve! :smiley: Maybe that’s a more appropriate place to start before talking implementation and protocols ...

Thanks for getting back to me.

Its really about thinking of the user flowing from the visual analysis back to the hosting application.

For example an application where the data is people, and based on some critieria you might want to contact them etc.
So you could have a metabase based pie chart embedded in the application on the left side of a web page, showing people who have maybe selected a specific answer to a question.

Imagine the user clicking on one of those pie chart regions, we would then listen for an event, and in another part of the UI we could drive an elasticsearch based search UI to start listing out those people.

They could then be further filtered there, and then they could send them a message.

I guess I’d always envisaged these types of data visualizations being used alongside application features to drive forward business outcomes.

Does that make sense ?

We’re not currently working on supporting client-side callbacks.

We’re open to them in principle, it’s not something the team is currently working on. If you’re interested, feel free to write up how you think they could/should work in a github issue. We tend to prioritize things based on how they slot into our overall vision for the product (super easy, 0-config, “magical” analysis of your data) and how much our install base wants them.

Will this help?

$(’#mb_dash’).on(‘load’, function () {
// code will run after iframe has finished loading
console.log(‘closePreload new school’);
$(".preloader").hide();
});