Skip to content

Commit

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

This reverts commit f24ddfd.
  • Loading branch information
alanna scott committed Apr 6, 2017
1 parent c581ea8 commit 4604984
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions superset/assets/visualizations/big_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ function bigNumberVis(slice, payload) {
const valueExt = d3.extent(data, (d) => d[1]);
const yAxisLabelWidths = valueExt.map(value => getTextWidth(f(value), '10px Roboto'));
const yAxisMaxWidth = Math.max(...yAxisLabelWidths);
let margin = yAxisMaxWidth + (yAxisMaxWidth / 2);
// make sure margin is minimum 30px, for the case when the y axix label is very small.
if (margin < 30) margin = 30;
const margin = yAxisMaxWidth + (yAxisMaxWidth / 2);

const scaleX = d3.time.scale.utc().domain(dateExt).range([margin, width - margin]);
const scaleY = d3.scale.linear().domain(valueExt).range([height - (margin), margin]);
const colorRange = [d3.hsl(0, 1, 0.3), d3.hsl(120, 1, 0.3)];
Expand All @@ -64,7 +63,7 @@ function bigNumberVis(slice, payload) {
const line = d3.svg.line()
.x(d => scaleX(d[0]))
.y(d => scaleY(d[1]))
.interpolate('cardinal');
.interpolate('basis');

let y = height / 2;
let g = svg.append('g');
Expand Down

0 comments on commit 4604984

Please sign in to comment.