Forum Discussion

emiljas's avatar
emiljas
Frequent Visitor
2 years ago

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

  • emiljas's avatar
    emiljas
    Frequent Visitor

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

  • dm-p's avatar
    dm-p
    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).

    • dm-p's avatar
      dm-p
      Super 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

      • emiljas's avatar
        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?