<commit_before>import MapView from 'esri/views/MapView';
import WebMap from 'esri/WebMap';
import GraphicsLayer from 'esri/layers/GraphicsLayer';
import Graphic from 'esri/Graphic';
import SimpleFillSymbol from 'esri/symbols/SimpleFillSymbol';

export function miniMapInit(
  webmapID: string,
  htmlRef: React.RefObject<HTMLDivElement | null>,
  geometry: __esri.Geometry
): void {
  if (!htmlRef.current) return;

  const mapRef = new WebMap({
    portalItem: {
      id: webmapID
    }
  });

  const miniMapView = new MapView({
    map: mapRef,
    container: htmlRef.current
  });

  miniMapView.when(() => {
    //Clean up mapview from UI elements and interactions
    miniMapView.ui.remove('zoom');
    miniMapView.ui.remove('attribution');
    miniMapView.on('mouse-wheel', function(event: any) {
      event.stopPropagation();
    });
    miniMapView.on('double-click', function(event: any) {
      event.stopPropagation();
    });
    miniMapView.on('drag', function(event: any) {
      event.stopPropagation();
    });

    //Remove All layers that are not needed
    mapRef.removeAll();

    const aoiGraphic = new Graphic({
      geometry: geometry,
      symbol: new SimpleFillSymbol({
        style: 'solid',
        color: [210, 210, 210, 0.0],
        outline: {
          color: [3, 188, 255],
          width: 3
        }
      })
    });

    const gLayer = new GraphicsLayer({
      graphics: [aoiGraphic]
    });

    mapRef.add(gLayer);
    miniMapView.goTo(geometry);
  });
}<commit_msg>polygon fix for the minimap<commit_after>import MapView from 'esri/views/MapView';
import WebMap from 'esri/WebMap';
import GraphicsLayer from 'esri/layers/GraphicsLayer';
import Graphic from 'esri/Graphic';
import SimpleFillSymbol from 'esri/symbols/SimpleFillSymbol';
import Polygon from 'esri/geometry/Polygon';

export function miniMapInit(
  webmapID: string,
  htmlRef: React.RefObject<HTMLDivElement | null>,
  geometry: __esri.Geometry
): void {
  if (!htmlRef.current) return;

  const mapRef = new WebMap({
    portalItem: {
      id: webmapID
    }
  });

  const miniMapView = new MapView({
    map: mapRef,
    container: htmlRef.current
  });

  miniMapView.when(() => {
    //Clean up mapview from UI elements and interactions
    miniMapView.ui.remove('zoom');
    miniMapView.ui.remove('attribution');
    miniMapView.on('mouse-wheel', function(event: any) {
      event.stopPropagation();
    });
    miniMapView.on('double-click', function(event: any) {
      event.stopPropagation();
    });
    miniMapView.on('drag', function(event: any) {
      event.stopPropagation();
    });

    //Remove All layers that are not needed
    mapRef.removeAll();

    const poly = new Polygon(geometry);
    const aoiGraphic = new Graphic({
      geometry: poly,
      symbol: new SimpleFillSymbol({
        style: 'solid',
        color: [210, 210, 210, 0.0],
        outline: {
          color: [3, 188, 255],
          width: 3
        }
      })
    });

    const gLayer = new GraphicsLayer({
      graphics: [aoiGraphic]
    });

    mapRef.add(gLayer);
    miniMapView.goTo(poly);
  });
}
{'fraction_non_alphanumeric': 0.13138451654352715, 'fraction_numerical': 0.012206874397687119, 'mean_word_length': 2.9820971867007673, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5712247', 'n_tokens_mistral': 1026, 'n_tokens_neox': 982, 'n_words': 234}