Skip to content

Commit b5b49ca

Browse files
committed
Drop unused SunburstContainer.ComponentDidUpdate
1 parent b1b7b12 commit b5b49ca

2 files changed

Lines changed: 3 additions & 21 deletions

File tree

src/components/sunburst/sunburst-container-utils.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,10 @@ export function getSize () {
33
document.body.clientWidth;
44
const h = window.innerHeight || document.documentElement.clientHeight ||
55
document.body.clientHeight;
6-
let size;
76
if (h < w) {
8-
size = h * 0.45;
7+
return h * 0.45;
98
} else {
10-
size = w * 0.45;
11-
}
12-
_showRootInfo(size);
13-
return size;
14-
}
15-
16-
function _showRootInfo (size) {
17-
const rootInfoDiv = document.getElementById('root-cell-tooltip');
18-
if (rootInfoDiv) {
19-
rootInfoDiv.setAttribute('style', `top:${size * 0.4}px; width:${size * 0.4}px; height:${size * 0.22}px; font-size: ${size * 0.004}em;`);
9+
return w * 0.45;
2010
}
2111
}
2212

src/components/sunburst/sunburst-container.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scaleCluster from 'd3-scale-cluster';
44
import '../../css/diffgraph.css';
55
import { similarityWithDistance, checkResponse, fetchWithTimeout, getUTCDateFormat }
66
from '../../js/utils.js';
7-
import { getSize, decodeCompressedJson, decodeUncompressedJson } from './sunburst-container-utils.js';
7+
import { decodeCompressedJson, decodeUncompressedJson } from './sunburst-container-utils.js';
88
import ErrorMessage from '../errors.jsx';
99
import PropTypes from 'prop-types';
1010
import Loading from '../loading.jsx';
@@ -47,20 +47,12 @@ export default class SunburstContainer extends React.Component {
4747
constructor (props) {
4848
super(props);
4949
this.state = {
50-
isUpdate: 0,
5150
isPending: false,
5251
simhashData: null
5352
};
5453
this._clusters = [];
5554
}
5655

57-
componentDidUpdate () {
58-
if (this.state.isUpdate < 2) {
59-
getSize();
60-
this.setState({ isUpdate: this.state.isUpdate + 1 });
61-
}
62-
}
63-
6456
render () {
6557
const { url, conf, loader } = this.props;
6658
const { countCaptures, error, simhashData, timestamp } = this.state;

0 commit comments

Comments
 (0)