<commit_before>import geoblaze from 'geoblaze';
import GeoRasterLayer from 'georaster-layer-for-leaflet';
import chroma from 'chroma-js';

const RasterService = {

  create_raster(input) {
    return new Promise((resolve, reject) => {
      geoblaze.load(input)
        .then(georaster => {
          let options = {
            georaster: georaster,
            opacity: 0.7
          };
          let raster = new GeoRasterLayer(options);
          resolve(raster);
        }, error => {
          reject(error);
        });
    });
  }
}

export default RasterService;
<commit_msg>add different resolutions based on screen size<commit_after>import geoblaze from 'geoblaze';
import GeoRasterLayer from 'georaster-layer-for-leaflet';
import chroma from 'chroma-js';

const getResolution = () => {
  const width = document.documentElement.clientWidth;
  if (width < 900) {
    return Math.pow(2, 5);
  } else if (width < 1200) {
    return Math.pow(2, 6);
  } else {
    return Math.pow(2, 7);
  }
}

const RasterService = {

  create_raster(input) {
    return new Promise((resolve, reject) => {
      geoblaze.load(input)
        .then(georaster => {
          let options = {
            georaster: georaster,
            opacity: 0.7,
            resolution: getResolution(),
          };
          let raster = new GeoRasterLayer(options);
          resolve(raster);
        }, error => {
          reject(error);
        });
    });
  }
}

export default RasterService;

{'fraction_non_alphanumeric': 0.12127371273712736, 'fraction_numerical': 0.011517615176151762, 'mean_word_length': 2.3042505592841165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '3077197', 'n_tokens_mistral': 483, 'n_tokens_neox': 455, 'n_words': 104}