-
Notifications
You must be signed in to change notification settings - Fork 472
Understanding the Embed Process
ℹ️ This wiki has been deprecated |
---|
All our Client APIs documentation and references can be found in the new Power BI embedded analytics Client APIs documentation set. |
What actually happens when you call powerbi.embed(element, embedConfig);
?
-
Determine if we are embedding an element that contains embedded content.
If the content already embedded is of the same type, we can re-use the existing iframe and simply send a new load command to it rather than reloading the entire contents of the iframe. Reload is much slower because there is a significant amount of JavaScript to download.
-
(New Embed) Create instance of embed object. (Existing Embed) Skip this step.
- The constructor of the embed will normalize all the required configuration from either the HTML attributes or those passed directly in the configuration object.
-
The elements content is replaced with an
<iframe>
whose src attribute is set to the embed url from the embed configuration. -
A
load
event listener is added to the iframe element. -
When the iframe loads the HTML page it calls
embed.load
, which is the next step. -
Call
embed.load
, which takes the normalized load configuration that sends the loadConfiguration object (a subset of the embedConfiguration) to the iframe via window.postMessage. -
Send window.postMessage