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

Initial version of the resource view #2296

Merged
merged 32 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
08f9691
Added resource view selector button
fbarl Mar 2, 2017
7a049c1
Showing resource boxes in the resource view
fbarl Mar 3, 2017
f0e7007
Crude CPU resource view prototype
fbarl Mar 3, 2017
688c0f4
Improved the viewMode state logic
fbarl Mar 3, 2017
e52b123
Extracted zooming into a separate wrapper component
fbarl Mar 3, 2017
1e4dd6d
Split the layout selectors between graph-view and resource-view
fbarl Mar 6, 2017
a11e3a1
Proper zooming logic for the resource view
fbarl Mar 6, 2017
4d36806
Moved all node networks utils to selectors
fbarl Mar 7, 2017
b546acf
Improved the zoom caching logic
fbarl Mar 8, 2017
af0881d
Further refactoring of selectors
fbarl Mar 10, 2017
de3d99f
Added sticky labels to the resource boxes
fbarl Mar 10, 2017
ce1282c
Added panning translation limits in the resource view
fbarl Mar 10, 2017
e05302e
Renamed GridModeSelector -> ViewModeSelector
fbarl Mar 10, 2017
c225993
Polished the topology resource view selection logic
fbarl Mar 10, 2017
04bfca2
Search bar hidden in the resource view
fbarl Mar 10, 2017
7cdfcf7
Added per-layer topology names to the resource view
fbarl Mar 11, 2017
8ac6d8a
Made metric selectors work for the resource view
fbarl Mar 11, 2017
bfd3271
Adjusted the viewport selectors
fbarl Mar 12, 2017
a4a97e4
Renamed viewport selector to canvas (+ maximal zoom fix)
fbarl Mar 12, 2017
feb461c
Showing more useful metric info in the resource box labels
fbarl Mar 14, 2017
c273da2
Fetching only necessary nodes for the resource view
fbarl Mar 15, 2017
a57f043
Refactored the resource view layer component
fbarl Mar 15, 2017
b3eb612
Addressed first batch UI comments (from the Scope meeting)
fbarl Mar 16, 2017
f8348fc
Switch to deep zooming transform in the resource view to avoid SVG pr…
fbarl Mar 17, 2017
287d379
Renamed and moved resource view components
fbarl Mar 17, 2017
a52c979
Polished all the resource view components
fbarl Mar 17, 2017
a8d8e0e
Changing the available metrics selection
fbarl Mar 20, 2017
471251a
Improved and polished the state transition logic for the resource view
fbarl Mar 20, 2017
2373b71
Separated zoom limits from the zoom active state
fbarl Mar 21, 2017
8fec8a3
Renaming and bunch of comments
fbarl Mar 21, 2017
3dc4e9d
Addressed all the UI comments (@davkal + @fons)
fbarl Mar 22, 2017
ca3f74f
Made graph view selectors independent from resource view selectors
fbarl Mar 24, 2017
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
Prev Previous commit
Next Next commit
Showing resource boxes in the resource view
  • Loading branch information
fbarl committed Mar 24, 2017
commit 7a049c14cd9a55c0eacb12fa5617292148f564d0
12 changes: 12 additions & 0 deletions client/app/scripts/charts/node-resource-metric.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

export default class NodeResourceMetric extends React.Component {
render() {
const { index } = this.props;
return (
<g className="node-resource-metric">
<rect x={index * 100} y="0" width="90" height="300" />
</g>
);
}
}
2 changes: 1 addition & 1 deletion client/app/scripts/charts/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Node extends React.Component {
exportingGraph, showingNetworks, stack, id, metric } = this.props;
const { hovered } = this.state;

console.log(metric && metric.toJS());
// console.log(metric && metric.toJS());
const color = getNodeColor(rank, label, pseudo);
const truncate = !focused && !hovered;
const labelOffsetY = (showingNetworks && networks) ? 40 : 28;
Expand Down
7 changes: 6 additions & 1 deletion client/app/scripts/charts/nodes-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { event as d3Event, select } from 'd3-selection';
import { zoom, zoomIdentity } from 'd3-zoom';

import Logo from '../components/logo';
import ResourceView from './resource-view';
import NodesChartElements from './nodes-chart-elements';
import { clickBackground, cacheZoomState } from '../actions/app-actions';
import { activeLayoutZoomSelector } from '../selectors/nodes-chart-zoom';
Expand Down Expand Up @@ -110,7 +111,10 @@ class NodesChart extends React.Component {
<g transform="translate(24,24) scale(0.25)">
<Logo />
</g>
<NodesChartElements transform={transform} />
{this.props.resourceView ?
<ResourceView transform={transform} /> :
<NodesChartElements transform={transform} />
}
</svg>
</div>
);
Expand Down Expand Up @@ -166,6 +170,7 @@ function mapStateToProps(state) {
layoutId: JSON.stringify(activeTopologyZoomCacheKeyPathSelector(state)),
selectedNodeId: state.get('selectedNodeId'),
forceRelayout: state.get('forceRelayout'),
resourceView: state.get('resourceView'),
};
}

Expand Down
31 changes: 31 additions & 0 deletions client/app/scripts/charts/resource-view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { connect } from 'react-redux';

import NodeResourceMetric from './node-resource-metric';

class ResourceView extends React.Component {
render() {
const { nodes, transform } = this.props;
return (
<g className="resource-view" transform={transform}>
{nodes.toIndexedSeq().map((node, index) => (
<NodeResourceMetric
index={index}
key={node.get('id')}
metric={node.get('metrics')}
/>
))}
</g>
);
}
}

function mapStateToProps(state) {
return {
nodes: state.get('nodes'),
};
}

export default connect(
mapStateToProps
)(ResourceView);