2
2
public struct GraphContentBuilder < NodeID: Hashable > {
3
3
4
4
public typealias Content = GraphContent < NodeID >
5
+
5
6
@inlinable
6
7
public static func buildPartialBlock< T: GraphContent > ( first content: T ) -> T
7
8
where T. NodeID == NodeID {
@@ -18,44 +19,6 @@ public struct GraphContentBuilder<NodeID: Hashable> {
18
19
return _EmptyGraphContent ( )
19
20
}
20
21
21
- /// Creates a list of graph contents from a for-loop.
22
- ///
23
- /// **Known issue**:
24
- /// Type inference fails when the nested element is decorated with a modifier.
25
- ///
26
- /// **Workaround**:
27
- /// - Use `ForEach` like in SwiftUI. This is the recommended way.
28
- /// - Or create a you nested component comforming to `GraphComponent`,
29
- /// and use this in your loop body, like the example below
30
- ///
31
- /// example:
32
- /// ```swift
33
- /// struct MyComponent: GraphComponent {
34
- /// let i: Int
35
- /// init(_ i: Int) {
36
- /// self.i = i
37
- /// }
38
- /// var body: some GraphContent<Int> {
39
- /// NodeMark(id: i)
40
- /// .opacity(0.4)
41
- /// }
42
- /// }
43
- /// ```
44
- /// Then use your component like this:
45
- /// ```swift
46
- /// let myGraph = buildGraph {
47
- /// for i in 0..<10 {
48
- /// MyComponent(i)
49
- /// }
50
- /// }
51
- @available ( * , deprecated, message: " Use `Series` instead. " )
52
- @inlinable
53
- public static func buildArray< T> ( _ components: [ T ] ) -> some Content
54
- where T: Content , T. NodeID == NodeID {
55
- return _ArrayGraphContent ( components)
56
- }
57
-
58
- // Opaque breaks type inference?
59
22
@inlinable
60
23
public static func buildEither< T1, T2> ( first component: T1 ) -> _ConditionalGraphContent < T1 , T2 >
61
24
where T1: Content , T1. NodeID == NodeID , T2: Content , T2. NodeID == NodeID {
@@ -68,12 +31,6 @@ public struct GraphContentBuilder<NodeID: Hashable> {
68
31
return _ConditionalGraphContent < T1 , T2 > ( . falseContent( component) )
69
32
}
70
33
71
- @inlinable
72
- public static func buildLimitedAvailability< T> ( _ component: T ? ) -> some Content
73
- where T: Content , T. NodeID == NodeID {
74
- return _OptionalGraphContent ( component)
75
- }
76
-
77
34
@inlinable
78
35
public static func buildIf< T> ( _ component: T ? ) -> some Content
79
36
where T: Content , T. NodeID == NodeID {
0 commit comments