Skip to content

Commit

Permalink
fix prettier trailing
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Sep 30, 2020
1 parent 609a01b commit 5807919
Show file tree
Hide file tree
Showing 148 changed files with 722 additions and 733 deletions.
1 change: 1 addition & 0 deletions .prettierrc
@@ -1,6 +1,7 @@
# https://github.com/prettier/prettier#configuration-file
semi: true
singleQuote: true
trailingComma: none
overrides:
- files: ".prettierrc"
options:
Expand Down
34 changes: 17 additions & 17 deletions src/AreaChart/AreaChart.story.tsx
Expand Up @@ -10,7 +10,7 @@ import {
singleDateBigIntData,
randomNumber,
nonZeroDateData,
longMultiDateData,
longMultiDateData
} from '../../demo';
import { AreaChart } from './AreaChart';
import { StackedNormalizedAreaChart } from './StackedNormalizedAreaChart';
Expand All @@ -22,7 +22,7 @@ import {
Line,
StackedAreaSeries,
StackedNormalizedAreaSeries,
PointSeries,
PointSeries
} from './AreaSeries';
import { GridlineSeries, Gridline } from '../common/Gridline';
import {
Expand All @@ -31,7 +31,7 @@ import {
LinearYAxis,
LinearYAxisTickSeries,
LinearYAxisTickLabel,
LinearXAxisTickLabel,
LinearXAxisTickLabel
} from '../common/Axis/LinearAxis';
import { ScatterPoint } from '../ScatterPlot';
import { symbol, symbolStar } from 'd3-shape';
Expand All @@ -54,7 +54,7 @@ storiesOf('Charts/Area Chart/Single Series', module)
{
linear: 'linear',
step: 'step',
smooth: 'smooth',
smooth: 'smooth'
},
'linear'
);
Expand Down Expand Up @@ -91,7 +91,7 @@ storiesOf('Charts/Area Chart/Single Series', module)
<Gradient
stops={[
<GradientStop offset="10%" stopOpacity={0} />,
<GradientStop offset="80%" stopOpacity={1} />,
<GradientStop offset="80%" stopOpacity={1} />
]}
/>
}
Expand Down Expand Up @@ -144,7 +144,7 @@ storiesOf('Charts/Area Chart/Single Series', module)
height: '250px',
border: 'solid 1px green',
margin: '25px',
display: 'inline-block',
display: 'inline-block'
}}
>
<AreaChart data={singleDateData} />
Expand Down Expand Up @@ -335,7 +335,7 @@ storiesOf('Charts/Area Chart/Circle Series', module)
style={{
fill: 'lime',
stroke: 'purple',
strokeWidth: 1.5,
strokeWidth: 1.5
}}
/>
);
Expand All @@ -358,14 +358,14 @@ storiesOf('Charts/Area Chart/Axis', module)
{
key: 'Before',
data: 0,
x: 'Before',
x: 'Before'
},
{
key: 'After',
data: 0,
x: 'After',
},
],
x: 'After'
}
]
});

return (
Expand Down Expand Up @@ -401,7 +401,7 @@ storiesOf('Charts/Area Chart/Axis', module)
label={<LinearXAxisTickLabel padding={20} position="start" />}
/>
}
/>,
/>
]}
yAxis={<LinearYAxis type="value" axisLine={null} />}
/>
Expand All @@ -415,14 +415,14 @@ storiesOf('Charts/Area Chart/Axis', module)
{
key: 'Low',
data: 0,
y: 'Low',
y: 'Low'
},
{
key: 'High',
data: 0,
y: 'High',
},
],
y: 'High'
}
]
});

return (
Expand Down Expand Up @@ -462,7 +462,7 @@ storiesOf('Charts/Area Chart/Axis', module)
}
/>
}
/>,
/>
]}
xAxis={<LinearXAxis type="time" axisLine={null} />}
/>
Expand Down
24 changes: 12 additions & 12 deletions src/AreaChart/AreaChart.tsx
Expand Up @@ -7,7 +7,7 @@ import {
LinearAxisProps,
LinearXAxis,
LinearYAxis,
LinearAxis,
LinearAxis
} from '../common/Axis/LinearAxis';
import { getXScale, getYScale } from '../common/scales';
import { GridlineSeries, GridlineSeriesProps } from '../common/Gridline';
Expand All @@ -19,19 +19,19 @@ import {
buildStackData,
buildShallowChartData,
ChartShallowDataShape,
buildNestedChartData,
buildNestedChartData
} from '../common/data';
import css from './AreaChart.module.scss';
import { ChartBrushProps, ChartBrush } from '../common/Brush';
import {
ZoomPanChangeEvent,
ChartZoomPanProps,
ChartZoomPan,
ChartZoomPan
} from '../common/ZoomPan';
import {
ChartContainerChildProps,
ChartContainer,
ChartProps,
ChartProps
} from '../common/containers/ChartContainer';
import { CloneElement } from '../common/utils/children';
import memoize from 'memoize-one';
Expand Down Expand Up @@ -93,7 +93,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
series: <AreaSeries />,
gridlines: <GridlineSeries />,
brush: null,
zoomPan: null,
zoomPan: null
};

static getDerivedStateFromProps(
Expand All @@ -105,7 +105,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
if (!state.zoomControlled && zoom.domain !== state.zoomDomain) {
return {
zoomDomain: zoom.domain,
isZoomed: !!zoom.domain,
isZoomed: !!zoom.domain
};
}
}
Expand All @@ -124,7 +124,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
this.state = {
zoomDomain: zoom.domain,
isZoomed: !!zoom.domain,
zoomControlled,
zoomControlled
};
}

