Skip to content

Commit

Permalink
NIFI-14090: Removing unused code now that the resize handle has been …
Browse files Browse the repository at this point in the history
…removed from the status history table. (apache#9584)

- Remove references to computedStyleMap which is not supported in Firefox.
  • Loading branch information
mcgilman authored Dec 17, 2024
1 parent bd11074 commit f330f23
Showing 1 changed file with 2 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,9 @@ export class StatusHistoryChart implements OnDestroy {
// clear out the dom for the chart
chartContainer.replaceChildren();

// calculate the dimensions
chartContainer.setAttribute('height', this.getChartMinHeight() + 'px');

// determine the new width/height
let width = chartContainer.clientWidth - margin.left - margin.right;
let height = chartContainer.clientHeight - margin.top - margin.bottom;

const maxWidth = Math.min(chartContainer.clientWidth, this.getChartMaxWidth());
if (width > maxWidth) {
width = maxWidth;
}

const maxHeight = this.getChartMaxHeight();
if (height > maxHeight) {
height = maxHeight;
}
const width = chartContainer.clientWidth - margin.left - margin.right;
const height = chartContainer.clientHeight - margin.top - margin.bottom;

// define the x axis for the main chart
const x = d3.scaleTime().range([0, width]);
Expand Down Expand Up @@ -618,52 +605,6 @@ export class StatusHistoryChart implements OnDestroy {
brushed();
}

private getChartMinHeight() {
const chartContainer = document.getElementById('status-history-chart-container')!;
const controlContainer = document.getElementById('status-history-chart-control-container')!;

const marginTop: any = controlContainer.computedStyleMap().get('margin-top');
return (
chartContainer.parentElement!.clientHeight - controlContainer.clientHeight - parseInt(marginTop.value, 10)
);
}

private getChartMaxHeight() {
const controlContainer = document.getElementById('status-history-chart-control-container')!;

const marginTop: any = controlContainer.computedStyleMap().get('margin-top');
const statusHistory = document.getElementsByClassName('status-history')![0];
const dialogContent = statusHistory.getElementsByClassName('status-history-dialog-content')![0];
const descriptorContainer = document.getElementsByClassName('selected-descriptor-container')![0];
const dialogStyles: any = dialogContent.computedStyleMap();
const bodyHeight = document.body.getBoundingClientRect().height;

return (
bodyHeight -
controlContainer.clientHeight -
descriptorContainer.clientHeight -
parseInt(marginTop.value, 10) -
parseInt(dialogStyles.get('top')?.value) -
parseInt(dialogStyles.get('bottom')?.value)
);
}

private getChartMaxWidth() {
const statusHistory = document.getElementsByClassName('status-history')![0];
const dialogContent = statusHistory.getElementsByClassName('status-history-dialog-content')![0];
const dialogContentStyles: any = dialogContent.computedStyleMap();
const fullDialogStyles: any = statusHistory.computedStyleMap();
const bodyWidth = document.body.getBoundingClientRect().width;

return (
bodyWidth -
statusHistory.clientWidth -
parseInt(fullDialogStyles.get('left')?.value, 10) -
parseInt(dialogContentStyles.get('left')?.value) -
parseInt(dialogContentStyles.get('right')?.value)
);
}

private getMinValue(nodeInstances: any): any {
return d3.min(nodeInstances, (d: any) => {
return d3.min(d.values, (s: any) => s.value);
Expand Down

0 comments on commit f330f23

Please sign in to comment.