• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / MooseIDE / 18427491564

11 Oct 2025 09:18AM UTC coverage: 66.634% (-0.01%) from 66.644%
18427491564

push

github

web-flow
Merge pull request #1460 from moosetechnology/forced-based-layout

MiForceBasedLayout

1 of 20 new or added lines in 2 files covered. (5.0%)

5 existing lines in 1 file now uncovered.

20618 of 30942 relevant lines covered (66.63%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.02
/src/MooseIDE-Dependency/MiForceBasedLayout.class.st
1
"
2
A force based layout for Roassal with parameterstunned for ArchitecturalMap where the nodes
3
"
4
Class {
5
        #name : 'MiForceBasedLayout',
6
        #superclass : 'RSForceBasedLayout',
7
        #category : 'MooseIDE-Dependency-ArchitecturalMap',
8
        #package : 'MooseIDE-Dependency',
9
        #tag : 'ArchitecturalMap'
10
}
11

12
{ #category : 'as yet unclassified' }
13
MiForceBasedLayout class >> layoutDescription [
2✔
14

2✔
15
        ^ 'Arrange shapes boased on attraction/repulsion forces.'
2✔
16
]
2✔
17

18
{ #category : 'accessing' }
19
MiForceBasedLayout class >> layoutName [
2✔
20

2✔
21
        ^ 'Force based'
2✔
22
]
2✔
23

24
{ #category : 'initialization' }
25
MiForceBasedLayout >> reset [
×
26
        "explanation of some parameters (from super class comments and help of ChatGPT)
×
27
        strength: Set the force of attraction for the edges. A high value results in having nodes together.
×
28
                The default value is 1.0
×
29
        charge: Typically a negative value. E.g., -300.
×
30
                This is a repulsive force between nodes (like electric charge).
×
31
        length: the natural (desired) distance between connected nodes, eg. 50
×
32
        gravity: it is the force from nodes to move toward center.
×
33
                Higher value results in nodes clustered more tightly toward the center.
×
34
        friction: Simulates resistance or damping in motion — it slows down node movement over time.
×
35
                Usualy a value between 0 and 1. Higher value makes nodes slow down quickly and the layout stabilizes faster.
×
36
        theta: Theta coefficient from Barnes-Hut simulation. Value ranges on [0, 1].
×
37
                Performance is better with smaller values. 
×
38
                Very small values may not create enough force to give a good result"
×
39

×
40
        super reset.
×
41

×
42
        self
×
NEW
43
                iterations: 10 ;
×
NEW
44
                strength: 0.5 ;
×
NEW
45
                charge: -500 ;
×
NEW
46
                length: 200 ;
×
47
                friction: 0.5
×
48
]
×
49

50
{ #category : 'hook' }
NEW
51
MiForceBasedLayout >> start [
×
NEW
52
        "parent uses an initialLayout.
×
NEW
53
         We remove that to give the user the opportunity to influence the result"
×
NEW
54

×
NEW
55
        "initialLayout on: nodes."
×
NEW
56

×
NEW
57
        nodes := nodes collect: [ :node | self newMockElementFor: node ].
×
NEW
58
        lines := lines
×
NEW
59
                collect: [ :e | self newMockLineFor: e ]
×
NEW
60
                thenReject: [:e | e isNil ].
×
NEW
61
        self autoRepulse ifTrue: [
×
NEW
62
                self calculateAutoRepulse.
×
NEW
63
                 ].
×
NEW
64
        alpha ifNil: [ alpha :=  0.1 ]
×
NEW
65
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc