@@ -33,6 +33,12 @@ public enum ACAxisMode: Equatable {
3333 case vertical
3434}
3535
36+ /// Defines the label type of level label below the grid view.
37+ public enum ACLevelLavel : Equatable {
38+ case moreOrLess
39+ case number
40+ }
41+
3642/// Settings that define the contribution view.
3743public struct ACConstant : Equatable {
3844
@@ -57,6 +63,9 @@ public struct ACConstant: Equatable {
5763 /// Whether the level label below the grid view is visible
5864 public var showLevelView : Bool
5965
66+ /// The label type of the level label.
67+ public var levelLabel : ACLevelLavel
68+
6069 /// Initializes `ACConstant`
6170 /// - Parameters:
6271 /// - fromDate: The start date to display the list of contributions. The default value is `1 year from today.`.
@@ -66,20 +75,23 @@ public struct ACConstant: Equatable {
6675 /// - axisMode: The axis mode of the component. The default value is `.horizontal`.
6776 /// - font: The font used for text. The default value is `.system(size: 9)`.
6877 /// - showLevelView: Whether the level label below the grid view is visible. The default value is `true`.
78+ /// - levelLabel: The label type of the level label. The default value is `.moreOrLess`.
6979 public init ( from fromDate: Date ? = nil ,
7080 to toDate: Date ? = nil ,
7181 spacing: CGFloat = 4 ,
7282 levelSpacing: Int = 3 ,
7383 axisMode: ACAxisMode = . horizontal,
7484 font: Font = . system( size: 9 ) ,
75- showLevelView: Bool = true ) {
85+ showLevelView: Bool = true ,
86+ levelLabel: ACLevelLavel = . moreOrLess) {
7687 self . fromDate = fromDate == nil ? Date ( ) . dateYearAgo : fromDate!
7788 self . toDate = toDate == nil ? Date ( ) : toDate!
7889 self . spacing = spacing
7990 self . levelSpacing = levelSpacing
8091 self . axisMode = axisMode
8192 self . font = font
8293 self . showLevelView = showLevelView
94+ self . levelLabel = levelLabel
8395 }
8496
8597 public static func == ( lhs: Self , rhs: Self ) -> Bool {
0 commit comments