<commit_before>###
  termap - Terminal Map Viewer
  by <NAME> <<EMAIL>>

  UI and central command center
###

keypress = require 'keypress'
TermMouse = require 'term-mouse'
Promise = require 'bluebird'

Renderer = require './Renderer'
TileSource = require './TileSource'
utils = require './utils'
config = require './config'

module.exports = class Termap
  width: null
  height: null
  canvas: null
  mouse: null

  mouseDragging: false
  mousePosition:
    x: 0, y: 0

  tileSource: null
  renderer: null

  zoom: 0
  center:
    # sf lat: 37.787946, lon: -122.407522
    # iceland lat: 64.124229, lon: -21.811552
    # rgbg
    lat: 49.019493, lon: 12.098341

  minZoom: null

  constructor: (options) ->
    config[key] = val for key, val of options

  init: ->
    Promise
    .resolve()
    .then =>
      unless config.headless
        @_initKeyboard()
        @_initMouse()

      @_initTileSource()

    .then =>
      @_initRenderer()

    .then =>
      @_draw()

  _initTileSource: ->
    @tileSource = new TileSource()
    @tileSource.init config.source

  _initKeyboard: ->
    keypress config.input
    config.input.setRawMode true<commit_msg>:art: set start position to the c-base! <3<commit_after>###
  termap - Terminal Map Viewer
  by <NAME> <<EMAIL>>

  UI and central command center
###

keypress = require 'keypress'
TermMouse = require 'term-mouse'
Promise = require 'bluebird'

Renderer = require './Renderer'
TileSource = require './TileSource'
utils = require './utils'
config = require './config'

module.exports = class Termap
  width: null
  height: null
  canvas: null
  mouse: null

  mouseDragging: false
  mousePosition:
    x: 0, y: 0

  tileSource: null
  renderer: null

  zoom: 0
  center:
    # sf lat: 37.787946, lon: -122.407522
    # iceland lat: 64.124229, lon: -21.811552
    # rgbg
    # lat: 49.019493, lon: 12.098341
    lat: 52.51298, lon: 13.42012

  minZoom: null

  constructor: (options) ->
    config[key] = val for key, val of options

  init: ->
    Promise
    .resolve()
    .then =>
      unless config.headless
        @_initKeyboard()
        @_initMouse()

      @_initTileSource()

    .then =>
      @_initRenderer()

    .then =>
      @_draw()

  _initTileSource: ->
    @tileSource = new TileSource()
    @tileSource.init config.source

  _initKeyboard: ->
    keypress config.input
    config.input.setRawMode true
{'fraction_non_alphanumeric': 0.12058823529411765, 'fraction_numerical': 0.05, 'mean_word_length': 2.674382716049383, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 23, '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': '3052023', 'n_tokens_mistral': 893, 'n_tokens_neox': 788, 'n_words': 228}