Fixes grid -> topo transition.

- Also don't show table borders when no nodes.
- 't' toggles table mode on/off, rather than 't'/v'
This commit is contained in:
Simon Howe
2016-07-28 15:32:35 +02:00
parent df1efff19b
commit a2810afaf1
4 changed files with 9 additions and 8 deletions

View File

@@ -232,8 +232,11 @@ export function clickForceRelayout() {
};
}
export function toggleGridMode(enabled) {
export function toggleGridMode(enabledArgument) {
return (dispatch, getState) => {
const enabled = (enabledArgument === undefined) ?
!getState().get('gridMode') :
enabledArgument;
dispatch({
type: ActionTypes.SET_GRID_MODE,
enabled

View File

@@ -41,8 +41,8 @@ class NodesChart extends React.Component {
scale: 1,
selectedNodeScale: d3.scale.linear(),
hasZoomed: false,
height: 0,
width: 0,
height: props.height || 0,
width: props.width || 0,
zoomCache: {}
};
}

View File

@@ -121,7 +121,7 @@ class NodesGrid extends React.Component {
return (
<div className="nodes-grid">
<NodeDetailsTable
{nodes.size > 0 && <NodeDetailsTable
style={cmpStyle}
className={className}
renderIdCell={renderIdCell}
@@ -134,7 +134,7 @@ class NodesGrid extends React.Component {
selectedNodeId={this.props.selectedNodeId}
limit={1000}
{...detailsData}
/>
/>}
</div>
);
}

View File

@@ -87,10 +87,8 @@ class App extends React.Component {
dispatch(pinNextMetric(-1));
} else if (char === '>') {
dispatch(pinNextMetric(1));
} else if (char === 'v') {
dispatch(toggleGridMode(false));
} else if (char === 't') {
dispatch(toggleGridMode(true));
dispatch(toggleGridMode());
} else if (char === 'q') {
dispatch(unpinMetric());
dispatch(selectMetric(null));