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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't enlarge focused nodes. #1259

Merged
merged 2 commits into from
Apr 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Don't enlarge focused nodes.
- Calculate size based on number of nodes that come up into the
  selection area.
  • Loading branch information
foot committed Apr 11, 2016
commit b9ce725561652b91cb9a41b1c7c81158c4747b77
2 changes: 1 addition & 1 deletion client/app/scripts/charts/node-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class NodeContainer extends React.Component {
render() {
const { dx, dy, focused, layoutPrecision, zoomScale } = this.props;
const animConfig = [80, 20]; // stiffness, damping
const scaleFactor = focused ? (2 / zoomScale) : 1;
const scaleFactor = focused ? (1 / zoomScale) : 1;
const other = _.omit(this.props, 'dx', 'dy');

return (
Expand Down
4 changes: 3 additions & 1 deletion client/app/scripts/charts/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ export default class Node extends React.Component {
}

render() {
const { blurred, focused, highlighted, label, nodeScale, pseudo, rank,
const { blurred, focused, highlighted, label, pseudo, rank,
subLabel, scaleFactor, transform, zoomScale } = this.props;

const nodeScale = focused ? this.props.selectedNodeScale : this.props.nodeScale;

const color = getNodeColor(rank, label, pseudo);
const labelText = ellipsis(label, 14, nodeScale(4 * scaleFactor));
const subLabelText = ellipsis(subLabel, 12, nodeScale(4 * scaleFactor));
Expand Down
2 changes: 1 addition & 1 deletion client/app/scripts/charts/nodes-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export default class NodesChart extends React.Component {
});

// auto-scale node size for selected nodes
const selectedNodeScale = this.getNodeScale(props);
const selectedNodeScale = this.getNodeScale(Object.assign({}, props, {nodes: adjacentNodes}));

This comment was marked as abuse.


return {
selectedNodeScale,
Expand Down