{"id":23231196,"url":"https://github.com/maxhumber/sankey","last_synced_at":"2025-08-19T16:33:28.985Z","repository":{"id":63917745,"uuid":"490866912","full_name":"maxhumber/Sankey","owner":"maxhumber","description":"Sankey diagrams in SwiftUI, powered by Google Charts","archived":false,"fork":false,"pushed_at":"2024-11-28T21:20:03.000Z","size":7134,"stargazers_count":27,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-28T22:25:21.880Z","etag":null,"topics":["sankey","sankey-diagram","sankey-graph","swift","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxhumber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"maxhumber","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-05-10T21:33:34.000Z","updated_at":"2024-11-09T15:10:15.000Z","dependencies_parsed_at":"2024-08-12T15:42:01.498Z","dependency_job_id":null,"html_url":"https://github.com/maxhumber/Sankey","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.10526315789473684","last_synced_commit":"c4bda8b7cbbff747d2241b1f228226121fc81f82"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhumber%2FSankey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhumber%2FSankey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhumber%2FSankey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxhumber%2FSankey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxhumber","download_url":"https://codeload.github.com/maxhumber/Sankey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230363971,"owners_count":18214717,"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":["sankey","sankey-diagram","sankey-graph","swift","swiftui"],"created_at":"2024-12-19T02:13:32.684Z","updated_at":"2024-12-19T02:13:33.182Z","avatar_url":"https://github.com/maxhumber.png","language":"Swift","funding_links":["https://github.com/sponsors/maxhumber"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"Images/logo.png\" width=\"150px\" alt=\"logo\"/\u003e\n\n#### About\n\nSankey diagrams in SwiftUI, powered by [D3](https://github.com/d3/d3-sankey).\n\n#### Quickstart\n\nMake beautiful charts like this:\n\n\u003cimg src=\"Images/quick.png\" width=\"200px\" alt=\"quick\"/\u003e\n\nWith code as simple as this:\n\n```swift\nimport Sankey\nimport SwiftUI\n\nstruct QuickStartView: View {\n    let data = SankeyData(\n        nodes: [\n            SankeyNode(\"A\", color: .blue),\n            SankeyNode(\"B\", color: .purple),\n            SankeyNode(\"X\", color: .red),\n            SankeyNode(\"Y\", color: .yellow),\n            SankeyNode(\"Z\", color: .green),\n        ],\n        links: [\n            SankeyLink(5, from: \"A\", to: \"X\"),\n            SankeyLink(7, from: \"A\", to: \"Y\"),\n            SankeyLink(6, from: \"A\", to: \"Z\"),\n            SankeyLink(2, from: \"B\", to: \"X\"),\n            SankeyLink(9, from: \"B\", to: \"Y\"),\n            SankeyLink(4, from: \"B\", to: \"Z\"),\n        ]\n    )\n    \n    var body: some View {\n        SankeyDiagram(data)\n            .nodeOpacity(0.9)\n            .linkColorMode(.gradient)\n            .padding(10)\n            .frame(height: 350)\n    }\n}\n\n#Preview {\n    QuickstartView()\n}\n```\n\n#### Installation\n\nAdd `Sankey` to your project using Swift Package Manager:\n\n1. In Xcode, select your project in the Project Navigator\n2. Navigate to Package Dependencies\n3. Click the + button\n4. Enter the repository URL: `https://github.com/maxhumber/Sankey`\n\n#### Usage\n\nCustomize `SankeyDiagram` with simple modifiers:\n\n```swift\nstruct UsageExampleView: View {\n    let data = SankeyData(\n        nodes: [\n            SankeyNode(\"Design\", color: .blue),\n            SankeyNode(\"Development\", color: .green),\n            SankeyNode(\"Testing\", color: .orange),\n            SankeyNode(\"Frontend\", color: .purple),\n            SankeyNode(\"Backend\", color: .red),\n            SankeyNode(\"Mobile\", label: \"iOS\"),\n            SankeyNode(\"Production\", label: \"Prod\", color: .mint)\n        ],\n        links: [\n            SankeyLink(30, from: \"Design\", to: \"Frontend\", color: .blue),\n            SankeyLink(20, from: \"Design\", to: \"Mobile\", color: .blue),\n            SankeyLink(40, from: \"Development\", to: \"Frontend\", color: .green),\n            SankeyLink(60, from: \"Development\", to: \"Backend\", color: .green),\n            SankeyLink(30, from: \"Development\", to: \"Mobile\", color: .green),\n            SankeyLink(25, from: \"Testing\", to: \"Frontend\", color: .orange),\n            SankeyLink(35, from: \"Testing\", to: \"Backend\"),\n            SankeyLink(15, from: \"Testing\", to: \"Mobile\"),\n            SankeyLink(95, from: \"Frontend\", to: \"Production\", color: .purple),\n            SankeyLink(95, from: \"Backend\", to: \"Production\", color: .red),\n            SankeyLink(65, from: \"Mobile\", to: \"Production\", color: .yellow)\n        ]\n    )\n    \n    var body: some View {\n        SankeyDiagram(data)\n            // Node modifiers\n            .nodeAlignment(.justify)\n            .nodeWidth(15)\n            .nodePadding(20)\n            .nodeDefaultColor(.gray)\n            .nodeOpacity(0.8)\n            // Link modifiers\n            .linkDefaultColor(.gray)\n            .linkOpacity(0.7)\n            .linkColorMode(nil)\n            // Label modifiers\n            .labelPadding(8)\n            .labelColor(.primary)\n            .labelOpacity(0.9)\n            .labelFontSize(14)\n            .labelFontFamily(\"Times\")\n            // Normal view modifiers\n            .padding(10)\n            .frame(height: 400)\n    }\n}\n\n#Preview {\n    UsageExampleView()\n        .preferredColorScheme(.dark)\n}\n```\n\n\u003cimg src=\"Images/usage.png\" alt=\"usage\" width=\"200px\"/\u003e\n\nFind more examples in the [Examples App](Examples/Examples/ExamplesApp.swift).\n\n#### ⚠️ Version Compatibility\n\n\u003e **Note**: Version `2.0`+ uses D3 for rendering. For projects requiring the previous Google Charts implementation, use version `1.0`/`1.0.1` via SPM.\n\nKey differences in `2.0`+:\n- Streamlined API\n- Improved color handling\n- Built-in dark mode support\n- Offline rendering!\n\nFor legacy implementation details, see the [v1.0.1 documentation](https://github.com/maxhumber/Sankey/blob/1.0.1/README.md#quickstart).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxhumber%2Fsankey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxhumber%2Fsankey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxhumber%2Fsankey/lists"}