<commit_before>import { Component, ViewChild, AfterViewInit, PipeTransform, Pipe } from '@angular/core';
import {
    IgxRowIslandComponent,
    IgxHierarchicalGridComponent,
    IGridCreatedEventArgs,
    GridSelectionMode
} from 'igniteui-angular';
import { RemoteService } from '../shared/remote.service';
import { HierarchicalRemoteService } from './hierarchical-remote.service';
import { debounceTime } from 'rxjs/operators';

@Component({
    selector: 'app-hierarchical-grid-remote-virtualization-sample',
    templateUrl: 'hierarchical-grid-remote-virtualization.html',
    styleUrls: ['hierarchical-grid-remote-virtualization.scss'],
    providers: [RemoteService]
})
export class HierarchicalGridRemoteVirtualizationComponent implements AfterViewInit {

    public selectionMode;
    remoteData = [];
    gridData = [];
    totalCount: number;

    @ViewChild('rowIsland1', { static: true })
    rowIsland1: IgxRowIslandComponent;

    @ViewChild('hGrid', { static: true })
    hGrid: IgxHierarchicalGridComponent;

    constructor(private remoteService: HierarchicalRemoteService) {
        remoteService.url = 'https://services.odata.org/V4/Northwind/Northwind.svc/Customers?$expand=Orders';
    }

    public handleLoad(args) {
        this.hGrid.isLoading = true;
        this.remoteService.getData(args, this.hGrid, (data) => {
            this.gridData = data;
            this.hGrid.isLoading = false;
        });
    }

    public ngAfterViewInit() {
        this.hGrid.isLoading = true;
        // load initial data
        this.handleLoad(this.hGrid.virtualizationState);

        // update when row is expanded/collapsed
        this.hGrid.expansionStatesChange.subscribe(x => {
            this.handleLoad(this.hGrid.virtualizationState);
        });

        // update on scroll
        this.hGrid.onDataPreLoad.pipe().subscribe(() => {<commit_msg>chore(*): Show loading indicator only on remote data load. Exclude expanding/collapsing.<commit_after>import { Component, ViewChild, AfterViewInit, PipeTransform, Pipe } from '@angular/core';
import {
    IgxRowIslandComponent,
    IgxHierarchicalGridComponent,
    IGridCreatedEventArgs,
    GridSelectionMode
} from 'igniteui-angular';
import { RemoteService } from '../shared/remote.service';
import { HierarchicalRemoteService } from './hierarchical-remote.service';
import { debounceTime } from 'rxjs/operators';

@Component({
    selector: 'app-hierarchical-grid-remote-virtualization-sample',
    templateUrl: 'hierarchical-grid-remote-virtualization.html',
    styleUrls: ['hierarchical-grid-remote-virtualization.scss'],
    providers: [RemoteService]
})
export class HierarchicalGridRemoteVirtualizationComponent implements AfterViewInit {

    public selectionMode;
    remoteData = [];
    gridData = [];
    totalCount: number;

    @ViewChild('rowIsland1', { static: true })
    rowIsland1: IgxRowIslandComponent;

    @ViewChild('hGrid', { static: true })
    hGrid: IgxHierarchicalGridComponent;

    public isExpanding = false;

    constructor(private remoteService: HierarchicalRemoteService) {
        remoteService.url = 'https://services.odata.org/V4/Northwind/Northwind.svc/Customers?$expand=Orders';
    }

    public handleLoad(args) {
        this.hGrid.isLoading = !this.isExpanding;
        this.remoteService.getData(args, this.hGrid, (data) => {
            this.gridData = data;
            this.hGrid.isLoading = false;
            this.isExpanding = false;
        });
    }

    public ngAfterViewInit() {
        this.hGrid.isLoading = true;
        // load initial data
        this.handleLoad(this.hGrid.virtualizationState);

        // update when row is expanded/collapsed
        this.hGrid.expansionStatesChange.subscribe(x => {
            this.isExpanding = true;
            this.handleLoad(this.hGrid.virtualizationState);
        });

        // update on scroll
        this.hGrid.onDataPreLoad.pipe().subscribe(() => {
{'fraction_non_alphanumeric': 0.11452513966480447, 'fraction_numerical': 0.0015236160487557136, 'mean_word_length': 3.3766666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3407774', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1140, 'n_words': 201}