Skip to content

Commit

Permalink
Add macOS target
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovic Landry committed Oct 9, 2019
1 parent 6db6d50 commit 140ffe2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
Binary file added Docs/demo-app-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Example/SunburstDiagram/SunburstDiagramDemo.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
8 changes: 8 additions & 0 deletions Example/SunburstDiagramDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
430D471022AF77B600A7FA6E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
430D471222AF77B600A7FA6E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
437F415822C866650092B76E /* SwiftSunburstDiagram */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SwiftSunburstDiagram; path = ..; sourceTree = "<group>"; };
438EC2F4232DE3D00073A47C /* SunburstDiagramDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SunburstDiagramDemo.entitlements; sourceTree = "<group>"; };
82A57BA622B873190044FF2B /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
82C7F13B22B9C5EE008B461C /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };
82C7F13D22B9CE95008B461C /* SettingsNodesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsNodesView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -78,6 +79,7 @@
430D470A22AF77B600A7FA6E /* Assets.xcassets */,
430D470F22AF77B600A7FA6E /* LaunchScreen.storyboard */,
430D471222AF77B600A7FA6E /* Info.plist */,
438EC2F4232DE3D00073A47C /* SunburstDiagramDemo.entitlements */,
430D470C22AF77B600A7FA6E /* Preview Content */,
);
path = SunburstDiagram;
Expand Down Expand Up @@ -315,7 +317,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = SunburstDiagram/SunburstDiagramDemo.entitlements;
CODE_SIGN_STYLE = Automatic;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_ASSET_PATHS = "SunburstDiagram/Preview\\ Content";
DEVELOPMENT_TEAM = D6826XDERA;
ENABLE_PREVIEWS = YES;
Expand All @@ -326,6 +330,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ludo.SunburstDiagramDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -335,7 +340,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = SunburstDiagram/SunburstDiagramDemo.entitlements;
CODE_SIGN_STYLE = Automatic;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_ASSET_PATHS = "SunburstDiagram/Preview\\ Content";
DEVELOPMENT_TEAM = D6826XDERA;
ENABLE_PREVIEWS = YES;
Expand All @@ -346,6 +353,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ludo.SunburstDiagramDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sunburst diagram is a library written with SwiftUI to easily render diagrams giv

<img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/diagram-icons-only.png" alt="diagram with icons only" width="400"/> <img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/diagram-with-text.png" alt="diagram with icons and text" width="400"/>

**⚠️ WARNING ⚠️** This is an early version of this library that requires Swift 5.1 and Xcode 11 that are currently still in beta, some features available in the public API have not been implemented yet (see below).
This library requires Swift 5.1 and Xcode 11, some features available in the public API have not been implemented yet (see below).


## Requirements
Expand Down Expand Up @@ -88,7 +88,9 @@ If you **found a bug** or want to discuss a new **feature** do not hesitate to m

The demo app in this repo is also written with SwiftUI and allows to experience the API of this library in a grapical and reactive way.

<img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-1.png" alt="demo app first screenshot" width="260"/> <img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-2.png" alt="demo app second screenshot" width="260"/> <img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-3.png" alt="demo app third screenshot" width="260"/>
<img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-1.png" alt="iOS demo app first screenshot" width="260"/> <img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-2.png" alt="iOS demo app second screenshot" width="260"/> <img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-3.png" alt="iOS demo app third screenshot" width="260"/>

<img src="https://github.com/lludo/SwiftSunburstDiagram/blob/master/Docs/demo-app-mac.png" alt="macOS demo app screenshot" width="788"/>

## Todo

Expand Down
14 changes: 5 additions & 9 deletions Tests/SunburstDiagramTests/SunburstDiagramTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ import XCTest
@testable import SunburstDiagram

final class SunburstDiagramTests: XCTestCase {
func testExample() {
// This is an example of a functional test case. Use XCTAssert
// and related functions to verify your tests produce the correct results.
let arc = Sunburst.Arc(text: "Label", width: .pi, backgroundColor: .systemGray)
XCTAssertEqual(arc.text, "Label")

func testSunburstArcHasTextHidden() {
let node = Node(name: "Node", showName: true)
let arc = Sunburst.Arc(node: node, level: 0, totalValue: .pi)
XCTAssertEqual(arc.isTextHidden, !node.showName)
}

static var allTests = [
("testExample", testExample),
]
}

0 comments on commit 140ffe2

Please sign in to comment.