Search code examples
powerbivegadeneb

How to prevent Vega signals from resetting when changing Deneb input data via Power BI slicers


I am using Deneb visual in Power BI to display project timelines in a gantt-chart. The Vega code within Deneb includes event handlers for panning and zooming on the timeline. The Deneb visual is integrated into a Power BI page with several slicers controlling for the data sent to the Deneb visual.

Every time I change the Power BI slicers (e.g. show/hide baseline values) and hence modify the number or rows sent to the Deneb visual the panning and zooming previously applied to the Deneb visualization are resetted.

Could you give me an indication, if the Vega code can be modified, in order to prevent changes of the input data to reset the panning and zooming applied? And if so, could you share a high level outline or some rough ideas how to do so?

This is the event handler that i am using (modified copy from Davide Bacci's Gantt chart)

    {
      "name": "anchor",
      "value": 0,
      "on": [
        {
          "events": "wheel",
          "update": "+invert('x_scale', x()-columnsWidth)"
        }
      ]
    },

However, I am not sure whether resetting the signal due to change in input data is a problem of the event handler, or if the entire Deneb visual is rendered anew, when input data changes?


Solution

  • Comment posted by davidebacci CommentedSep 3 at 16:04

    See here: https://github.com/deneb-viz/deneb/issues/410