<commit_before>Class {
	#name : #RTMapExample,
	#superclass : #RTAbstractExample,
	#category : #'Roassal2-ExampleBrowser'
}

{ #category : #sources }
RTMapExample >> exampleCity01 [

	| b |<commit_msg>0.399 : Visualization of African Countries<commit_after>Class {
	#name : #RTMapExample,
	#superclass : #RTAbstractExample,
	#category : #'Roassal2-ExampleBrowser'
}

{ #category : #sources }
RTMapExample >> exampleAfricanPopulation [

	| b countries cn sum|
	b := RTMapBuilder new.	
		
	countries := RTMapBuilder countriesPopulation select: [ :c | RTSVGPath africa includes: (c at: 1) ].
	sum := (countries collect: [ :c | c at: 2 ])inject: 0 into: [ :acc :n | acc + n ].
	
	cn := RTNColorLinearNormalizer
		inContext: (countries collect: [:c | c at: 2])
		lowColor: (Color r:0.8 g:0.8 b:1)
		highColor: (Color r:0 g:0 b:0.3).
	
	b countries: countries named: [ :c | c at: 1 ].
	b color: [ :c | cn rtValue: (c at: 2) ].
	b withPopup: [ :c |
		(c at: 1) asString, ': ',
		(((c at: 2) / sum * 100 asFloat roundTo: 0.01) printString), '%'].
	b scale: 2.
	b open.
b view canvas
]

{ #category : #icons }
RTMapExample >> exampleAfricanPopulationIcon [
	^ '<KEY>
]

{ #category : #sources }
RTMapExample >> exampleCity01 [

	| b |
{'fraction_non_alphanumeric': 0.15918367346938775, 'fraction_numerical': 0.027755102040816326, 'mean_word_length': 3.826771653543307, 'pattern_counts': {'":': 0, '<': 4, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3379255', 'n_tokens_mistral': 505, 'n_tokens_neox': 461, 'n_words': 128}