Skip to content

Commit

Permalink
[revert] reverting big num changes (#2567)
Browse files Browse the repository at this point in the history
* Revert "[big num] make sure scatterplot dots align properly (#2559)"

This reverts commit f24ddfd.

* Revert "Revert "measure x axis labels too and use the longest to determine margins" (#2550)"

This reverts commit fe68bc3.

* Revert "[bug num vis] fix sizing for single digits (#2548)"

This reverts commit 3d2c791.

* revert all big num changes.

* fix linting

* make document global, fix linting
  • Loading branch information
Alanna Scott authored Apr 6, 2017
1 parent c581ea8 commit 1fb21b8
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 192 deletions.
6 changes: 3 additions & 3 deletions superset/assets/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"experimentalObjectRestSpread": true
}
},
"globals": {
"document": true,
},
"rules": {
"prefer-template": 0,
"new-cap": 0,
Expand All @@ -14,8 +17,5 @@
"func-names": 0,
"react/jsx-no-bind": 0,
"no-confusing-arrow": 0,
},
"globals": {
"document": true,
}
}
23 changes: 10 additions & 13 deletions superset/assets/javascripts/explorev2/components/ChartContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions superset/assets/javascripts/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 7 additions & 17 deletions superset/assets/visualizations/big_number.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
.big_number_total g.axis text {
font-size: 10px;
font-weight: normal;
color: #333333;
fill: #333333;
color: gray;
fill: gray;
text-anchor: middle;
alignment-baseline: middle;
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: none;
}

.big_number text.big,
.big_number_total text.big{
stroke: #333333;
stroke: black;
text-anchor: middle;
fill: #333333;
fill: black;
}

.big_number g.tick line,
Expand All @@ -25,16 +25,6 @@
.big_number .domain,
.big_number_total .domain{
fill: none;
stroke: #333333;
stroke: black;
stroke-width: 1;
}

.line-tooltip {
position: absolute;
text-align: left;
padding: 10px;
background: #ffffff;
border: 1px solid #ccc;
border-radius: 2px;
pointer-events: none;
}

Loading

0 comments on commit 1fb21b8

Please sign in to comment.