Skip to content

Commit

Permalink
fix linting and remove css
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Sep 5, 2018
1 parent 82a1039 commit 71065f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
13 changes: 0 additions & 13 deletions superset/assets/src/visualizations/MapBox/MapBox.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
.mapbox div.widget .slice_container {
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
overflow: hidden;
}

.mapbox div.widget .slice_container:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}

.mapbox .slice_container div {
padding-top: 0px;
}
2 changes: 1 addition & 1 deletion superset/assets/src/visualizations/MapBox/MapBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class MapBox extends React.Component {
compositeOperation={'screen'}
renderWhileDragging={renderWhileDragging}
aggregatorName={aggregatorName}
lngLatAccessor={location => {
lngLatAccessor={(location) => {
const coordinates = location.get('geometry').get('coordinates');
return [coordinates.get(0), coordinates.get(1)];
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ const contextTypes = {
};

class ScatterPlotGlowOverlay extends React.Component {
constructor(props) {
super(props);
this.setCanvasRef = this.setCanvasRef.bind(this);
}

componentDidMount() {
this.redraw();
}

componentDidUpdate() {
this.redraw();
}

setCanvasRef(element) {
this.canvas = element;
}

drawText(ctx, pixel, options = {}) {
const IS_DARK_THRESHOLD = 110;
const { fontHeight = 0, label = '', radius = 0, rgb = [0, 0, 0], shadow = false } = options;
Expand Down Expand Up @@ -197,9 +207,9 @@ class ScatterPlotGlowOverlay extends React.Component {
}
}, this);
}

ctx.restore();
}

render() {
let width = 0;
let height = 0;
Expand All @@ -211,7 +221,7 @@ class ScatterPlotGlowOverlay extends React.Component {
const pixelRatio = window.devicePixelRatio || 1;
return (
<canvas
ref={(c) => { this.canvas = c; }}
ref={this.setCanvasRef}
width={width * pixelRatio}
height={height * pixelRatio}
style={{
Expand Down

0 comments on commit 71065f9

Please sign in to comment.