<commit_before>Class {
	#name : #RSClusteringLayoutTest,
	#superclass : #TestCase,
	#category : #'Roassal3-Layouts-Tests'
}

{ #category : #tests }
RSClusteringLayoutTest >> testBasic [

| m nodes |
m := RSMondrian new.
m nodes: (10 to: 50).
m line connectFrom: [ :nb | nb // 2 ].
m build.

nodes := m canvas nodes.

RSConditionalLayout new
	ifNotConnectedThen: RSGridLayout new;
	else: (RSClusteringLayout new 
				clustersLayout: RSFlowLayout new;
				forEachLayout: RSTreeLayout new);
	on: nodes.

	self assert: (nodes collect: #position) asArray equals:((Array new: 41) at: 1 put: ((19.0@7.5)); at: 2 put: ((53.0@7.5)); at: 3 put: ((83.0@7.5)); at: 4 put: ((105.0@7.5)); at: 5 put: ((11.0@67.5)); at: 6 put: ((29.0@67.5)); at: 7 put: ((47.0@67.5)); at: 8 put: ((65.0@67.5)); at: 9 put: ((83.0@67.5)); at: 10 put: ((101.0@67.5)); at: 11 put: ((11.0@32.5)); at: 12 put: ((27.0@32.5)); at: 13 put: ((45.0@32.5)); at: 14 put: ((61.0@32.5)); at: 15 put: ((79.0@32.5)); at: 16 put: ((91.0@32.5)); at: 17 put: ((101.0@32.5)); at: 18 put: ((109.0@32.5)); at: 19 put: ((7.0@92.5)); at: 20 put: ((15.0@92.5)); at: 21 put: ((25.0@92.5)); at: 22 put: ((33.0@92.5)); at: 23 put: ((43.0@92.5)); at: 24 put: ((51.0@92.5)); at: 25 put: ((61.0@92.5)); at: 26 put: ((69.0@92.5)); at: 27 put: ((79.0@92.5)); at: 28 put: ((87.0@92.5)); at: 29 put: ((97.0@92.5)); at: 30 put: ((105.0@92.5)); at: 31 put: ((7.0@57.5)); at: 32 put: ((15.0@57.5)); at: 33 put: ((23.0@57.5)); at: 34 put: ((31.0@57.5)); at: 35 put: ((41.0@57.5)); at: 36 put: ((49.0@57.5)); at: 37 put: ((57.0@57.5)); at: 38 put: ((65.0@57.5)); at: 39 put: ((75.0@57.5)); at: 40 put: ((83.0@57.5)); at: 41 put: ((91.0@57.5)); yourself)
]<commit_msg>minor fix in a test<commit_after>Class {
	#name : #RSClusteringLayoutTest,
	#superclass : #TestCase,
	#category : #'Roassal3-Layouts-Tests'
}

{ #category : #tests }
RSClusteringLayoutTest >> testBasic [

	| m nodes |
	m := RSMondrian new.
	m nodes: (10 to: 50).
	m line connectFrom: [ :nb | nb // 2 ].
	m build.

	nodes := m canvas nodes.

	RSConditionalLayout new
		ifNotConnectedThen: RSGridLayout new;
		else: (RSClusteringLayout new
				 clustersLayout: RSFlowLayout new;
				 forEachLayout: RSTreeLayout new);
		on: nodes.

	self
		assert: (nodes collect: #position) asArray
		equals: ((Array new: 41)
				 at: 1 put: 19.0 @ 7.5;
				 at: 2 put: 53.0 @ 7.5;
				 at: 3 put: 83.0 @ 7.5;
				 at: 4 put: 105.0 @ 7.5;
				 at: 5 put: 11.0 @ 67.5;
				 at: 6 put: 29.0 @ 67.5;
				 at: 7 put: 47.0 @ 67.5;
				 at: 8 put: 65.0 @ 67.5;
				 at: 9 put: 83.0 @ 67.5;
				 at: 10 put: 101.0 @ 67.5;
				 at: 11 put: 11.0 @ 32.5;
				 at: 12 put: 27.0 @ 32.5;
				 at: 13 put: 45.0 @ 32.5;
				 at: 14 put: 61.0 @ 32.5;
				 at: 15 put: 79.0 @ 32.5;
				 at: 16 put: 91.0 @ 32.5;
				 at: 17 put: 101.0 @ 32.5;
				 at: 18 put: 109.0 @ 32.5;
				 at: 19 put: 7.0 @ 92.5;
				 at: 20 put: 15.0 @ 92.5;
				 at: 21 put: 25.0 @ 92.5;
				 at: 22 put: 33.0 @ 92.5;
				 at: 23 put: 43.0 @ 92.5;
				 at: 24 put: 51.0 @ 92.5;
				 at: 25 put: 61.0 @ 92.5;
				 at: 26 put: 69.0 @ 92.5;
				 at: 27 put: 79.0 @ 92.5;
				 at: 28 put: 87.0 @ 92.5;
				 at: 29 put: 97.0 @ 92.5;
				 at: 30 put: 105.0 @ 92.5;
				 at: 31 put: 7.0 @ 57.5;
				 at: 32 put: 15.0 @ 57.5;
				 at: 33 put: 23.0 @ 57.5;
				 at: 34 put: 31.0 @ 57.5;
				 at: 35 put: 41.0 @ 57.5;
				 at: 36 put: 49.0 @ 57.5;
				 at: 37 put: 57.0 @ 57.5;
				 at: 38 put: 65.0 @ 57.5;
				 at: 39 put: 75.0 @ 57.5;
				 at: 40 put: 83.0 @ 57.5;
				 at: 41 put: 91.0 @ 57.5;
				 yourself)
]
{'fraction_non_alphanumeric': 0.22668174109666478, 'fraction_numerical': 0.18428490672696438, 'mean_word_length': 2.466209598432909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '254446', 'n_tokens_mistral': 2177, 'n_tokens_neox': 1575, 'n_words': 492}