-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from SwiftGraphs/LinkStyles
Add `linkStyles()` API
- Loading branch information
Showing
10 changed files
with
116 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
Sources/Grape/Modifiers/Effects/GrapeEffect.PathShape.swift
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
Sources/Grape/Modifiers/Effects/GrapeEffect._LinkShape.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import SwiftUI | ||
extension GraphContentEffect { | ||
@usableFromInline | ||
internal struct _LinkShape { | ||
@usableFromInline | ||
let storage: any LinkShape | ||
|
||
@inlinable | ||
public init(_ path: some LinkShape) { | ||
self.storage = path | ||
} | ||
} | ||
} | ||
|
||
extension GraphContentEffect._LinkShape: GraphContentModifier { | ||
@inlinable | ||
public func _into<NodeID>( | ||
_ context: inout _GraphRenderingContext<NodeID> | ||
) where NodeID: Hashable { | ||
context.states.linkShape.append(storage) | ||
} | ||
|
||
@inlinable | ||
public func _exit<NodeID>(_ context: inout _GraphRenderingContext<NodeID>) | ||
where NodeID: Hashable { | ||
context.states.linkShape.removeLast() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.