All Projects → VRGsoftUA → SMDiagramView

VRGsoftUA / SMDiagramView

Licence: Apache-2.0 license
Diagram View for iOS

Programming Languages

objective c
16641 projects - #2 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to SMDiagramView

TabBar
📱 TabBar – highly customizable tab bar for your SwiftUI application.
Stars: ✭ 105 (+138.64%)
Mutual labels:  view
google streetview
A command line tool and module for Google Street View Image API
Stars: ✭ 77 (+75%)
Mutual labels:  view
ChatVoicePlayer
An Android library to make the implementation of voice/audio messages' playing easier
Stars: ✭ 157 (+256.82%)
Mutual labels:  view
MyCircleMenu
Android-自定义view之圆形与“半圆形”菜单
Stars: ✭ 33 (-25%)
Mutual labels:  view
RMGradientView
A Custom Gradient View Control for iOS with inspectable properties.
Stars: ✭ 24 (-45.45%)
Mutual labels:  view
XRadarView
A highly customizable radar view for Android
Stars: ✭ 106 (+140.91%)
Mutual labels:  view
wapiml
An OpenAPI round-trip tool that leverages model-driven techniques to create, visualize, manage, and generate OpenAPI definitions.
Stars: ✭ 61 (+38.64%)
Mutual labels:  diagram
view
Yii view rendering library
Stars: ✭ 42 (-4.55%)
Mutual labels:  view
Coroutines-Animations
Use the power of kotlin coroutines to execute your android animations
Stars: ✭ 31 (-29.55%)
Mutual labels:  view
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (-36.36%)
Mutual labels:  diagram
LuckPan
幸运转盘,可以控制选中指定的奖项。
Stars: ✭ 15 (-65.91%)
Mutual labels:  view
rover
Interactive Terraform visualization. State and configuration explorer.
Stars: ✭ 2,039 (+4534.09%)
Mutual labels:  diagram
pine-script-mode
GNU Emacs Major mode for Trading View pine script
Stars: ✭ 18 (-59.09%)
Mutual labels:  view
LockerScreen
Android lock screen,slide to unlock ! 安卓锁屏,上滑解锁,效果酷炫,值得拥有!
Stars: ✭ 81 (+84.09%)
Mutual labels:  view
LPThumbnailView
A thumbnail view for iOS to give context to multiple images/videos using thumbnails and counter.
Stars: ✭ 54 (+22.73%)
Mutual labels:  view
CheckableTextView
A simple and flexible Checked TextView or Checkable TextView
Stars: ✭ 108 (+145.45%)
Mutual labels:  view
visioStencils
My 2,700 visio 🎨 shapes, stencils, symbols, and icons collection to visually represent IT infrastructure
Stars: ✭ 43 (-2.27%)
Mutual labels:  diagram
yii2-presenter
Yii2 View Presenter
Stars: ✭ 13 (-70.45%)
Mutual labels:  view
simple-analog-clock
Simple clock view for displaying uh...time?
Stars: ✭ 24 (-45.45%)
Mutual labels:  view
GoJS-projects
Project examples for GoJS
Stars: ✭ 45 (+2.27%)
Mutual labels:  diagram

SMDiagramViewSwift

Meet 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.

CocoaControls

Images

Requirements

  • Xcode 9
  • iOS 9.x+
  • Swift 4

Be sure to read all instructions carefully.

Installing with CocoaPods

use_frameworks! 

pod 'SMDiagramViewSwift', '~> 1.0'

Usage

Add a UIView instance in your .storyboard or .xib, set SMDiagramView class, connect IBOutlet and add DataSource

import SMDiagramViewSwift

class ViewController: UIViewController, SMDiagramViewDataSource {
    
    let dataSource = [1, 2, 3, 4, 5]
    
    @IBOutlet weak var diagramView: SMDiagramView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        diagramView.dataSource = self
    }
}

Setup SMDiagramView if need

    override func viewDidLoad() {
        super.viewDidLoad()
        
        diagramView.dataSource = self
        diagramView.minProportion = 0.1
        diagramView.diagramViewMode = .arc // or .segment
        diagramView.diagramOffset = .zero
        diagramView.radiusOfSegments = 80.0
        diagramView.radiusOfViews = 130.0
        diagramView.arcWidth = 6.0 //Ignoring for SMDiagramViewMode.segment
        diagramView.startAngle = -.pi/2
        diagramView.endAngle = 2.0 * .pi - .pi/2.0
        diagramView.colorOfSegments = .black
        diagramView.viewsOffset = .zero
        diagramView.separatorWidh = 1.0
        public var separatorColor = .white
}

DataSource functions

    //Required
    func numberOfSegmentsIn(diagramView: SMDiagramView) -> Int {
        return dataSource.count
    }
    
    //Optional
    func diagramView(_ diagramView: SMDiagramView, proportionForSegmentAtIndex index: NSInteger) -> CGFloat {
        return CGFloat(1/dataSource.count)
    }
    func diagramView(_ diagramView: SMDiagramView, colorForSegmentAtIndex index: NSInteger, angle: CGFloat) -> UIColor? {
        return .black
    }
    func diagramView(_ diagramView: SMDiagramView, viewForSegmentAtIndex index: NSInteger, colorOfSegment color:UIColor?, angle: CGFloat) -> UIView? {
        return UIView()
    }
    func diagramView(_ diagramView: SMDiagramView, offsetForView view: UIView?, atIndex index: NSInteger, angle: CGFloat) -> CGPoint {
        return .zero
    }
    func diagramView(_ diagramView: SMDiagramView, radiusForView view: UIView?, atIndex index: NSInteger, radiusOfSegment radius: CGFloat, angle: CGFloat) -> CGFloat {
        return 130.0
    }
    func diagramView(_ diagramView: SMDiagramView, radiusForSegmentAtIndex index: NSInteger, proportion: CGFloat, angle: CGFloat) -> CGFloat {
        return 80.0
    }
    func diagramView(_ diagramView: SMDiagramView, lineWidthForSegmentAtIndex index: NSInteger, angle: CGFloat) -> CGFloat {
        //not called for SMDiagramViewModeSegment
        return 6.0
    }

Compatibility

  • IOS 9-11

Changelog

Version: 1.0

  • Initial Build

Contributors

  • Contributors and stars are welcome.

License

Copyright 2017 VRG Soft

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].