<commit_before>import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MapData } from '../map-data';
import { Observable } from 'rxjs';
import { MapService } from '../map.service';
import { Vector2 } from '../../../core/tools/vector2';

@Component({
  selector: 'app-map',
  templateUrl: './map.component.html',
  styleUrls: ['./map.component.less']
})
export class MapComponent implements OnInit {

  @Input()
  mapId: number;

  @Input()
  markers: Vector2[] = [];

  mapData: Observable<MapData>;

  @Output()
  loaded: EventEmitter<void> = new EventEmitter<void>();

  constructor(private mapService: MapService) {
  }

  ngOnInit() {
    this.mapData = this.mapService.getMapById(this.mapId);
  }

  getMarkerPosition(map: MapData, marker: Vector2, offset = { x: 0, y: 0 }): { top: string, left: string } {
    const positionPercents = this.mapService.getPositionOnMap(map, marker);
    return { top: `${positionPercents.y + offset.y}%`, left: `${positionPercents.x + offset.y}%` };
  }

  getIcon(type: 0 | 1): string {
    return `./assets/icons/Aetheryte${type === 1 ? '_Shard' : ''}.png`;
  }

}
<commit_msg>fix(log-tracker): fixed an issue with map not changing properly when switching fishing hole<commit_after>import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MapData } from '../map-data';
import { Observable, ReplaySubject } from 'rxjs';
import { MapService } from '../map.service';
import { Vector2 } from '../../../core/tools/vector2';
import { switchMap } from 'rxjs/internal/operators/switchMap';

@Component({
  selector: 'app-map',
  templateUrl: './map.component.html',
  styleUrls: ['./map.component.less']
})
export class MapComponent implements OnInit {

  @Input()
  public set mapId(id: number) {
    this._mapId = id;
    this.mapId$.next(id);
  }

  public get mapId(): number {
    return this._mapId;
  }

  private mapId$: ReplaySubject<number> = new ReplaySubject<number>();

  private _mapId: number;

  @Input()
  markers: Vector2[] = [];

  mapData: Observable<MapData>;

  @Output()
  loaded: EventEmitter<void> = new EventEmitter<void>();

  constructor(private mapService: MapService) {
  }

  ngOnInit() {
    this.mapData = this.mapId$.pipe(
      switchMap(mapId => {
        return this.mapService.getMapById(mapId);
      })
    );
  }

  getMarkerPosition(map: MapData, marker: Vector2, offset = { x: 0, y: 0 }): { top: string, left: string } {
    const positionPercents = this.mapService.getPositionOnMap(map, marker);
    return { top: `${positionPercents.y + offset.y}%`, left: `${positionPercents.x + offset.y}%` };
  }

  getIcon(type: 0 | 1): string {
    return `./assets/icons/Aetheryte${type === 1 ? '_Shard' : ''}.png`;
  }

}

{'fraction_non_alphanumeric': 0.1710239651416122, 'fraction_numerical': 0.006535947712418301, 'mean_word_length': 3.782986111111111, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '2269766', 'n_tokens_mistral': 933, 'n_tokens_neox': 913, 'n_words': 215}