Skip to content

Commit

Permalink
feat(pie): remove definitions file to types
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Nov 5, 2020
1 parent f0c6ca8 commit e84d3a9
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
10 changes: 7 additions & 3 deletions packages/pie/src/Pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
import React, { ReactNode, Fragment, createElement } from 'react'
// @ts-ignore
import { withContainer, SvgWrapper, bindDefs, useTheme, useDimensions } from '@nivo/core'
// @ts-ignore
import { useInheritedColor, OrdinalColorsInstruction, InheritedColorProp } from '@nivo/colors'
import {
// @ts-ignore
useInheritedColor,
OrdinalColorsInstruction,
InheritedColorProp,
} from '@nivo/colors'
import { PieSlice } from './PieSlice'
import { RadialLabels } from './RadialLabels'
import { SliceLabels } from './SliceLabels'
import PieLegends from './PieLegends'
import { useNormalizedData, usePieFromBox, usePieLayerContext } from './hooks'
import { ComputedDatum, PieLayer, PieSvgProps, PieLayerId } from './definitions'
import { ComputedDatum, PieLayer, PieSvgProps, PieLayerId } from './types'
import { defaultProps } from './props'

// prettier-ignore
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/PieSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { createElement, useCallback } from 'react'
// @ts-ignore
import { useTooltip } from '@nivo/tooltip'
import { ComputedDatum, CompletePieSvgProps } from './definitions'
import { ComputedDatum, CompletePieSvgProps } from './types'

interface PieSliceProps<R> {
datum: ComputedDatum<R>
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/PieTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import React from 'react'
import { BasicTooltip } from '@nivo/tooltip'
import { ComputedDatum } from './definitions'
import { ComputedDatum } from './types'

// prettier-ignore
export const PieTooltip = <R, >({ datum }: { datum: ComputedDatum<R> }) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/RadialLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React from 'react'
import { line } from 'd3-shape'
// @ts-ignore
import { textPropsByEngine, useTheme } from '@nivo/core'
import { RadialLabelData, Point } from './definitions'
import { RadialLabelData, Point } from './types'

const lineGenerator = line()
.x((d: Point) => d.x)
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/RadialLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react'
import { usePieRadialLabels } from './hooks'
import { RadialLabel } from './RadialLabel'
import { ComputedDatum, CompletePieSvgProps } from './definitions'
import { ComputedDatum, CompletePieSvgProps } from './types'

interface RadialLabelsProps<R> {
dataWithArc: ComputedDatum<R>[]
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/ResponsivePie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react'
// @ts-ignore
import { ResponsiveWrapper } from '@nivo/core'
import Pie from './Pie'
import { PieSvgProps } from './definitions'
import { PieSvgProps } from './types'

// prettier-ignore
const ResponsivePie = <R, >(props: Omit<PieSvgProps<R>, 'width' | 'height'>) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
LabelAccessorFunction,
PieCustomLayerProps,
RadialLabelData,
} from './definitions'
} from './types'

/**
* Format data so that we get a consistent data structure.
Expand Down
2 changes: 1 addition & 1 deletion packages/pie/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export { default as PieCanvas } from './PieCanvas'
export { default as ResponsivePieCanvas } from './ResponsivePieCanvas'
export * from './props'
export * from './hooks'
export * from './definitions'
export * from './types'
File renamed without changes.

0 comments on commit e84d3a9

Please sign in to comment.