Forum Discussion
Custom Visual gets 5 updates on startup
My custom visual gets 5 updates on startup.
options.type for these updates is:
1. 64 //VisualUpdateType.FormattingSubSelectionChange
2. 128 //VisualUpdateType.FormatModeChange
3. 36 //VisualUpdateType.Resize + VisualUpdateType.ResizeEnd
4. 2 //VisualUpdateType.Data
5. 36 //VisualUpdateType.Resize + VisualUpdateType.ResizeEnd
6. 2 //VisualUpdateType.Data
Is it normal? If so how to avoid rerendering my visual.
8 Replies
- lbendlinSuper User
did you set it as responsive?
- emiljasFrequent Visitor
No, "General -> Properties -> Advanced options -> Responsive" toggle is off and disabled
- dm-pSuper User
It seems odd—you typically get the updates needed from the visual host and for startup, this is usually one if you have data present (or if you're using the landing page API). I've tried a few of my projects (just in case there has been a recent change to the developer visual that I haven't noticed), and this is still the case.
Does this happen if you create a new visual project, or is it with your implemented logic? If the latter, are you doing anything as part of your visual update process, such as handling property migration or additional data fetching? These operations will trigger additional updates from the visual host. If you haven't confirmed, it could be good to check the interaction diagram, to check what operations trigger what, and to eliminate anything from your logic that might be superfluous for this process. Note that you may need to consider filtering these by checking the update type and routing accordingly (if they exist) so that you don't unnecessarily cause these updates when they're not needed.
Beyond that, you may need to share your update method so we can see if anything obvious sticks out. It would also be good to know which version of the API and visuals tools you're using (just in case mine are different to yours).
- emiljasFrequent Visitor
Besides of my custom visual I also tried on this visual:
https://github.com/microsoft/PowerBI-visuals-sampleBarChartThe same results...
- emiljasFrequent Visitor
I wonder if it's related to my PowerBI account.
Would anyone be so kind to run this sampleBarChart visual on your machine and tell me what update types you gets?
https://github.com/microsoft/PowerBI-visuals-sampleBarChart
It's very easy to set up:
1. Install dependencies
npm install2. Serve visual
npm run start- dm-pSuper User
Hi emiljas,
Using the sample bar chart repo, If I refresh the visual with data in the data view, I get one update with a 510 (VisualUpdateType.All) as expected:
The only time I can get multiple update methods to be called is when I put the visual in and out of focus mode (which is expected due to changes in the viewport between states).
Regards,
Daniel