public update()

in src/sampleSlicer.ts [364:403]


    public update(options: VisualUpdateOptions) {
        if (!options ||
            !options.dataViews ||
            !options.dataViews[0] ||
            !options.viewport) {
            return;
        }
        this.eventService.renderingStarted(options);
        
        this.jsonFilters = options.jsonFilters;
        this.restoreRangeFilter(options.dataViews[0]);
        
        // create viewport if not yet created
        if (!this.currentViewport) {
            this.currentViewport = options.viewport;
            this.initContainer();
        }
        
        // update dataview
        const existingDataView = this.dataView;
        this.dataView = options.dataViews[0];

        // check if the dataView changed to determine if scrollbars need to be reset
        let categoryIdentityChanged: boolean = true;
        if (existingDataView) {
          categoryIdentityChanged = !SampleSlicer.hasSameCategoryIdentity(existingDataView, this.dataView);
        }

        // update viewport
        if (options.viewport.height === this.currentViewport.height
            && options.viewport.width === this.currentViewport.width) {
            this.waitingForData = false;
        }
        else {
            this.currentViewport = options.viewport;
        }

        this.updateInternal(categoryIdentityChanged);
        this.eventService.renderingFinished(options);
    }