Expand Down Expand Up @@ -156,7 +156,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
roundDomains: xAxis.props.roundDomains,
data,
domain: zoomDomain || xAxis.props.domain,
isMultiSeries,
isMultiSeries
});

const yScale = getYScale({
Expand All @@ -165,7 +165,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
height: chartHeight,
data,
domain: yAxis.props.domain,
isMultiSeries,
isMultiSeries
});

return { xScale, yScale };
Expand All @@ -176,7 +176,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
this.setState({
zoomDomain: event.domain,
isZoomed: event.isZoomed,
preventAnimation: true,
preventAnimation: true
});

clearTimeout(this.timeout);
Expand All @@ -196,7 +196,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
gridlines,
brush,
zoomPan,
secondaryAxis,
secondaryAxis
} = this.props;
const { zoomDomain, preventAnimation, isZoomed } = this.state;

Expand Down Expand Up @@ -295,7 +295,7 @@ export class AreaChart extends Component<AreaChartProps, AreaChartState> {
height,
margins,
className,
series,
series
} = this.props;

return (
Expand Down
22 changes: 11 additions & 11 deletions src/AreaChart/AreaSeries/Area.tsx
Expand Up @@ -4,16 +4,16 @@ import { Gradient, GradientProps } from '../../common/Gradient';
import { Mask, MaskProps } from '../../common/Mask';
import {
interpolate,
InterpolationTypes,
InterpolationTypes
} from '../../common/utils/interpolation';
import {
ChartInternalDataShape,
ChartInternalShallowDataShape,
ChartInternalShallowDataShape
} from '../../common/data';
import { CloneElement } from '../../common/utils/children';
import {
constructFunctionProps,
PropFunctionTypes,
PropFunctionTypes
} from '../../common/utils/functions';
import { MotionPath, DEFAULT_TRANSITION } from '../../common/Motion';

Expand Down Expand Up @@ -72,7 +72,7 @@ export interface AreaProps extends PropFunctionTypes {
export class Area extends Component<AreaProps> {
static defaultProps: Partial<AreaProps> = {
gradient: <Gradient />,
interpolation: 'linear',
interpolation: 'linear'
};

getAreaPath(data: ChartInternalShallowDataShape[]) {
Expand All @@ -95,15 +95,15 @@ export class Area extends Component<AreaProps> {
x1: xScale(item.x) - xScale(item.x1),
y: yScale(item.y),
y0: yScale(item.y0),
y1: yScale(item.y1),
y1: yScale(item.y1)
})) as ChartInternalShallowDataShape[];
}

getAreaEnter(coords: ChartInternalShallowDataShape[]) {
const areaPath = this.getAreaPath(coords);

return {
d: areaPath === null ? undefined : areaPath,
d: areaPath === null ? undefined : areaPath
};
}

Expand All @@ -115,13 +115,13 @@ export class Area extends Component<AreaProps> {
x1: 0,
y: 0,
y1: maxY,
y0: maxY,
y0: maxY
})) as ChartInternalShallowDataShape[];

const areaPath = this.getAreaPath(coords);

return {
d: areaPath === null ? undefined : areaPath,
d: areaPath === null ? undefined : areaPath
};
}

Expand All @@ -145,12 +145,12 @@ export class Area extends Component<AreaProps> {
if (animated) {
return {
...DEFAULT_TRANSITION,
delay: index * 0.05,
delay: index * 0.05
};
} else {
return {
type: false,
delay: 0,
delay: 0
};
}
}
Expand All @@ -173,7 +173,7 @@ export class Area extends Component<AreaProps> {
transition={transition}
custom={{
enter,
exit,
exit
}}
/>
);
Expand Down
18 changes: 9 additions & 9 deletions src/AreaChart/AreaSeries/AreaSeries.tsx
Expand Up @@ -5,13 +5,13 @@ import { MarkLine, MarkLineProps } from '../../common/MarkLine';
import {
ChartInternalDataShape,
ChartInternalNestedDataShape,
ChartInternalShallowDataShape,
ChartInternalShallowDataShape
} from '../../common/data';
import { CloneElement } from '../../common/utils/children';
import {
TooltipArea,
TooltipAreaProps,
TooltipAreaEvent,
TooltipAreaEvent
} from '../../common/Tooltip';
import { Line, LineProps } from './Line';
import { InterpolationTypes } from '../../common/utils/interpolation';
Expand Down Expand Up @@ -126,7 +126,7 @@ export class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
area: <Area />,
markLine: <MarkLine />,
tooltip: <TooltipArea />,
symbols: <PointSeries />,
symbols: <PointSeries />
};

state: AreaSeriesState = {};
Expand All @@ -142,21 +142,21 @@ export class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
active: activeValues,
point,
index,
key,
key
});
}

onValueEnter(event: TooltipAreaEvent) {
this.setState({
activePoint: event.pointX,
activeValues: event.value,
activeValues: event.value
});
}

onValueLeave() {
this.setState({
activePoint: undefined,
activeValues: undefined,
activeValues: undefined
});
}

Expand All @@ -169,7 +169,7 @@ export class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
area,
line,
interpolation,
animated,
animated
} = this.props;

return (
Expand Down Expand Up @@ -214,7 +214,7 @@ export class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
height,
width,
animated,
area,
area
} = this.props;
const { activeValues } = this.state;

Expand Down Expand Up @@ -306,7 +306,7 @@ export class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
tooltip,
xScale,
yScale,
type,
type
} = this.props;
const isMulti =
type === 'grouped' || type === 'stacked' || type === 'stackedNormalized';
Expand Down

0 comments on commit 5807919

Please sign in to comment.