Skip to content

Commit

Permalink
communities edge color, new network
Browse files Browse the repository at this point in the history
  • Loading branch information
l-pa committed May 12, 2020
1 parent 5d91bd6 commit 09ca26d
Show file tree
Hide file tree
Showing 5 changed files with 20,990 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ hr {
height: 30em;
}

.border-h {
border: 2px solid white;
width: 14em;
}

.selector {
position: absolute;
left: 30%;
Expand Down Expand Up @@ -88,6 +93,7 @@ hr {
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
margin-top: 1em;
margin-bottom: 1em;
width: 25vw;
}

.example p {
Expand All @@ -108,6 +114,9 @@ hr {
.border {
display: none;
}
.example {
width: 100%;
}
}

.scrollable {
Expand Down
18 changes: 12 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ function App() {
<div className="center">
<div className="left">
<h2>Custom network</h2>
<p>GEXF - 1.2+ / JSON / GML</p>
<input
type="file"
accept=".gexf, .json, .gml"
Expand All @@ -125,6 +124,8 @@ function App() {
}}
/>
<br />
<p>GEXF - 1.2+ / JSON / GML</p>
<div className="border-h" />
<br />
<input
type="checkbox"
Expand All @@ -142,15 +143,20 @@ function App() {
tabIndex="0"
onClick={() => {
setExample(
"https://raw.githubusercontent.com/l-pa/network-app/master/src/networks/java_packages.json",
"json",
"java_packages"
"https://raw.githubusercontent.com/l-pa/network-app/master/src/networks/diseasome.gexf",
"gexf",
"diseasome"
);
}}
className="example"
>
<p>Java packages.json</p>
<small>1.5k nodes, 8k edges</small>
<p>Diseasome.gexf</p>
<small>
A network of disorders and disease genes linked by known
disorder–gene associations, indicating the common genetic
origin of many diseases.
{" "}
</small>
</div>
<div
role="button"
Expand Down
1 change: 1 addition & 0 deletions src/components/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ function Network(props) {
lasso={lasso}
fileName={props.fileName}
setNodeGroups={setNodeGroups}
nodeGroups={nodeGroups}
groupArea={groupArea}
selectNodesButton={groupArea}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default function Settings(props) {
break;
}
window.network.refresh();
}, [edgeColor, nodeColor, nodeRealColor]);
}, [edgeColor, nodeColor, nodeRealColor, props.nodeGroups]);

useEffect(() => {
// TODO
Expand Down Expand Up @@ -671,7 +671,6 @@ export default function Settings(props) {
.nodes(nodes)
.edges(window.network.graph.edges());
const result = community();
console.log(result);
const palette = iwanthue(Math.max(...Object.values(result)) + 1, {
clustering: "force-vector",
seed: Math.random()
Expand Down
Loading

0 comments on commit 09ca26d

Please sign in to comment.