{"id":861,"url":"https://github.com/VRGsoftUA/SMDiagramView","last_synced_at":"2025-07-30T19:32:51.655Z","repository":{"id":56921914,"uuid":"113292021","full_name":"VRGsoftUA/SMDiagramView","owner":"VRGsoftUA","description":"Diagram View for iOS","archived":false,"fork":false,"pushed_at":"2019-05-08T12:48:38.000Z","size":1854,"stargazers_count":45,"open_issues_count":4,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-01T10:22:06.606Z","etag":null,"topics":["diagram","ios","swift","view"],"latest_commit_sha":null,"homepage":"http://vrgsoft.net/","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VRGsoftUA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-06T08:52:38.000Z","updated_at":"2024-04-19T06:06:01.000Z","dependencies_parsed_at":"2022-08-21T04:50:17.512Z","dependency_job_id":null,"html_url":"https://github.com/VRGsoftUA/SMDiagramView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDiagramView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDiagramView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDiagramView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDiagramView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VRGsoftUA","download_url":"https://codeload.github.com/VRGsoftUA/SMDiagramView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178971,"owners_count":17881114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diagram","ios","swift","view"],"created_at":"2024-01-05T20:15:33.241Z","updated_at":"2024-12-04T19:32:14.062Z","avatar_url":"https://github.com/VRGsoftUA.png","language":"Objective-C","funding_links":[],"categories":["Charts"],"sub_categories":["Other free courses","Getting Started"],"readme":"# SMDiagramViewSwift\n\nMeet cute and very flexibility library for iOS application for different data view in one circle diagram. The opportunity of transformation of this sample make application interactive, colorful with wow-effect.\n\n### [CocoaControls](https://www.cocoacontrols.com/controls/smdiagramview)\n\n## Images\n\n![](demo.gif)\n![](demo.png)\n\n## Requirements\n\n- Xcode 9\n- iOS 9.x+\n- Swift 4\n\n## Be sure to read all instructions carefully.\n\n### Installing with [CocoaPods](https://cocoapods.org)\n\n```ruby\nuse_frameworks! \n\npod 'SMDiagramViewSwift', '~\u003e 1.0'\n```\n\n\n### Usage\n\nAdd a `UIView` instance in your .storyboard or .xib, set `SMDiagramView` class, connect `IBOutlet` and add `DataSource`\n\n```swift\nimport SMDiagramViewSwift\n\nclass ViewController: UIViewController, SMDiagramViewDataSource {\n    \n    let dataSource = [1, 2, 3, 4, 5]\n    \n    @IBOutlet weak var diagramView: SMDiagramView!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        diagramView.dataSource = self\n    }\n}\n```\n\nSetup `SMDiagramView` if need\n\n```swift\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        diagramView.dataSource = self\n        diagramView.minProportion = 0.1\n        diagramView.diagramViewMode = .arc // or .segment\n        diagramView.diagramOffset = .zero\n        diagramView.radiusOfSegments = 80.0\n        diagramView.radiusOfViews = 130.0\n        diagramView.arcWidth = 6.0 //Ignoring for SMDiagramViewMode.segment\n        diagramView.startAngle = -.pi/2\n        diagramView.endAngle = 2.0 * .pi - .pi/2.0\n        diagramView.colorOfSegments = .black\n        diagramView.viewsOffset = .zero\n        diagramView.separatorWidh = 1.0\n        public var separatorColor = .white\n}\n```\n\n`DataSource` functions\n\n```swift\n    //Required\n    func numberOfSegmentsIn(diagramView: SMDiagramView) -\u003e Int {\n        return dataSource.count\n    }\n    \n    //Optional\n    func diagramView(_ diagramView: SMDiagramView, proportionForSegmentAtIndex index: NSInteger) -\u003e CGFloat {\n        return CGFloat(1/dataSource.count)\n    }\n    func diagramView(_ diagramView: SMDiagramView, colorForSegmentAtIndex index: NSInteger, angle: CGFloat) -\u003e UIColor? {\n        return .black\n    }\n    func diagramView(_ diagramView: SMDiagramView, viewForSegmentAtIndex index: NSInteger, colorOfSegment color:UIColor?, angle: CGFloat) -\u003e UIView? {\n        return UIView()\n    }\n    func diagramView(_ diagramView: SMDiagramView, offsetForView view: UIView?, atIndex index: NSInteger, angle: CGFloat) -\u003e CGPoint {\n        return .zero\n    }\n    func diagramView(_ diagramView: SMDiagramView, radiusForView view: UIView?, atIndex index: NSInteger, radiusOfSegment radius: CGFloat, angle: CGFloat) -\u003e CGFloat {\n        return 130.0\n    }\n    func diagramView(_ diagramView: SMDiagramView, radiusForSegmentAtIndex index: NSInteger, proportion: CGFloat, angle: CGFloat) -\u003e CGFloat {\n        return 80.0\n    }\n    func diagramView(_ diagramView: SMDiagramView, lineWidthForSegmentAtIndex index: NSInteger, angle: CGFloat) -\u003e CGFloat {\n        //not called for SMDiagramViewModeSegment\n        return 6.0\n    }\n```\n\n\n## Compatibility\n  \n  * IOS 9-11\n  \n## Changelog\n\n### Version: 1.0\n\n  * Initial Build\n\n## Contributors\n\n  * Contributors and stars are welcome.\n\n## License\n\n    Copyright 2017 VRG Soft\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n    [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVRGsoftUA%2FSMDiagramView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVRGsoftUA%2FSMDiagramView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVRGsoftUA%2FSMDiagramView/lists"}