Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
draw() {
const container = $(ReactDOM.findDOMNode(this));
const m = [50, 50, 0, 100]; // top right bottom left
const w = container.width() - m[1] - m[3]; // width
const h = container.height() - m[0] - m[2]; // height
this.xScale.range([0, w]);
this.y = Math.round(h * 0.1); // bar height
this.canvas.attr('transform', `translate(${m[3]},${m[0]})`);
this.drawBars(this.state.data);
},
drawBars(root) {
componentDidMount () {
this.props.api.addAction('setStartContent', (Component, props = {}) => {
this.setState({
contentComponent: Component,
contentProps: props
})
})
this.props.api
.reply('bar-content-start:show', () => {
this.setState({ showContent: true })
})
.reply('bar-content-start:hide', () => {
this.setState({ showContent: false })
})
this.addResizeListener(ReactDOM.findDOMNode(this), this.handleElementResize)
}
applyWithToRows() {
let maxWidth = 0;
let rows = [];
for (var prop in this.refs) {
if (this.refs.hasOwnProperty(prop)) {
let row = findDOMNode(this.refs[prop]);
rows = [...rows, row];
maxWidth =
row.offsetWidth > maxWidth ? row.offsetWidth : maxWidth;
}
}
for (let row of rows) {
row.style.width = `${maxWidth}px`;
}
}
focusOnLastTag() {
const node = ReactDOM.findDOMNode(this);
if (!node) {
return;
}
const lastTag = node.querySelector('.compact-tag-list__visible .tag:last-child');
if (lastTag) {
lastTag.focus();
}
}
calcDesiredHeight(){
let rootDivHeight = this.calcRootDivHeight()
ReactDOM.findDOMNode(this.refs.RootDiv).style.height = (rootDivHeight+'px')
let splitPanelHeight = rootDivHeight - ReactDOM.findDOMNode(this.refs.NavigationInPage).clientHeight
let splitPanel = ReactDOM.findDOMNode( this.refs.SplitPanel )
let topHeight = parseInt(splitPanelHeight/3) * 2
let bottomHeight = splitPanelHeight - topHeight
splitPanel.style.height = splitPanelHeight + 'px'
splitPanel.childNodes[0].style.height = topHeight + 'px'
splitPanel.childNodes[1].style.top = topHeight + 'px'
splitPanel.childNodes[2].style.height = bottomHeight + 'px'
this.onSplitPanelHeightChange( 0,0,topHeight,bottomHeight )
},
handlePlay = () => {
this.props.play(ReactDOM.findDOMNode(this.refs.audio));
}
pulsate = () => {
const innerCircle = ReactDOM.findDOMNode(this.refs.innerCircle);
if (!innerCircle) return;
const startScale = 'scale(1)';
const endScale = 'scale(0.85)';
const currentScale = innerCircle.style.transform || startScale;
const nextScale = currentScale === startScale ? endScale : startScale;
autoPrefix.set(innerCircle.style, 'transform', nextScale);
this.timeout = setTimeout(this.pulsate, pulsateDuration);
};
_updateField: function (rowId, column) {
const cell = findDOMNode(this.body).querySelector(`tr[key="${rowId}"] td[key=${column}]`);
cell.innerHTML = this._getCellHTML(column, this._getRecord(rowId));
cell.classList.remove('dgrid-changed', 'dgrid-error', 'dgrid-warning');
const cellClassList = [];
if (this._isChanged(rowId, this._getBindParam(column))) {
cellClassList.push('dgrid-changed');
}
if (this._hasError(rowId, this._getBindParam(column))) {
cellClassList.push('dgrid-error');
}
if (this._hasWarning(rowId, this._getBindParam(column))) {
cellClassList.push('dgrid-warning');
}
cell.classList.add(...cellClassList);
},
_focusSelf = () => {
(ReactDOM.findDOMNode(this) as HTMLElement).focus();
};