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

Fix Pods number in graph not updating (minor label) #2728

Merged
merged 2 commits into from
Jul 21, 2017
Merged
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
6 changes: 5 additions & 1 deletion client/app/scripts/charts/nodes-layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dagre from 'dagre';
import debug from 'debug';
import { fromJS, Map as makeMap, Set as ImmSet } from 'immutable';
import pick from 'lodash/pick';

import { NODE_BASE_SIZE, EDGE_WAYPOINTS_CAP } from '../constants/styles';
import { EDGE_ID_SEPARATOR } from '../constants/naming';
Expand Down Expand Up @@ -487,7 +488,10 @@ export function doLayout(immNodes, immEdges, opts) {

// cache results
cache.cachedLayout = layout;
cache.nodeCache = cache.nodeCache.merge(layout.nodes);
// only cache layout-related properties
// NB: These properties must be immutable wrt a given node because properties of updated nodes
// will be overwritten with the cached values, see copyLayoutProperties()
cache.nodeCache = cache.nodeCache.merge(layout.nodes.map(n => fromJS(pick(n.toJS(), ['x', 'y', 'rank']))));
cache.edgeCache = cache.edgeCache.merge(layout.edges);
}

Expand Down