Skip to content

Commit

Permalink
Add graph algorithms.
Browse files Browse the repository at this point in the history
  • Loading branch information
yjcyxky committed May 28, 2024
1 parent a326cbe commit 2c881ed
Show file tree
Hide file tree
Showing 8 changed files with 56,765 additions and 5 deletions.
147 changes: 143 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[workspace]
members = [
"wasm"
]

[package]
authors = ["Jingcheng Yang <yjcyxky@163.com>"]
documentation = "https://github.com/yjcyxky/biomedgps/blob/master/README.md"
Expand Down
3 changes: 2 additions & 1 deletion studio/src/pages/KnowledgeTable/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.ant-collapse {
width: 100%;

.ant-collapse-item:nth-child(1),
.ant-collapse-item:nth-child(2) {
.ant-collapse-header {
border-bottom: 1px solid #f0f0f0;
Expand All @@ -27,7 +28,7 @@

.ant-collapse-header,
.ant-collapse-content-box {
border-radius: 0;
border-radius: 0 !important;
padding: 20px 0;
}
}
Expand Down
22 changes: 22 additions & 0 deletions wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "biomedgps-graph"
description = ""
version = "0.1.0"
authors = ["Jingcheng Yang <yjcyxky@163.com>"]
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
rustworkx-core = "0.14.2"
serde = { version = "1.0", features = ["derive"] }
wasm-bindgen = "0.2"
serde-wasm-bindgen = "0.6.5"
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
wasm-bindgen-test = "0.3"

[profile.release]
opt-level = "s"
35 changes: 35 additions & 0 deletions wasm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# BiomedGPS Graph

This project provides a Rust implementation for calculating various centrality measures of a graph, compiled to WebAssembly (Wasm) for use in a web frontend.

## Getting Started

### Prerequisites

Ensure you have the following tools installed:

- [Rust](https://www.rust-lang.org/tools/install)
- [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)

### Build Instructions

1. Clone the repository:

```sh
git clone https://github.com/yjcyxky/biomedgps.git
cd biomedgps/wasm
```

2. Build the project:

```sh
wasm-pack build --target web
```

3. Run example.js:

```sh
python3 -m http.server 8000
```

Open `http://localhost:8000` in your browser and see the output.
Loading

0 comments on commit 2c881ed

Please sign in to comment.