mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 18:51:17 +00:00
Moved nodes-chart-zoom. Moved zoomCache to global state. Moved nodes-chart-focus. Fixed some bugs and polished the code. Keeping track of topology options in zoomCache. Fixed forceRelayout and circular layout. Unified graph complexity heuristic criterion.
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
import NodesChartEdges from './nodes-chart-edges';
|
|
import NodesChartNodes from './nodes-chart-nodes';
|
|
import { graphExceedsComplexityThreshSelector } from '../selectors/topology';
|
|
import {
|
|
selectedScaleSelector,
|
|
layoutNodesSelector,
|
|
layoutEdgesSelector
|
|
} from '../selectors/nodes-chart-layout';
|
|
|
|
|
|
class NodesChartElements extends React.Component {
|
|
render() {
|
|
const { layoutNodes, layoutEdges, selectedScale, transform, isAnimated } = this.props;
|
|
|
|
return (
|
|
<g className="nodes-chart-elements" transform={transform}>
|
|
<NodesChartEdges
|
|
layoutEdges={layoutEdges}
|
|
selectedScale={selectedScale}
|
|
isAnimated={isAnimated} />
|
|
<NodesChartNodes
|
|
layoutNodes={layoutNodes}
|
|
selectedScale={selectedScale}
|
|
isAnimated={isAnimated} />
|
|
</g>
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
layoutNodes: layoutNodesSelector(state),
|
|
layoutEdges: layoutEdgesSelector(state),
|
|
selectedScale: selectedScaleSelector(state),
|
|
isAnimated: !graphExceedsComplexityThreshSelector(state),
|
|
};
|
|
}
|
|
|
|
export default connect(
|
|
mapStateToProps
|
|
)(NodesChartElements);
|