Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/default node symbol #11

Merged
merged 3 commits into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/Graph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class Graph extends React.Component {
/**
* Handles d3 drag 'start' event.
*/
_onDragStart = () => !this.state.config.staticGraph && this.state.simulation.stop();
_onDragStart = () => this.pauseSimulation();

/**
* Sets nodes and links highlighted value.
Expand All @@ -120,7 +120,7 @@ export default class Graph extends React.Component {
});
}

this.setState(this.state || {});
this._tick();
}

/**
Expand Down Expand Up @@ -191,7 +191,7 @@ export default class Graph extends React.Component {
// @TODO: hardcoded alpha target
this.state.simulation.alphaTarget(0.08).restart();

this.setState(this.state || {});
this._tick();
}
}

Expand Down Expand Up @@ -304,7 +304,7 @@ export default class Graph extends React.Component {
Utils.throwErr(this.constructor.name, ERRORS.STATIC_GRAPH_DATA_UPDATE);
}

const configUpdated = Utils.isDeepEqual(nextProps.config, this.state.config);
const configUpdated = !Utils.isDeepEqual(nextProps.config, this.state.config);
const state = newGraphElements ? this._initializeGraphState(nextProps.data) : this.state;
const config = Utils.merge(DEFAULT_CONFIG, nextProps.config || {});

Expand Down
4 changes: 2 additions & 2 deletions src/components/Node/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CONST from './const';
* of d3 symbol.<br/>
* {@link https://github.com/d3/d3-shape/blob/master/README.md#symbol}
* @param {string} typeName - the string that specifies the symbol type (should be one of {@link #node-symbol-type|node.symbolType}).
* @return {Object} concrete instance of d3 symbol.
* @return {Object} concrete instance of d3 symbol (defaults to circle).
* @memberof Node/helper
*/
function _convertTypeToD3Symbol(typeName) {
Expand All @@ -32,7 +32,7 @@ function _convertTypeToD3Symbol(typeName) {
case CONST.SYMBOLS.WYE:
return d3.symbolWye;
default:
return d3.symbolTriangle;
return d3.symbolCircle;
}
}

Expand Down