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

Clean up unused vars #83

Merged
merged 8 commits into from
Dec 9, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import {line as d3Line} from 'd3-shape';
import {scaleLinear, scaleOrdinal} from 'd3-scale';
import {schemeCategory10} from 'd3-scale-chromatic';
import {extent as d3Extent} from 'd3-array';
import {format as d3Format} from 'd3-format';

const colorScale = scaleOrdinal(schemeCategory10);
Expand Down Expand Up @@ -45,8 +44,7 @@ export default class Chart extends Component {
const {
data,
width,
height,
padding: {left, right, top},
padding: {right, top},
} = this.props;
if (!data || !data.lines) {
return null;
Expand Down Expand Up @@ -211,7 +209,6 @@ export default class Chart extends Component {
return null;
}

const {width, height} = this.props;
const xScale = this._getXScale();
const yScale = this._getYScale();

Expand All @@ -235,7 +232,6 @@ export default class Chart extends Component {
if (!data || !data.lines) {
return null;
}
const {width, height} = this.props;
const xScale = this._getXScale();
const yScale = this._getYScale();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export default class Chart extends Component {

_renderLeftBar() {
const {
extent: [[x0, y0], [x1, y1]],
extent: [[x0, y0], [, y1]],
} = this.props;
const x = this._getX();
return <rect x={x0} y={y0} width={x - x0} height={y1} fill="#3399ff" />;
}

_renderRightBar() {
const {
extent: [[x0, y0], [x1, y1]],
extent: [[, y0], [x1, y1]],
} = this.props;
const x = this._getX();
return <rect x={x} y={y0} width={x1 - x} height={y1} fill="#c2c2d6" />;
Expand All @@ -68,7 +68,7 @@ export default class Chart extends Component {
return null;
}
const {
extent: [[x0, y0], [x1, y1]],
extent: [[, y0], [, y1]],
leftLabel,
} = this.props;
const x = this._getX();
Expand All @@ -89,7 +89,7 @@ export default class Chart extends Component {
return null;
}
const {
extent: [[x0, y0], [x1, y1]],
extent: [[, y0], [, y1]],
rightLabel,
} = this.props;
const x = this._getX();
Expand Down Expand Up @@ -140,7 +140,7 @@ export default class Chart extends Component {
}
if (this.move) {
const [x, y] = this.props.getEventMouse(event);
const [sx, sy] = this.move;
const [sx] = this.move;
const dx = x - sx;
const mx = Math.min(Math.max(x + dx, x0), x1);
this.move = [x, y];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Chart extends Component {
render() {
const {
width,
height,
sliderValue,
padding: {top, bottom, left, right},
index,
Expand Down Expand Up @@ -75,7 +74,7 @@ class Chart extends Component {
onPointerMove={event => {
if (this.move) {
const [x, y] = this._getEventMouse(event);
const [sx, sy] = this.move;
const [sx] = this.move;
const dx = x - sx;
const mx = Math.min(Math.max(x + dx, left), width - right);
this.move = [x, y];
Expand All @@ -91,7 +90,7 @@ class Chart extends Component {
style={{
position: 'absolute',
left: x - 13,
top: '100%',
top: 'calc(100% - 3px)',
}}
>
{`${d3Format('2d')(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Chart extends Component {

getLeftLabel() {
const format = d3Format('.6f');
const {sliderValue, data, lineName} = this.props;
const {sliderValue, data} = this.props;
if (!data.length) {
return null;
}
Expand Down