Mercurial > public > stock-charts
changeset 18:136de51a74f2
Change struct to public
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Wed, 28 Apr 2021 20:05:00 +0200 |
parents | c0c129bdf65d |
children | 647d3a64ca3f |
files | Sources/InteractiveCharts/LineChart/Helpers/IndicatorPoint.swift Sources/InteractiveCharts/LineChart/Helpers/LinePath.swift Sources/InteractiveCharts/LineChart/Helpers/LineView.swift SwiftUI-InteractiveCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate SwiftUI-InteractiveCharts.xcodeproj/xcuserdata/dennis.xcuserdatad/xcschemes/xcschememanagement.plist |
diffstat | 5 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/Sources/InteractiveCharts/LineChart/Helpers/IndicatorPoint.swift Wed Apr 28 19:54:52 2021 +0200 +++ b/Sources/InteractiveCharts/LineChart/Helpers/IndicatorPoint.swift Wed Apr 28 20:05:00 2021 +0200 @@ -7,8 +7,8 @@ import SwiftUI -struct IndicatorPoint: View { - var body: some View { +public struct IndicatorPoint: View { + public var body: some View { Circle() .frame(width: 20, height: 20) .foregroundColor(Color(.systemBlue))
--- a/Sources/InteractiveCharts/LineChart/Helpers/LinePath.swift Wed Apr 28 19:54:52 2021 +0200 +++ b/Sources/InteractiveCharts/LineChart/Helpers/LinePath.swift Wed Apr 28 20:05:00 2021 +0200 @@ -7,12 +7,12 @@ import SwiftUI -struct LinePath: Shape { +public struct LinePath: Shape { var data: [Double] var (width, height): (CGFloat, CGFloat) @Binding var pathPoints: [CGPoint] - func path(in rect: CGRect) -> Path { + public func path(in rect: CGRect) -> Path { var path = Path() let normalizedData = normalize(data) @@ -38,7 +38,7 @@ /* Get data -> normalize it -> 0 <= output <= 1 */ - func normalize(_ data: [Double]) -> [Double] { + public func normalize(_ data: [Double]) -> [Double] { var normalData = [Double]() let min = data.min()! let max = data.max()!
--- a/Sources/InteractiveCharts/LineChart/Helpers/LineView.swift Wed Apr 28 19:54:52 2021 +0200 +++ b/Sources/InteractiveCharts/LineChart/Helpers/LineView.swift Wed Apr 28 20:05:00 2021 +0200 @@ -7,7 +7,7 @@ import SwiftUI -struct LineView: View { +public struct LineView: View { var data: [Double] var dates: [String]? var hours: [String]? @@ -17,7 +17,7 @@ @State private var IndicatorPointPosition: CGPoint = .zero @State private var pathPoints = [CGPoint]() - var body: some View { + public var body: some View { ZStack { GeometryReader { proxy in LinePath(data: data, width: proxy.size.width, height: proxy.size.height, pathPoints: $pathPoints)
Binary file SwiftUI-InteractiveCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed
--- a/SwiftUI-InteractiveCharts.xcodeproj/xcuserdata/dennis.xcuserdatad/xcschemes/xcschememanagement.plist Wed Apr 28 19:54:52 2021 +0200 +++ b/SwiftUI-InteractiveCharts.xcodeproj/xcuserdata/dennis.xcuserdatad/xcschemes/xcschememanagement.plist Wed Apr 28 20:05:00 2021 +0200 @@ -9,6 +9,11 @@ <key>orderHint</key> <integer>0</integer> </dict> + <key>SwiftUI-InteractiveCharts.xcscheme_^#shared#^_</key> + <dict> + <key>orderHint</key> + <integer>0</integer> + </dict> </dict> </dict> </plist>