mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
[revert] reverting big num changes (#2567)
* Revert "[big num] make sure scatterplot dots align properly (#2559)" This reverts commitf24ddfd467. * Revert "Revert "measure x axis labels too and use the longest to determine margins" (#2550)" This reverts commitfe68bc31c3. * Revert "[bug num vis] fix sizing for single digits (#2548)" This reverts commit3d2c791ff1. * revert all big num changes. * fix linting * make document global, fix linting
This commit is contained in:
@@ -57,22 +57,19 @@ class ChartContainer extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (this.shouldRenderViz(prevProps)) {
|
||||
if (
|
||||
(
|
||||
prevProps.queryResponse !== this.props.queryResponse ||
|
||||
prevProps.height !== this.props.height ||
|
||||
this.props.triggerRender
|
||||
) && !this.props.queryResponse.error
|
||||
&& this.props.chartStatus !== 'failed'
|
||||
&& this.props.chartStatus !== 'stopped'
|
||||
) {
|
||||
this.renderViz();
|
||||
}
|
||||
}
|
||||
|
||||
shouldRenderViz(prevProps) {
|
||||
const hasHeightChanged = prevProps.height !== this.props.height;
|
||||
const hasQueryChanged = prevProps.queryResponse !== this.props.queryResponse;
|
||||
const hasErrors = this.props.queryResponse && this.props.queryResponse.error;
|
||||
|
||||
return (hasQueryChanged || hasHeightChanged || this.props.triggerRender)
|
||||
&& !hasErrors
|
||||
&& this.props.chartStatus !== 'failed'
|
||||
&& this.props.chartStatus !== 'stopped';
|
||||
}
|
||||
|
||||
getMockedSliceObject() {
|
||||
const props = this.props;
|
||||
const getHeight = () => {
|
||||
@@ -105,7 +102,7 @@ class ChartContainer extends React.PureComponent {
|
||||
|
||||
height: getHeight,
|
||||
|
||||
render_template: function (s) {
|
||||
render_template: (s) => {
|
||||
const context = {
|
||||
width: this.width,
|
||||
height: this.height,
|
||||
|
||||
@@ -189,14 +189,6 @@ export function customizeToolTip(chart, xAxisFormatter, yAxisFormatters) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getTextWidth(text, fontDetails) {
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
context.font = fontDetails;
|
||||
const metrics = context.measureText(text);
|
||||
return metrics.width;
|
||||
}
|
||||
|
||||
export function initJQueryAjaxCSRF() {
|
||||
// Works in conjunction with a Flask-WTF token as described here:
|
||||
// http://flask-wtf.readthedocs.io/en/stable/csrf.html#javascript-requests
|
||||
|
||||
Reference in New Issue
Block a user