Skip to content

Commit

Permalink
Merge pull request #6 from thomcsmits/thomcsmits/gh
Browse files Browse the repository at this point in the history
add readme/license/fix demo's
  • Loading branch information
thomcsmits authored Mar 15, 2024
2 parents db03d0b + 374d7d6 commit 16adf7d
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 3 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Thomas C. Smits

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# CellPop: Cell Type Composition Explorer
CellPop is a visualization tool for cell type compositions. It is an NPM package that exports various functions and to create a D3 visualization from various file types.


## Why CellPop?
Cell type populations are commonly shown with stacked bar charts. However, scaling the number of samples and cell types in these visualizations create issues with analyzing these charts. CellPop alleviates this by presenting a flexible heatmap and side views with extending layered bar charts.

## How to run
This project uses pnpm.

Install dependencies with:
```sh
pnpm install
```

Run the demo with:
```sh
pnpm run dev
```

## Demo
The demo folder contains three demo's:
- The combination of index.jsx and demo.jsx are a React demo, using the HuBMAP data loaders and CellPopComponent, which includes the option bar.
- Main.js is a JavaScript only demo that uses the HuBMAP data loaders and the mainVis function to create the visualization.
- Animation.js shows an animation of how a stacked bar chart converts to the CellPop view.


The React demo is available (here)[thomcsmits.github.io/cellpop].

The main view and interactions:
![Screen shot of cell pop with 29 samples and arrows explaining interactions.](assets/cellpop_example.png)

## Team
[HiDIVE Lab](https://hidivelab.org)
- Thomas C. Smits (<[email protected]>)
- Nils Gehlenborg (<[email protected]>)
Binary file added assets/cellpop_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions demo/animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as d3 from "d3";
import { showAnimation } from "../src/visualization/animation";
import { loadHuBMAPData } from "../src/dataLoading/dataHuBMAP";
// data
var uuids = ['ad693f99fb9006e68a53e97598da1509',
'173de2e80adf6a73ac8cff5ccce20dfc',
'b95f34761c252ebbd1e482cd9afae73f',
'5a5ca03fa623602d9a859224aa40ace4',
'3c1b10bc912c60c9afc36b7423695236',
'1dc16eb0270ff73291dd45b6a96aa3c0',
'b05c21f9c94ce1a22a9694cd0fe0291e',
'8cdb42ed1194255c74c8462b99bbd7ef',
'fe0ded5fc0355c95239f9c040dd31e99',
'367fee3b40cba682063289505b922be1',
'b99fc30c4195958fbef217fa9ed9ec8f',
'898138b7f45a67c574e9955fb400e9be',
'f220c9e7bcaea3a87162cbe61287ea4d',
'e5f7a14d93659bd0b8dc2819ffa9bc4b',
'56cbda4789f04d79c0c3dffe21816d48',
'0b6f63f2bd61a8c091fc7afc0f318ad1',
'62efbe0a6abd0bcf53ab9ab29e7cd73f',
'4b62d9d2c248323ce029859f953fdc57',
'c81b0dc9d16eb825a7d6bce6e1b3678f',
'5ee240959c96b49d960702755478b9fc',
'7c9e07c96d144536525b1f889acee14d',
'dd7ccbc306692fc5ff5e61c22845da21',
'9a7e6be288b27ddbd3366c4ae41bbcd2',
'018a905cdbdff684760859f594d3fd77',
'af5741dad7aecf7960a129c3d2ae642a',
'6e1db473492095ccc2f1393d7259b9c0',
'fae9a1f2e7abefca2203765a3c7a5ba1',
'8d631eee88855ac59155edca2a3bc1ca',
'1ea6c0ac5ba60fe35bf63af8699b6fbe']


// Load data directly as demo
loadHuBMAPData(uuids).then((data) => {
showAnimation(data);
}).catch(error => {
console.error(error);
});
6 changes: 3 additions & 3 deletions demo/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as d3 from "d3";
import { getMainVis } from "./src/visualization";
import { showAnimation } from "./src/visualization/animation";
import { loadHuBMAPData } from "./src/dataLoading/dataHuBMAP";
import { getMainVis } from "../src/visualization";
import { showAnimation } from "../src/visualization/animation";
import { loadHuBMAPData } from "../src/dataLoading/dataHuBMAP";

// data
var uuids = ['ad693f99fb9006e68a53e97598da1509',
Expand Down

0 comments on commit 16adf7d

Please sign in to comment.