Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
emiljas
Frequent Visitor

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 8
emiljas
Frequent 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 install

 

2. Serve visual

 

npm run start

 

 

 

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:

 

dmp_0-1713305440724.png

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




emiljas
Frequent Visitor

@dm-p I also gets 510 when I hit refesh button but could you check what if you save report and reload page?

If I save and reload the page, I do get a few more updates. These are not necessarily the same as you, or in the same order, but there are definitely more of them:

dmp_0-1713391181308.png

 

Interestingly, if I navigate away from the report and re-open it, I just get two VisualUpdateType.Resize | VisualUpdateType.ResizeEnd updates when my visual loads:

dmp_1-1713391242249.png

 

If I do a 'refresh visuals' operation (top-right corner when viewing the report), I get the following:

dmp_2-1713391441511.png

 

I would presume that there are reasons for the quantity of the updates, and I would still recommend my advice of defensively handling update types for your visual so that you only run the logic you need to when you need to. However, if you want to know why these updates occur, it would be best to check with MS directly. They don't monitor the forums, so you can either open an issue in the powerbi-visuals-api repo or email them at pbicvsupport@microsoft.com for specific questions.

 

Regards,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




emiljas
Frequent Visitor

Besides of my custom visual I also tried on this visual:
https://github.com/microsoft/PowerBI-visuals-sampleBarChart

 

The same results...

dm-p
Super User
Super 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).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




emiljas
Frequent Visitor

No, "General -> Properties -> Advanced options -> Responsive" toggle is off and disabled

lbendlin
Super User
Super User

did you set it as responsive?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors