<commit_before>import { PathLayer } from 'deck.gl'

const routeLayer = routes => {
	const data = routes.map(route => {
		let path = []
		route.hops.forEach(hop => {
			const start = [
				hop.start.location.longitude,
				hop.start.location.latitude,
			]
			const end = [hop.end.location.longitude, hop.end.location.latitude]

			path.push(start)
			path.push(end)
		})

		return {
			path: [...path],
			width: 10,
			color: [151, 45, 7],
		}
	})
	return layer(data)
}

const layer = data => {
	return new PathLayer({
		id: 'layer-route',
		data,
		rounded: true,
	})
}

export default routeLayer<commit_msg>DLN-122 #time 10m change route to dashed line & only show orders<commit_after>import { PathLayer } from 'deck.gl'

const routeLayer = routes => {
	const data = routes.map(route => {
		if (route.origin === 'order') {
			let path = []
			route.hops.forEach(hop => {
				const start = [
					hop.start.location.longitude,
					hop.start.location.latitude,
				]
				const end = [
					hop.end.location.longitude,
					hop.end.location.latitude,
				]

				path.push(start)
				path.push(end)
			})

			return {
				path: [...path],
				width: 10,
				color: [151, 45, 7],
			}
		}
	})
	return layer(data)
}

const layer = data => {
	return new PathLayer({
		id: 'layer-route',
		data,
		rounded: true,
		getDashArray: () => [3, 10],
	})
}

export default routeLayer
{'fraction_non_alphanumeric': 0.1552478134110787, 'fraction_numerical': 0.01749271137026239, 'mean_word_length': 2.7309782608695654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '4077535', 'n_tokens_mistral': 608, 'n_tokens_neox': 492, 'n_words': 111}