This is the code we're using to connect to a LightningOut Einstein Analytics component.
Because LightningOut requires the iframe to set unsafe-eval
this isn't an app you'll be able to deploy but it will work in Use Local Resources mode. The code is provided here mostly as a proof of concept.