<commit_before>import {Component, OnInit, ViewRef} from '@angular/core';
import {HsLayoutService} from 'hslayers-ng';
import {HsMapService} from 'hslayers-ng';
import {HsPanelComponent} from 'hslayers-ng';
import {HsSensorUnit} from './sensor-unit.class';
import {HsSensorsService} from './sensors.service';
@Component({
  selector: 'hs-sensors',
  templateUrl: './partials/panel.html',
})
export class HsSensorsComponent implements HsPanelComponent, OnInit {
  viewMode = 'sensors';
  viewExpanded = false;
  query: any = {description: ''};
  viewRef: ViewRef;
  data: {viewMode?: string};

  constructor(
    public HsMapService: HsMapService,
    public HsSensorsService: HsSensorsService,
    public HsLayoutService: HsLayoutService
  ) {}
  ngOnInit(): void {
    this.HsMapService.loaded().then(() => this.init());
  }

  /**
   * Init function used to populate list of units and later
   * create some map functionality
   */
  init(): void {
    if (this.data.viewMode) {
      this.setViewMode(this.data.viewMode);
    }
    this.HsSensorsService.getUnits();
  }

  setViewMode(viewMode): void {
    this.viewMode = viewMode;
  }

  toggleExpansion(): void {
    this.viewExpanded = !this.viewExpanded;
    if (!this.viewExpanded) {
      this.HsSensorsService.units.forEach((element: HsSensorUnit) => {
        element.expanded = false;
      });
    }
  }

  isVisible() {
    return this.HsLayoutService.panelVisible('sensors');
  }
}
<commit_msg>refactor: Panel name for sensors with base class<commit_after>import {Component, OnInit, ViewRef} from '@angular/core';
import {HsLayoutService} from 'hslayers-ng';
import {HsMapService} from 'hslayers-ng';
import {HsPanelBaseComponent} from 'hslayers-ng';
import {HsSensorUnit} from './sensor-unit.class';
import {HsSensorsService} from './sensors.service';
@Component({
  selector: 'hs-sensors',
  templateUrl: './partials/panel.html',
})
export class HsSensorsComponent extends HsPanelBaseComponent implements OnInit {
  viewMode = 'sensors';
  viewExpanded = false;
  query: any = {description: ''};
  viewRef: ViewRef;
  data: {viewMode?: string};
  name = 'sensors';

  constructor(
    public HsMapService: HsMapService,
    public HsSensorsService: HsSensorsService,
    public HsLayoutService: HsLayoutService
  ) {
    super(HsLayoutService);
  }
  ngOnInit(): void {
    this.HsMapService.loaded().then(() => this.init());
  }

  /**
   * Init function used to populate list of units and later
   * create some map functionality
   */
  init(): void {
    if (this.data.viewMode) {
      this.setViewMode(this.data.viewMode);
    }
    this.HsSensorsService.getUnits();
  }

  setViewMode(viewMode): void {
    this.viewMode = viewMode;
  }

  toggleExpansion(): void {
    this.viewExpanded = !this.viewExpanded;
    if (!this.viewExpanded) {
      this.HsSensorsService.units.forEach((element: HsSensorUnit) => {
        element.expanded = false;
      });
    }
  }

  isVisible() {
    return this.HsLayoutService.panelVisible('sensors');
  }
}

{'fraction_non_alphanumeric': 0.1341503809208347, 'fraction_numerical': 0.0, 'mean_word_length': 3.83974358974359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1219834', 'n_tokens_mistral': 1006, 'n_tokens_neox': 963, 'n_words': 211}