Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed Sep 9, 2021
1 parent 0388815 commit e5dc2f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function WordcloudTile() {
<GalleryTile
title="Wordcloud"
description="<Wordcloud />"
exampleRenderer={size => <Wordcloud width={size.width} height={size.height} />}
exampleRenderer={(size) => <Wordcloud width={size.width} height={size.height} />}
exampleUrl="/wordcloud"
tileStyles={tileStyles}
detailsStyles={detailsStyles}
Expand Down
11 changes: 7 additions & 4 deletions packages/visx-demo/src/sandboxes/visx-wordcloud/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function wordFreq(text: string): WordData[] {
if (!freqMap[w]) freqMap[w] = 0;
freqMap[w] += 1;
}
return Object.keys(freqMap).map(word => ({ text: word, value: freqMap[word] }));
return Object.keys(freqMap).map((word) => ({ text: word, value: freqMap[word] }));
}

function getRotationDegree() {
Expand All @@ -37,7 +37,7 @@ function getRotationDegree() {
const words = wordFreq(totoAfricaLyrics);

const fontScale = scaleLog({
domain: [Math.min(...words.map(w => w.value)), Math.max(...words.map(w => w.value))],
domain: [Math.min(...words.map((w) => w.value)), Math.max(...words.map((w) => w.value))],
range: [10, 100],
});
const fontSizeSetter = (datum: WordData) => fontScale(datum.value);
Expand All @@ -63,7 +63,7 @@ export default function Example({ width, height, showControls }: ExampleProps) {
rotate={withRotation ? getRotationDegree : 0}
random={fixedValueGenerator}
>
{cloudWords =>
{(cloudWords) =>
cloudWords.map((w, i) => (
<Text
key={w.text}
Expand All @@ -82,7 +82,10 @@ export default function Example({ width, height, showControls }: ExampleProps) {
<div>
<label>
Spiral type &nbsp;
<select onChange={e => setSpiralType(e.target.value as SpiralType)} value={spiralType}>
<select
onChange={(e) => setSpiralType(e.target.value as SpiralType)}
value={spiralType}
>
<option key={'archimedean'} value={'archimedean'}>
archimedean
</option>
Expand Down
1 change: 0 additions & 1 deletion packages/visx-stats/src/ViolinPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default function ViolinPlot<Datum extends object>({
const leftCurvePath = leftCurve([...data].reverse()) || '';
path = `${rightCurvePath} ${leftCurvePath.replace('M', 'L')} Z`;
}
// eslint-disable-next-line react/jsx-no-useless-fragment
if (children) return <>{children({ path })}</>;
return <path className={cx('visx-violin', className)} d={path} {...restProps} />;
}
9 changes: 4 additions & 5 deletions packages/visx-zoom/src/Zoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type ZoomProps<ElementType> = {
* ```
*
* A function that returns { scaleX,scaleY } factors to scale the matrix by.
* Scale factors greater than 1 will increase (zoom in), less than 1 will descrease (zoom out).
* Scale factors greater than 1 will increase (zoom in), less than 1 will decrease (zoom out).
*/
wheelDelta?: (event: React.WheelEvent | WheelEvent) => Scale;
/**
Expand All @@ -58,7 +58,7 @@ export type ZoomProps<ElementType> = {
* ```
*
* A function that returns { scaleX, scaleY, point } factors to scale the matrix by.
* Scale factors greater than 1 will increase (zoom in), less than 1 will descrease (zoom out), the point is used to find where to zoom.
* Scale factors greater than 1 will increase (zoom in), less than 1 will decrease (zoom out), the point is used to find where to zoom.
* The state parameter is from react-use-gestures onPinch handler
*/
pinchDelta?: PinchDelta;
Expand Down Expand Up @@ -142,7 +142,7 @@ function Zoom<ElementType extends Element>({

const setTransformMatrix = useCallback(
(newTransformMatrix: TransformMatrix) => {
setTransformMatrixState(prevTransformMatrix => {
setTransformMatrixState((prevTransformMatrix) => {
const updatedTransformMatrix = defaultConstrain(newTransformMatrix, prevTransformMatrix);
matrixStateRef.current = updatedTransformMatrix;
return updatedTransformMatrix;
Expand Down Expand Up @@ -270,7 +270,7 @@ function Zoom<ElementType extends Element>({
);

const handlePinch: UserHandlers['onPinch'] = useCallback(
state => {
(state) => {
const {
origin: [ox, oy],
memo,
Expand Down Expand Up @@ -356,7 +356,6 @@ function Zoom<ElementType extends Element>({
containerRef,
};

// eslint-disable-next-line react/jsx-no-useless-fragment
return <>{children(zoom)}</>;
}

Expand Down

0 comments on commit e5dc2f8

Please sign in to comment.