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

TypeScript definitions #197

Open
plouc opened this issue May 22, 2018 · 17 comments

Comments

@plouc
Copy link
Owner

commented May 22, 2018

This issue is used to track down the ongoing work on TypeScript definitions for nivo packages.

As nivo isn't built using TypeScript, it does not include definitions, if you're working in a TS environment and already created one for your use case, please do not hesitate to submit a PR!

  • @nivo/bar ResponsiveBar - #199
  • @nivo/bar ResponsiveBarCanvas - #199
  • @nivo/calendar ResponsiveCalendar - #223
  • @nivo/calendar ResponsiveCalendarCanvas
  • @nivo/chord ResponsiveChord
  • @nivo/chord ResponsiveChordCanvas
  • @nivo/circle-packing ResponsiveBubble
  • @nivo/circle-packing ResponsiveBubbleHtml
  • @nivo/circle-packing ResponsiveBubbleCanvas
  • @nivo/heatmap ResponsiveHeatMap - #198
  • @nivo/heatmap ResponsiveHeatMapCanvas - #198
  • @nivo/line ResponsiveLine - #316
  • @nivo/line ResponsiveLineCanvas
  • @nivo/pie ResponsivePie - #207
  • @nivo/radar ResponsiveRadar
  • @nivo/sankey ResponsiveSankey - #211
  • @nivo/scatterplot ResponsiveScatterPlot - #319
  • @nivo/scatterplot ResponsiveScatterPlotCanvas - #319
  • @nivo/stream ResponsiveStream
  • @nivo/sunburst ResponsiveSunburst
  • @nivo/treemap ResponsiveTreeMap
  • @nivo/treemap ResponsiveTreeMapHtml
  • @nivo/treemap ResponsiveTreeMapCanvas
  • @nivo/waffle ResponsiveWaffle - #202
  • @nivo/waffle ResponsiveWaffleHtml - #202
  • @nivo/waffle ResponsiveWaffleCanvas - #202
@plouc

This comment has been minimized.

Copy link
Owner Author

commented May 22, 2018

@kodedevil, if you're willing to contribute with sankey definition, please link your PR to this issue :)

@wyze

This comment has been minimized.

Copy link
Contributor

commented May 23, 2018

We use TypeScript in our project that contains nivo. A lot of the times we just use an empty declare module '@nivo/bar' in a global setting and move on. I'll definitely take some of these and contribute them so we can remove those from our project.

@kallebornemark

This comment has been minimized.

Copy link

commented Sep 18, 2018

@plouc It seems like the current Typescript definitions for ResponsiveBar requires one to provide a lot of props that are marked as optional in the docs, such as defs. Or am I missing something?

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Sep 18, 2018

@kallebornemark, the doc says they're not required, but in fact they are required but defaultProps are defined, recent TypeScript version supports this, so the definitions should be updated :/

@kallebornemark

This comment has been minimized.

Copy link

commented Sep 19, 2018

@plouc I see. Do you think still will happen anytime soon? We're looking for a sophisticated graph lib for our project, and yours looks really promising. We're very reliant on TS at the moment though.

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Sep 19, 2018

Not soon, I won't have much time to work on nivo in the upcoming weeks, but contributions are welcome :) All components have quite exhaustive prop types, it can help to write TS definitions.

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Oct 17, 2018

Support added for @nivo/line package

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Oct 18, 2018

Definitions added for @nivo/scatterplot package

@SaphuA

This comment has been minimized.

Copy link

commented Nov 14, 2018

As I don't have time right now to submit a pr (I might later) I'll use this place to sum up typescript issues I find as I go:

Bar v0.51

  • Axis is missing renderTick property.
  • Axis legendPosition contains center but should be middle.
  • I think colorBy and tooltip should receive BarExtendedDatum as prop instead of BarDatum.

Pie v0.51
- [ ] Small issue, but doing something like this colorBy={(datum) => datum.color} won't work because datum is of a specific type even though it could contain anything. Never mind, PieDatum has an indexer.

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Nov 14, 2018

@SaphuA, thank you

@plouc

This comment has been minimized.

Copy link
Owner Author

commented Apr 23, 2019

Definitions added for @nivo/chord => #526

@plouc

This comment has been minimized.

Copy link
Owner Author

commented May 5, 2019

legendPosition has been fixed

@plouc plouc referenced this issue May 18, 2019
0 of 4 tasks complete

@plouc plouc removed stream radar labels May 18, 2019

@plouc

This comment has been minimized.

Copy link
Owner Author

commented May 18, 2019

@nivo/stream & @nivo/radar now come with TypeScript definitions.

@sloanepetit

This comment has been minimized.

Copy link

commented Jun 3, 2019

Hi,

It seems that the cellComponent & legends props declarations are missing in the Waffle component.

@ralmo

This comment has been minimized.

Copy link

commented Aug 22, 2019

Great work! I'm starting with typescript and nivo and these definitions are a blessing.

I noticed two missing typings in LineCustomLayerProps though when attempting to do dashed lines by copying the custom line style example:

  • lineGenerator
  • areaGenerator
@latema

This comment has been minimized.

Copy link

commented Sep 6, 2019

The pointSymbol prop is missing from the LineProps interface in line typings. I created a PR for it: #681.

@felipap

This comment has been minimized.

Copy link

commented Sep 14, 2019

Hi there, has the Typescript issue with borderColor in @nivo/bar (#344) been fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.