<commit_before># WeatherAutocomplete

## About
This script provides an autocomplete box underneath an input element. Upon typing name of a city/town etc the results are filtered down in the autocomplete as you would expect.

Along with the cities, the weather for that city is also displayed. All weather information for that city is then available through a series of data attributes.

Much of the script is configurable on instantiation. You can pass an object the script with your choice on things like the input to tie the autocomplete to and many more options (detailed below)

## Usage

### Bower
`bower install --save weatherAutocomplete` will install the package via bower. The main files are provided offering the default js and css files by default although you can always override this in the usual way.

### Git
You can clone the repository locally with `git clone git@github.com:GrandadEvans/weatherAutocomplete.git`

### How to use it
    weatherAutocomplete({
		searchElement: '#weatherSearchInput',
		minSearchCharacters: 3,
		temperatureMeasurement: 'c',
		displayFormat: '{city}, {countryCode} {icon} ({tempC})',
		informationToDisplay: [
			'city',
			'countryCode',
			'temperature',
			'icon'
		]
    });

## Configuration

There are several configuration options (as can be seen above). In details then&hellip;

### Searchelement
The id of the input to tie the autocomplete to
(default) '#weatherAutocompleteSearchInput'

### minSearchChars
How many characters would you like to have before the inital search is carried out?
(default) 3

### informationToDisplay
What information would you like to display? You can either enter a string (if you just want the city name) or an array with several fields in. The fields available are:

  *   The city name `city`
  *   The temperature `temp`
  *   The wind speed `windSpeed`, `wind-speed`, `wind_speed`
  *   The wind direction `windDirection`, `wind-direction`, `wind_direction`
  *   The percentage of cloud cover `clouds`
  *   The country name `country`
  *   The 2 character country code `countryCode`, `country-code`, `country_code`
  *   The humidity `humidity`
  *   The barometric pressure `pressure`
  *   Maximum temperature for the city `maxTemp`, `max-temp`, `max_temp`
  *   Minimum temperature for the city `minTemp`, `min-temp`, `min_temp`
  *   An icon showing the weather `icon`
  *   The co-ordinates as 'data-lat' and 'data-lon' `coords`

## Support
If you require any help then please don't be afraid to ask :-) and thanks for looking.<commit_msg>Updated the readme file to take into account the new changes<commit_after># WeatherAutocomplete

## About
This script provides an autocomplete box underneath an input element. Upon typing name of a city/town etc the results are filtered down in the autocomplete as you would expect.

Along with the cities, the weather for that city is also displayed. All weather information for that city is then available through a series of data attributes.

Much of the script is configurable on instantiation. You can pass an object the script with your choice on things like the input to tie the autocomplete to and many more options (detailed below)

## Usage

### Bower
`bower install --save weatherAutocomplete` will install the package via bower. The main files are provided offering the default js and css files by default although you can always override this in the usual way.

### Git
You can clone the repository locally with `git clone git@github.com:GrandadEvans/weatherAutocomplete.git`

### How to use it
		initialiseAutocompleteWithWeather({
			searchElement: '#city',
			minSearchCharacters: 3,
			displayFormat: '{cityName}, {countryCode} {icon} ({temp})',
			measurementType: 'metric' // metric or imperial
		});
	});

## Configuration

There are several configuration options (as can be seen above). In details then&hellip;

### Searchelement
The id of the input to tie the autocomplete to
(default) '#weatherAutocompleteSearchInput'

### minSearchChars
How many characters would you like to have before the initial search is carried out?
(default) 3

### Format to display the information in
What format does the user want the information to be presented in within the autocomplete results?

Options:

  *  cityName
  *  city_id
  *  temperature
  *  icon
  *  windSpeed
  *  windDirection
  *  clouds
  *  countryCode
  *  humidity
  *  pressure
  *  minTemp
  *  maxTemp
  *  longitude
  *  latitude
  *  shortDescription
  *  longDescription

All the user has to do is create a string and wrap data they want in curly braces.
Example: If I wanted the information to be presented as:
Barnsley, GB {weather icon} (15 deg C)
Notes: In the example above the icon would be shown and the temperature would include the degree symbol
followed by correct measurement (C or F)
The above example would be coded as:

     '{cityName}, {countryCode} {icon} ({temperature})'
The above is also the default format.

## Support
If you require any help then please don't be afraid to ask :-) and thanks for looking.
{'fraction_non_alphanumeric': 0.06936187078874356, 'fraction_numerical': 0.0013872374157748713, 'mean_word_length': 4.246361746361746, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3887000', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1313, 'n_words': 675}