Skip to content

Commit

Permalink
Merge pull request #5 from NLeSC/categoricalcolors
Browse files Browse the repository at this point in the history
Categoricalcolors
  • Loading branch information
Dafne van Kuppevelt committed May 24, 2017
2 parents 171940e + 3833b5f commit e793a46
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "case-law-app-js",
"version": "0.2.1",
"version": "0.3.0",
"private": true,
"homepage": "https://nlesc.github.io/case-law-app",
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class App extends React.Component {
activeNode: {},
filterState: {
sizeAttributeValue: "degree",
colorAttributeValue: "community",
colorAttributeValue: "none",
adjustLayout: false,
filterSelected: false
},
Expand Down Expand Up @@ -91,7 +91,7 @@ class App extends React.Component {
filterState.creatorValue = filterState.creatorValue || "all";
filterState.communityValue = filterState.communityValue || "all";
filterState.sizeAttributeValue = filterState.sizeAttributeValue || "degree";
filterState.colorAttributeValue = filterState.colorAttributeValue || "creator";
filterState.colorAttributeValue = filterState.colorAttributeValue || "none";
return {
filterState: filterState
};
Expand Down Expand Up @@ -144,16 +144,16 @@ class App extends React.Component {
} = this.state;
const title = data.title || "Network";
const version = require('./../package.json').version;
const version_url = "https://github.com/NLeSC/case-law-app/releases/tag/v" + version;
const version_url = "https://github.com/NLeSC/case-law-app/releases";
return (
<div className="App">
<div className="App-header">
<div className="App-title">
<h3>Case Law Analytics - {title}</h3>
</div>
<div className="App-info">
<p><a href={version_url}>Version {version}</a></p>
<p> <a href="https://github.com/NLeSC/case-law-app">Source code</a> </p>
<p><a href={version_url} target="_blank">Version {version}</a></p>
<p> <a href="https://github.com/NLeSC/case-law-app" target="_blank">Source code</a> </p>
</div>
</div>

Expand Down
12 changes: 11 additions & 1 deletion src/components/ColorOnAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ class ColorOnAttribute extends React.Component {
const s = props.sigma;
const att = props.attribute;
const nodes = s.graph.nodes();
if (nodes.length > 0) {
if (att === 'none') {
nodes.forEach(node => {
node.color_selected = 'green';
node.color_unselected = 'black';
if (node.selected) {
node.color = node.color_selected;
} else {
node.color = node.color_unselected;
}
});
} else if (nodes.length > 0) {
if (typeof nodes[0][att] === 'string') {
this.updateColorCategorical(nodes, att);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/components/FilterPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class FilterPane extends Component {
<div>
<h4>Node Color</h4>
<select value={colorAttributeValue} onChange={this.handleColorAttributeChange}>
<option value="none">none</option>
{listColorAttributes}
</select>
</div>
Expand Down

0 comments on commit e793a46

Please sign in to comment.