Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[revert] reverting big num changes #2567

Merged
merged 6 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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