{"id":13751312,"url":"https://github.com/lludo/SwiftSunburstDiagram","last_synced_at":"2025-05-09T18:31:15.860Z","repository":{"id":45389142,"uuid":"191486149","full_name":"lludo/SwiftSunburstDiagram","owner":"lludo","description":"SwiftUI library to easily render diagrams given a tree of objects. Similar to ring chart, sunburst chart, multilevel pie chart.","archived":false,"fork":false,"pushed_at":"2020-06-24T23:01:01.000Z","size":3258,"stargazers_count":524,"open_issues_count":12,"forks_count":49,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-06-03T18:14:49.141Z","etag":null,"topics":["chart","diagram","ios","macos","swift","swift-5-1","swift-library","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lludo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-12T02:54:28.000Z","updated_at":"2024-05-28T07:35:09.000Z","dependencies_parsed_at":"2022-07-13T23:00:27.647Z","dependency_job_id":null,"html_url":"https://github.com/lludo/SwiftSunburstDiagram","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lludo%2FSwiftSunburstDiagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lludo%2FSwiftSunburstDiagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lludo%2FSwiftSunburstDiagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lludo%2FSwiftSunburstDiagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lludo","download_url":"https://codeload.github.com/lludo/SwiftSunburstDiagram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224876985,"owners_count":17384699,"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":["chart","diagram","ios","macos","swift","swift-5-1","swift-library","swift-package-manager","swiftui"],"created_at":"2024-08-03T09:00:41.971Z","updated_at":"2024-11-16T04:30:46.278Z","avatar_url":"https://github.com/lludo.png","language":"Swift","funding_links":[],"categories":["Chart","🛠 Examples","UI","🌎 by the community"],"sub_categories":["Content","Libraries","Chart"],"readme":"# Swift Sunburst Diagram\n\n[![Swift Version](https://img.shields.io/badge/Swift-5.1-orange.svg)](https://swift.org/blog/5-1-release-process/)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-✔-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SunburstDiagram.svg)](https://img.shields.io/cocoapods/v/SunburstDiagram.svg)\n\nSunburst 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.\n\n\u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/diagram-icons-only.png\" alt=\"diagram with icons only\" width=\"400\"/\u003e \u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/diagram-with-text.png\" alt=\"diagram with icons and text\" width=\"400\"/\u003e\n\nThis library requires Swift 5.1 and Xcode 11, some features available in the public API have not been implemented yet (see below).\n\n\n## Requirements\n\n- iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+\n- Xcode 11+\n- Swift 5.1+\n\n\n## Installation\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/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.\n\nOnce 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`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/lludo/SwiftSunburstDiagram.git\")\n]\n```\n\n\n### Cocoapods\n\n[CocoaPods](https://cocoapods.org) 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`:\n\n```ruby\npod 'SunburstDiagram', '~\u003e 1.1.0'\n```\n\n\n### Manually\n\nIf you prefer not to use the Swift Package Manager, you can integrate SunburstDiagram into your project manually.\n\n\n## Features\n\n- [x] Configure with a tree of node objects\n- [x] Nodes have an optional label displayed (image \u0026 text)\n- [x] Reactive UI with animated updates\n- [x] Optionally configure nodes with a value (4 different rendering modes)\n- [x] Infinite number of layers (circles) support\n- [x] Option to configure margin, size, sort and initial positions of arcs\n- [x] Option to collapse arcs beyond a certain layer (to show more layers with less data)\n- [x] Ability to select a node and focus on a node to see more details or disable selection\n- [x] Option for maximum number of rings to display (like a window moving as you focus on nodes)\n\n## Usage\n\n```swift\n// Create your configuration model\nlet configuration = SunburstConfiguration(nodes: [\n    Node(name: \"Walking\", value: 10.0, backgroundColor: .systemBlue),\n    Node(name: \"Restaurant\", value: 30.0, backgroundColor: .systemRed, children: [\n        Node(name: \"Dessert\", image: UIImage(named: \"croissant\"), value: 6.0),\n        Node(name: \"Dinner\", image: UIImage(named: \"poultry\"), value: 10.0),\n    ]),\n    Node(name: \"Transport\", value: 10.0, backgroundColor: .systemPurple),\n    Node(name: \"Home\", value: 50.0, backgroundColor: .systemTeal),\n])\n\n// Get the view controller for the SunburstView\nlet viewController = UIHostingController(rootView: SunburstView(configuration: configuration))\n```\n\n\n## Communication\n\nIf 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!\n\n\n## Showcase App\n\nThe 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](https://apps.apple.com/us/app/id1468995506) for free.\n\n\u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-1.png\" alt=\"iOS demo app first screenshot\" width=\"260\"/\u003e  \u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-2.png\" alt=\"iOS demo app second screenshot\" width=\"260\"/\u003e  \u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-3.png\" alt=\"iOS demo app third screenshot\" width=\"260\"/\u003e\n\n\u003cimg src=\"https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-mac.png\" alt=\"macOS demo app screenshot\" width=\"788\"/\u003e\n\n## Todo\n\n- [ ] Implement option for min arc percentage (if less, show data in grouped in \"other\")\n- [ ] Compute arc colors if not provided by nodes\n- [ ] Add option to show un-assigned if total of arcs is less than 100%\n- [ ] Add rounded corners option for arcs with margins?\n\n\n## Inspirations\n\nThis project has been inspired by the [DaisyDisk](https://daisydiskapp.com/) UI and the Apple SwiftUI [Building Custom Views with SwiftUI](https://developer.apple.com/videos/play/wwdc2019/237/) WWDC2019 session.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flludo%2FSwiftSunburstDiagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flludo%2FSwiftSunburstDiagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flludo%2FSwiftSunburstDiagram/lists"}