-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(radar): improve @nivo/radar package
- Loading branch information
Raphaël Benitte
authored and
Raphaël Benitte
committed
Apr 17, 2019
1 parent
80b281c
commit 96e60be
Showing
17 changed files
with
834 additions
and
829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import { useMemo } from 'react' | ||
import { curveFromProp } from '../props' | ||
|
||
/** | ||
* Transform d3 curve interpolation identifier | ||
* to its corresponding interpolator. | ||
*/ | ||
export const useCurveInterpolation = interpolation => | ||
useMemo(() => curveFromProp(interpolation), [interpolation]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import { Component } from 'react' | ||
import { Box, MotionProps, Dimensions, Theme } from '@nivo/core' | ||
import { OrdinalColorsInstruction, InheritedColorProp } from '@nivo/colors' | ||
import { LegendProps } from '@nivo/legends' | ||
|
||
declare module '@nivo/radar' { | ||
interface CommonRadarProps<Datum = any> { | ||
data: object[] | ||
keys: Array<string | number> | ||
indexBy: number | string | Function | ||
maxValue?: 'auto' | Function | ||
|
||
margin?: Box | ||
|
||
curve?: string | ||
|
||
borderWidth?: number | ||
borderColor?: InheritedColorProp | ||
|
||
gridLevels?: number | ||
gridShape?: 'circular' | 'linear' | ||
gridLabel?: Function | ||
gridLabelOffset?: number | ||
|
||
enableDots?: boolean | ||
dotSymbol?: Function | ||
dotSize?: number | ||
dotColor?: InheritedColorProp | ||
dotBorderWidth?: number | ||
dotBorderColor?: InheritedColorProp | ||
enableDotLabel?: boolean | ||
dotLabel?: string | Function | ||
dotLabelFormat?: string | Function | ||
dotLabelYOffset?: number | ||
|
||
colors?: OrdinalColorsInstruction | ||
fillOpacity?: number | ||
|
||
isInteractive?: boolean | ||
tooltipFormat?: string | Function | ||
|
||
legends: LegendProps[] | ||
} | ||
|
||
export type RadarProps = CommonRadarProps & MotionProps | ||
|
||
export class Radar extends Component<RadarProps & Dimensions> {} | ||
export class ResponsiveRadar extends Component<RadarProps> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.