Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

KIALI-611: Fix graph sizing problems #285

Merged
merged 1 commit into from Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/components/CytoscapeLayout/CytoscapeLayout.tsx
Expand Up @@ -51,20 +51,6 @@ export default class CytoscapeLayout extends React.Component<CytoscapeLayoutProp
this.handleMouseOut = this.handleMouseOut.bind(this);
}

resizeWindow() {
let canvasWrapper = document.getElementById('cytoscape-container')!;

if (canvasWrapper) {
let dimensions = canvasWrapper.getBoundingClientRect();
canvasWrapper.style.height = `${document.documentElement.scrollHeight - dimensions.top}px`;
}
}

componentDidMount() {
window.addEventListener('resize', this.resizeWindow);
this.resizeWindow();
}

shouldComponentUpdate(nextProps: any, nextState: any) {
return (
this.props.isLoading !== nextProps.isLoading ||
Expand Down Expand Up @@ -143,7 +129,7 @@ export default class CytoscapeLayout extends React.Component<CytoscapeLayoutProp
render() {
const layout = LayoutDictionary.getLayout(this.props.graphLayout);
return (
<div id="cytoscape-container" style={{ marginRight: '25em' }}>
<div id="cytoscape-container" style={{ marginRight: '25em', height: '100%' }}>
<Spinner loading={this.props.isLoading}>
<EmptyGraphLayout
elements={this.props.elements}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ServiceGraph/ServiceGraphPage.tsx
Expand Up @@ -114,7 +114,7 @@ export default class ServiceGraphPage extends React.Component<ServiceGraphPagePr
onRefresh={this.handleRefreshClick}
{...graphParams}
/>
<div style={{ position: 'relative' }}>
<div style={{ position: 'absolute', right: 20, bottom: 0, top: 230, left: 220 }}>
<CytoscapeLayout
{...graphParams}
isLoading={this.state.isLoading}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ServiceGraph/SummaryPanel.tsx
Expand Up @@ -12,7 +12,7 @@ type SummaryPanelState = {
export default class SummaryPanel extends React.Component<SummaryPanelPropType, SummaryPanelState> {
render() {
return (
<div>
<>
{this.props.data.summaryType === 'edge' ? (
<SummaryPanelEdge
data={this.props.data}
Expand Down Expand Up @@ -53,7 +53,7 @@ export default class SummaryPanel extends React.Component<SummaryPanelPropType,
rateInterval={this.props.rateInterval}
/>
) : null}
</div>
</>
);
}
}
4 changes: 3 additions & 1 deletion src/pages/ServiceGraph/SummaryPanelEdge.tsx
Expand Up @@ -19,7 +19,9 @@ export default class SummaryPanelEdge extends React.Component<SummaryPanelPropTy
position: 'absolute' as 'absolute',
width: '25em',
top: 0,
right: 0
right: 0,
bottom: 0,
overflowY: 'auto' as 'auto'
};

// avoid state changes after component is unmounted
Expand Down
5 changes: 3 additions & 2 deletions src/pages/ServiceGraph/SummaryPanelGraph.tsx
Expand Up @@ -21,9 +21,10 @@ export default class SummaryPanelGraph extends React.Component<SummaryPanelPropT
static readonly panelStyle = {
position: 'absolute' as 'absolute',
width: '25em',
bottom: 0,
top: 0,
right: 0
right: 0,
bottom: 0,
overflowY: 'auto' as 'auto'
};

// avoid state changes after component is unmounted
Expand Down
4 changes: 3 additions & 1 deletion src/pages/ServiceGraph/SummaryPanelGroup.tsx
Expand Up @@ -22,7 +22,9 @@ export default class SummaryPanelGroup extends React.Component<SummaryPanelPropT
position: 'absolute' as 'absolute',
width: '25em',
top: 0,
right: 0
right: 0,
bottom: 0,
overflowY: 'auto' as 'auto'
};

// avoid state changes after component is unmounted
Expand Down
4 changes: 3 additions & 1 deletion src/pages/ServiceGraph/SummaryPanelNode.tsx
Expand Up @@ -22,7 +22,9 @@ export default class SummaryPanelNode extends React.Component<SummaryPanelPropTy
position: 'absolute' as 'absolute',
width: '25em',
top: 0,
right: 0
right: 0,
bottom: 0,
overflowY: 'auto' as 'auto'
};

// avoid state changes after component is unmounted
Expand Down