<commit_before>'use strict'

const fetch = require('isomorphic-fetch')
const groupBy = require('lodash.groupBy')



const endpoint = 'http://192.168.127.12:8080/picture/picture'
const filters = ['decade', 'collection', 'color', 'location', 'motif', 'view']



const err = (e) => {throw e}

const data = fetch(endpoint)
.then((res) => res.json(), err)
.then((photos) => {
	const data = {}

	data.photos = photos.map((p) => ({
		  id:         p.id
		, url:        p.Bildname
		, thumb: {
			  url:    p.BildSmall
			, width:  p.width
			, height: p.height
		}
		, year:       p.Decade
		, decade:     ((p.Decade - p.Decade % 10) || '?').toString()
		, collection: p.Collection
		, color:      p.Color.toLowerCase()
		, location:   p.Location
		, motif:      p.Subject
		, view:       p.View
	}))

	for (let filter of filters)
		data[filter] = groupBy(data.photos, (p) => p[filter])

	data.filters = filters<commit_msg>reorder and rename filters<commit_after>'use strict'

const fetch = require('isomorphic-fetch')
const groupBy = require('lodash.groupBy')



const endpoint = 'http://199.217.112.113:8080/picture/picture'
const filters = ['decade', 'color', 'subject', 'view', 'collection', 'location']



const err = (e) => {throw e}

const data = fetch(endpoint)
.then((res) => res.json(), err)
.then((photos) => {
	const data = {}

	data.photos = photos.map((p) => ({
		  id:         p.id
		, url:        p.Bildname
		, thumb: {
			  url:    p.BildSmall
			, width:  p.width
			, height: p.height
		}
		, decade:     ((p.Decade - p.Decade % 10) || '?').toString()
		, collection: p.Collection
		, color:      p.Color.toLowerCase()
		, location:   p.Location
		, subject: 	  p.Subject
		, view:       p.View
	}))

	for (let filter of filters)
		data[filter] = groupBy(data.photos, (p) => p[filter])

	data.filters = filters
{'fraction_non_alphanumeric': 0.1804717498628634, 'fraction_numerical': 0.019199122325836534, 'mean_word_length': 2.880851063829787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1227026', 'n_tokens_mistral': 730, 'n_tokens_neox': 644, 'n_words': 148}