From ac4b6e79165a76474af95f37a86da3ae1e4791cc Mon Sep 17 00:00:00 2001 From: Zhen Li Date: Sun, 29 Dec 2024 14:30:14 -0800 Subject: [PATCH] Update Readme --- README.md | 40 +++++++++---------- .../CreatingASimulationWithBuiltinForces.md | 2 +- .../ForceSimulation.docc/Documentation.md | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 912515a..ffb621b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- grape-icon + grape-icon

Grape

@@ -12,9 +12,9 @@

A Swift library for graph visualization and efficient force simulation.

- - - + + +
@@ -27,11 +27,11 @@ This is a force directed graph visualizing [the network of character co-occurenc -https://github.com/swiftgraphs/Grape/assets/45376537/d80dc797-1980-4755-85b9-18ee26e2a7ff +https://github.com/li3zhen1/Grape/assets/45376537/d80dc797-1980-4755-85b9-18ee26e2a7ff -Source code: [Miserables.swift](https://github.com/swiftgraphs/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/Miserables.swift). +Source code: [Miserables.swift](https://github.com/li3zhen1/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/Miserables.swift). @@ -43,11 +43,11 @@ This is the same graph as the first example, rendered in `RealityView`: -https://github.com/swiftgraphs/Grape/assets/45376537/4585471e-2339-4aee-8f39-0c11fdfb6901 +https://github.com/li3zhen1/Grape/assets/45376537/4585471e-2339-4aee-8f39-0c11fdfb6901 -Source code: [ForceDirectedGraph3D/ContentView.swift](https://github.com/swiftgraphs/Grape/blob/main/Examples/ForceDirectedGraph3D/ForceDirectedGraph3D/ContentView.swift). +Source code: [ForceDirectedGraph3D/ContentView.swift](https://github.com/li3zhen1/Grape/blob/main/Examples/ForceDirectedGraph3D/ForceDirectedGraph3D/ContentView.swift).
@@ -57,11 +57,11 @@ Source code: [ForceDirectedGraph3D/ContentView.swift](https://github.com/swiftgr Dynamical graph structure based on your input, with tap and drag gesture supports, all within 100 lines of view body. -https://github.com/swiftgraphs/Grape/assets/45376537/7c75d367-d5a8-4316-813b-288b375f513b +https://github.com/li3zhen1/Grape/assets/45376537/7c75d367-d5a8-4316-813b-288b375f513b -Source code: [MermaidVisualization.swift](https://github.com/swiftgraphs/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/MermaidVisualization.swift) +Source code: [MermaidVisualization.swift](https://github.com/li3zhen1/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/MermaidVisualization.swift)
@@ -74,9 +74,9 @@ A 36x36 force directed lattice. -https://github.com/swiftgraphs/Grape/assets/45376537/5b76fddc-dd5c-4d35-bced-29c01269dd2b +https://github.com/li3zhen1/Grape/assets/45376537/5b76fddc-dd5c-4d35-bced-29c01269dd2b -Source code: [Lattice.swift](https://github.com/swiftgraphs/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/Lattice.swift) +Source code: [Lattice.swift](https://github.com/li3zhen1/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/Lattice.swift) @@ -89,9 +89,9 @@ An example rendering a ring with 60 vertices, with dragging gesture enabled. -https://github.com/swiftgraphs/Grape/assets/45376537/73213e7f-73ee-44f3-9b3e-7e58355045d2 +https://github.com/li3zhen1/Grape/assets/45376537/73213e7f-73ee-44f3-9b3e-7e58355045d2 -Source code: [MyRing.swift](https://github.com/swiftgraphs/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/MyRing.swift) +Source code: [MyRing.swift](https://github.com/li3zhen1/Grape/blob/main/Examples/ForceDirectedGraphExample/ForceDirectedGraphExample/MyRing.swift)
@@ -143,7 +143,7 @@ Grape ships 2 modules: ### The `Grape` module -For detailed usage, please refer to [documentation](https://swiftgraphs.github.io/Grape/Grape/documentation/grape). A quick example here: +For detailed usage, please refer to [documentation](https://li3zhen1.github.io/Grape/Grape/documentation/grape). A quick example here: ```swift import Grape @@ -182,13 +182,13 @@ struct MyGraph: View { ### The `ForceSimulation` module
- Refer to the documentation or expand this section to find more about this module. + Refer to the documentation or expand this section to find more about this module. `ForceSimulation` module mainly contains 3 concepts, `Kinetics`, `ForceProtocol` and `Simulation`.

- A diagram showing the relationships of `Kinetics`, `ForceProtocol` and `Simulation`. A `Simulation` contains a `Kinetics` and a `ForceProtocol`. + A diagram showing the relationships of `Kinetics`, `ForceProtocol` and `Simulation`. A `Simulation` contains a `Kinetics` and a `ForceProtocol`.

@@ -244,7 +244,7 @@ for mySimulation in 0..<120 { ``` -See [Example](https://github.com/swiftgraphs/Grape/tree/main/Examples/ForceDirectedGraphExample) for more details. +See [Example](https://github.com/li3zhen1/Grape/tree/main/Examples/ForceDirectedGraphExample) for more details.
@@ -284,7 +284,7 @@ See [Example](https://github.com/swiftgraphs/Grape/tree/main/Examples/ForceDirec #### Simulation -Grape uses simd to calculate position and velocity. Currently it takes **~0.005** seconds to iterate 120 times over the example graph(2D). (77 vertices, 254 edges, with manybody, center, collide and link forces. Release build on a M1 Max, [tested](https://github.com/swiftgraphs/Grape/blob/main/Tests/ForceSimulationTests/MiserableGraphTest.swift) with command `swift test -c release`) +Grape uses simd to calculate position and velocity. Currently it takes **~0.005** seconds to iterate 120 times over the example graph(2D). (77 vertices, 254 edges, with manybody, center, collide and link forces. Release build on a M1 Max, [tested](https://github.com/li3zhen1/Grape/blob/main/Tests/ForceSimulationTests/MiserableGraphTest.swift) with command `swift test -c release`) For 3D simulation, it takes **~0.008** seconds for the same graph and same configs. @@ -294,7 +294,7 @@ For 3D simulation, it takes **~0.008** seconds for the same graph and same confi
#### KDTree -The `BufferedKDTree` from this package is **~22x** faster than `GKQuadtree` from Apple’s GameKit, according to this [test case](https://github.com/swiftgraphs/Grape/blob/main/Tests/ForceSimulationTests/GKTreeCompareTest.swift). However, please note that comparing Swift structs with NSObjects is unfair, and their behaviors are different. +The `BufferedKDTree` from this package is **~22x** faster than `GKQuadtree` from Apple’s GameKit, according to this [test case](https://github.com/li3zhen1/Grape/blob/main/Tests/ForceSimulationTests/GKTreeCompareTest.swift). However, please note that comparing Swift structs with NSObjects is unfair, and their behaviors are different.
diff --git a/Sources/ForceSimulation/ForceSimulation.docc/CreatingASimulationWithBuiltinForces.md b/Sources/ForceSimulation/ForceSimulation.docc/CreatingASimulationWithBuiltinForces.md index 3ec3fe9..fe98652 100644 --- a/Sources/ForceSimulation/ForceSimulation.docc/CreatingASimulationWithBuiltinForces.md +++ b/Sources/ForceSimulation/ForceSimulation.docc/CreatingASimulationWithBuiltinForces.md @@ -67,4 +67,4 @@ A diagram showing the relationships of `Kinetics`, `ForceProtocol` and `Simulati In this example, we run our simulation in a 2D space (`SIMD2`). We explicitly create a ``SealedForce2D`` to make sure the force is in the same dimension as the Kinetics. The `Vector` in `Simulation` is inferred from the force we pass. -See [Examples](https://github.com/swiftgraphs/Grape/tree/main/Examples) for example Xcode projects. \ No newline at end of file +See [Examples](https://github.com/li3zhen1/Grape/tree/main/Examples) for example Xcode projects. \ No newline at end of file diff --git a/Sources/ForceSimulation/ForceSimulation.docc/Documentation.md b/Sources/ForceSimulation/ForceSimulation.docc/Documentation.md index 785884a..0d1838b 100644 --- a/Sources/ForceSimulation/ForceSimulation.docc/Documentation.md +++ b/Sources/ForceSimulation/ForceSimulation.docc/Documentation.md @@ -6,7 +6,7 @@ Run force simulation within any number of dimensions. The `ForceSimulation` library enables you to create any dimensional simulation that uses velocity Verlet integration. -If you’re looking for an out-of-the-box SwiftUI View to render force-directed graphs, please refer to [Grape | Documentation](https://swiftgraphs.github.io/Grape/Grape/documentation/grape/). +If you’re looking for an out-of-the-box SwiftUI View to render force-directed graphs, please refer to [Grape | Documentation](https://li3zhen1.github.io/Grape/Grape/documentation/grape/).