All Projects → lludo → Swiftsunburstdiagram

lludo / Swiftsunburstdiagram

Licence: mit
SwiftUI library to easily render diagrams given a tree of objects. Similar to ring chart, sunburst chart, multilevel pie chart.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftsunburstdiagram

Flowy Vue
Vue Flowy makes creating flowchart or hierarchy chart functionality an easy task. Build automation software, mind mapping tools, organisation charts, or simple programming platforms in minutes by implementing the library into your project.
Stars: ✭ 107 (-73.25%)
Mutual labels:  diagram, chart
Vue Chartjs
📊 Vue.js wrapper for Chart.js
Stars: ✭ 4,554 (+1038.5%)
Mutual labels:  diagram, chart
Gojs
JavaScript diagramming library for interactive flowcharts, org charts, design tools, planning tools, visual languages.
Stars: ✭ 5,739 (+1334.75%)
Mutual labels:  diagram, chart
X6
🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
Stars: ✭ 2,686 (+571.5%)
Mutual labels:  diagram, chart
Mermaid
Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
Stars: ✭ 27 (-93.25%)
Mutual labels:  chart, diagram
javascript
Basic Primitives Diagrams for JavaScript - data visualization components library that implements organizational chart and multi-parent dependency diagrams, contains implementations of JavaScript Controls and PDF rendering plugins.
Stars: ✭ 46 (-88.5%)
Mutual labels:  chart, diagram
AMVennDiagramView
AMVennDiagramView is a view can display the diagram like Venn diagram.
Stars: ✭ 39 (-90.25%)
Mutual labels:  chart, diagram
OrgChart
Organization chart layout library
Stars: ✭ 16 (-96%)
Mutual labels:  chart, diagram
Jeddict
Jakarta EE 8 (Java EE) & MicroProfile 3.2 application generator and modeler
Stars: ✭ 358 (-10.5%)
Mutual labels:  diagram
Helm
The Kubernetes Package Manager
Stars: ✭ 20,846 (+5111.5%)
Mutual labels:  chart
Vue Tree Chart
A vue2 component to display tree chart
Stars: ✭ 351 (-12.25%)
Mutual labels:  chart
G2 React
This repo is being deprecated, check Ant Design Charts https://github.com/ant-design/ant-design-charts
Stars: ✭ 360 (-10%)
Mutual labels:  chart
Heimer
Heimer is a simple cross-platform mind map, diagram, and note-taking tool written in Qt.
Stars: ✭ 380 (-5%)
Mutual labels:  diagram
Goplantuml
PlantUML Class Diagram Generator for golang projects
Stars: ✭ 352 (-12%)
Mutual labels:  diagram
Bluetoothconnector
Simple macOS CLI to connect/disconnect a Bluetooth device. Useful for AirPods or other Bluetooth headphones.
Stars: ✭ 388 (-3%)
Mutual labels:  swift-package-manager
Reports kit
Beautiful, interactive charts and tables for Ruby on Rails
Stars: ✭ 349 (-12.75%)
Mutual labels:  chart
Jetuml
A desktop application for fast UML diagramming.
Stars: ✭ 346 (-13.5%)
Mutual labels:  diagram
Hycharts
柱状图、折/曲线图、K线图(主图、交易量图、辅助图), 图与图可以自由组合, 支持分页加载数据 -----> 低内存、低耗电、滑动缩放顺滑
Stars: ✭ 394 (-1.5%)
Mutual labels:  chart
Gaphor
Gaphor is the simple modeling tool
Stars: ✭ 386 (-3.5%)
Mutual labels:  diagram
Markdeep
Official public Markdeep source archive
Stars: ✭ 373 (-6.75%)
Mutual labels:  diagram

Swift Sunburst Diagram

Swift Version License Swift Package Manager compatible CocoaPods Compatible

Sunburst diagram is a library written with SwiftUI to easily render diagrams given a tree of objects. Similar to ring chart, sunburst chart, multilevel pie chart.

diagram with icons only diagram with icons and text

This library requires Swift 5.1 and Xcode 11, some features available in the public API have not been implemented yet (see below).

Requirements

  • iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+
  • Xcode 11+
  • Swift 5.1+

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is now integrated in Xcode 11.

Once you have your Swift package set up, adding SunburstDiagram as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/lludo/SwiftSunburstDiagram.git")
]

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Alamofire into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SunburstDiagram', '~> 1.1.0'

Manually

If you prefer not to use the Swift Package Manager, you can integrate SunburstDiagram into your project manually.

Features

  • [x] Configure with a tree of node objects
  • [x] Nodes have an optional label displayed (image & text)
  • [x] Reactive UI with animated updates
  • [x] Optionally configure nodes with a value (4 different rendering modes)
  • [x] Infinite number of layers (circles) support
  • [x] Option to configure margin, size, sort and initial positions of arcs
  • [x] Option to collapse arcs beyond a certain layer (to show more layers with less data)
  • [x] Ability to select a node and focus on a node to see more details or disable selection
  • [x] Option for maximum number of rings to display (like a window moving as you focus on nodes)

Usage

// Create your configuration model
let configuration = SunburstConfiguration(nodes: [
    Node(name: "Walking", value: 10.0, backgroundColor: .systemBlue),
    Node(name: "Restaurant", value: 30.0, backgroundColor: .systemRed, children: [
        Node(name: "Dessert", image: UIImage(named: "croissant"), value: 6.0),
        Node(name: "Dinner", image: UIImage(named: "poultry"), value: 10.0),
    ]),
    Node(name: "Transport", value: 10.0, backgroundColor: .systemPurple),
    Node(name: "Home", value: 50.0, backgroundColor: .systemTeal),
])

// Get the view controller for the SunburstView
let viewController = UIHostingController(rootView: SunburstView(configuration: configuration))

Communication

If you found a bug or want to discuss a new feature do not hesitate to message me. If you want to contribute, all pull requests are always welcome. Thank you!

Showcase App

The showcase app in this repo is also written with SwiftUI and allows to experience the API of this library in a grapical and reactive way. It is also available on the App Store for free.

iOS demo app first screenshot iOS demo app second screenshot iOS demo app third screenshot

macOS demo app screenshot

Todo

  • [ ] Implement option for min arc percentage (if less, show data in grouped in "other")
  • [ ] Compute arc colors if not provided by nodes
  • [ ] Add option to show un-assigned if total of arcs is less than 100%
  • [ ] Add rounded corners option for arcs with margins?

Inspirations

This project has been inspired by the DaisyDisk UI and the Apple SwiftUI Building Custom Views with SwiftUI WWDC2019 session.

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