aboutsummaryrefslogtreecommitdiff
path: root/Map/Business
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 00:11:21 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 00:19:39 +0100
commitfa681bfcf5cbfcc711fb0ab10f3fd74ac83bf18c (patch)
tree2dce2e95bab08f773246b450ac50227f8e8f57da /Map/Business
parent0d5e6636405dbe332c33c0fb82c7ccccb20f96cb (diff)
Apply formatting rules
Diffstat (limited to 'Map/Business')
-rw-r--r--Map/Business/RenderableMap.swift18
-rw-r--r--Map/Business/SmartLabelPositioning/SmartLabelPositioning.swift7
-rw-r--r--Map/Business/Stage.swift11
3 files changed, 16 insertions, 20 deletions
diff --git a/Map/Business/RenderableMap.swift b/Map/Business/RenderableMap.swift
index 82acaff..eeddb8b 100644
--- a/Map/Business/RenderableMap.swift
+++ b/Map/Business/RenderableMap.swift
@@ -39,18 +39,19 @@ struct RenderableMap {
// Build a vertex lookup for edges, groups, etc.
var vertexMap: [String: Vertex] = [:]
-
+
for (index, component) in map.components.enumerated() {
let newVertex = Vertex(
id: index,
label: component.label,
- position: CGPoint(x: component.coordinates.xCoordinate, y: component.coordinates.yCoordinate),
+ position: CGPoint(
+ x: component.coordinates.xCoordinate, y: component.coordinates.yCoordinate),
shape: component.shape
)
vertices.append(newVertex)
vertexMap[component.label.lowercased()] = newVertex
}
-
+
for (index, note) in map.notes.enumerated() {
notes.append(
Note(
@@ -70,8 +71,7 @@ struct RenderableMap {
// Second pass for entities that depend on vertices
for (index, dependency) in map.dependencies.enumerated() {
if let fromVertex = vertexMap[dependency.fromComponent.lowercased()],
- let toVertex = vertexMap[dependency.toComponent.lowercased()]
- {
+ let toVertex = vertexMap[dependency.toComponent.lowercased()] {
edges.append(
MapEdge(
id: index,
@@ -81,7 +81,7 @@ struct RenderableMap {
))
}
}
-
+
for (index, inertia) in map.inertias.enumerated() {
if let vertex = vertexMap[inertia.component.lowercased()] {
inertias.append(
@@ -91,7 +91,7 @@ struct RenderableMap {
))
}
}
-
+
for (index, evolution) in map.evolutions.enumerated() {
if let vertex = vertexMap[evolution.component.lowercased()] {
let destination = CGPoint(
@@ -106,7 +106,7 @@ struct RenderableMap {
))
}
}
-
+
for group in map.groups {
var groupVertices: [Vertex] = []
for componentName in group.components {
@@ -174,5 +174,5 @@ struct Opportunity {
private let defaultDimensions: [Double] = [
25.0,
50.0,
- 75.0,
+ 75.0
]
diff --git a/Map/Business/SmartLabelPositioning/SmartLabelPositioning.swift b/Map/Business/SmartLabelPositioning/SmartLabelPositioning.swift
index f765108..edf22e3 100644
--- a/Map/Business/SmartLabelPositioning/SmartLabelPositioning.swift
+++ b/Map/Business/SmartLabelPositioning/SmartLabelPositioning.swift
@@ -59,8 +59,7 @@ struct SmartLabelPositioning {
let defaultRect = CGRect(origin: defaultPosition, size: actualLabelSize)
if countCollisions(labelRect: defaultRect, lines: allLines) == 0
- && countNoteCollisions(labelRect: defaultRect, noteRects: noteRects) == 0
- {
+ && countNoteCollisions(labelRect: defaultRect, noteRects: noteRects) == 0 {
return defaultPosition
}
@@ -204,7 +203,7 @@ struct SmartLabelPositioning {
CGPoint(
x: vertexPixelPos.x - labelSize.width - padding,
y: vertexPixelPos.y + vertexSize.height + padding
- ),
+ )
]
}
@@ -301,7 +300,7 @@ struct SmartLabelPositioning {
Line(start: CGPoint(x: rect.minX, y: rect.minY), end: CGPoint(x: rect.maxX, y: rect.minY)),
Line(start: CGPoint(x: rect.maxX, y: rect.minY), end: CGPoint(x: rect.maxX, y: rect.maxY)),
Line(start: CGPoint(x: rect.maxX, y: rect.maxY), end: CGPoint(x: rect.minX, y: rect.maxY)),
- Line(start: CGPoint(x: rect.minX, y: rect.maxY), end: CGPoint(x: rect.minX, y: rect.minY)),
+ Line(start: CGPoint(x: rect.minX, y: rect.maxY), end: CGPoint(x: rect.minX, y: rect.minY))
]
for rectLine in rectLines {
diff --git a/Map/Business/Stage.swift b/Map/Business/Stage.swift
index ebee17f..4962f8f 100644
--- a/Map/Business/Stage.swift
+++ b/Map/Business/Stage.swift
@@ -153,8 +153,7 @@ struct Stage: Codable {
if let customStagesData = UserDefaults.standard.data(forKey: "customStages"),
let customStagesList = try? JSONDecoder().decode(
[CustomStage].self, from: customStagesData),
- let customStage = customStagesList.first(where: { $0.id == uuid })
- {
+ let customStage = customStagesList.first(where: { $0.id == uuid }) {
return customStage.stage
}
return stages(.behavior) // fallback
@@ -207,8 +206,7 @@ struct Stage: Codable {
if let customStagesData = UserDefaults.standard.data(forKey: "customStages"),
let customStagesList = try? JSONDecoder().decode(
[CustomStage].self, from: customStagesData),
- let customStage = customStagesList.first(where: { $0.id == uuid })
- {
+ let customStage = customStagesList.first(where: { $0.id == uuid }) {
return customStage.name
}
return String(localized: "stage_type.behavior") // fallback
@@ -273,13 +271,12 @@ enum StageType: Identifiable, Equatable {
static let properties: [StageType] = [
.market, .knowledgeManagement, .marketPerception, .userPerception,
.perceptionInIndustry, .focusOfValue, .understanding, .comparison, .failure,
- .marketAction, .efficiency, .decisionDrivers,
+ .marketAction, .efficiency, .decisionDrivers
]
static var customStages: [StageType] {
if let customStagesData = UserDefaults.standard.data(forKey: "customStages"),
- let customStagesList = try? JSONDecoder().decode([CustomStage].self, from: customStagesData)
- {
+ let customStagesList = try? JSONDecoder().decode([CustomStage].self, from: customStagesData) {
return customStagesList.map { .custom($0.id) }
}
return []