GithubHelp home page GithubHelp logo

plouc / nivo Goto Github PK

View Code? Open in Web Editor NEW
12.6K 77.0 990.0 403.86 MB

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries

Home Page: https://nivo.rocks

License: MIT License

JavaScript 9.62% CSS 1.10% Makefile 0.34% TypeScript 88.93% Procfile 0.01% HTML 0.01%
dataviz react d3js isomorphic svg charts components canvas

nivo's Introduction

nivo

Backers on Open Collective Sponsors on Open Collective License GitHub Actions NPM version nivo channel on discord

nivo provides supercharged React components to easily build dataviz apps, it's built on top of d3.

Several libraries already exist for React d3 integration, but just a few provide server side rendering ability and fully declarative charts.

Installation

In order to use nivo, you have to install the @nivo/core package and then choose some of the scoped @nivo packages according to the charts you wish to use:

yarn add @nivo/core @nivo/bar

Features

Discussion

Join the nivo discord community.

Packages & components

nivo is comprised of several packages/components, for a full list, please use the Components Explorer.

Guides

Backers

Donations are welcome to help improving nivo [Become a backer]

Open Collective Sponsors

Support this project by becoming a sponsor, your logo will show up here with a link to your website. [Become a sponsor]

nivo's People

Contributors

aautem avatar ahtohbi4 avatar ahyoungryu avatar alaazorkane avatar andre19980 avatar andriuss avatar benjamintd avatar bobylito avatar brammitch avatar bripkens avatar byronbecker avatar conanak99 avatar dependabot[bot] avatar johnolos avatar kaadash avatar martingordon avatar mjsarfatti avatar ollwenjones avatar onionhammer avatar pcorpet avatar pierrvanroy avatar plouc avatar recurser avatar scalabw avatar sebasquirogaucp avatar stuartlong avatar tg970 avatar tkonopka avatar vianneyguesdon avatar wyze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nivo's Issues

Improve tooltip position

For now, tooltip is always placed on right of the current cursor, it could be placed according to container size.

Support for events (onClick etc.)

I noticed there is an onClick prop in chart component, but it's probably not used for anything right now. Do you plan on implementing some basic events with access to data of clicked element? I am currently trying to implement bar chart with onClick event (to filter in hourly data). It should also have formatted tooltip. I really like your library, it has beautiful visuals and very useful options, but I sadly need onclick for my use case.

Re-add missing Sankey from demo site

The title captures the gist of it. The sankey diagram is not on the demo site. It is linked by the README but leads to a blank page. With that in mind, there may be others.

Thanks for the great project!

IE11 endsWith polyfill

I tried to look at the demo at http://nivo.rocks/ using IE11

Error on endsWith:

export var closedCurvePropKeys = curvePropKeys.filter(function (c) {
return c.endsWith('Closed');
});

Polyfill, if you care to add, or you could use ES6-shim as there might be more issues:

if (!String.prototype.endsWith)
String.prototype.endsWith = function(searchStr, Position) {
// This works much better than >= because
// it compensates for NaN:
if (!(Position < this.length))
Position = this.length;
else
Position |= 0; // round position
return this.substr(Position - searchStr.length,
searchStr.length) === searchStr;
};

IE sucks, but some of us are forced to use it exclusively at work.

Some blabbing about the issue:
https://www.sitepoint.com/community/t/endswith-issue-in-ie11/233838

Bubble component

Hello! I'm trying to find a way to group bubbles by color in the same parent so it looks like this:

screen shot 2017-09-15 at 10 50 30 am

Is there an easy way to do it?

Bubble components

  • <Bubble />
  • <RepsonsiveBubble />
  • <BubbleD3 />
  • <RepsonsiveBubbleD3 />
  • <BubblePlaceholders /> with support for html & svg
  • <RepsonsiveBubblePlaceholders />

Background nodes appear wrong after round-tripping "leavesOnly"

Steps to reproduce:

  1. Go to http://nivo.rocks/#/treemap
  2. Click on the leavesOnly toggle.
  3. Click on the leavesOnly toggle again.
  4. (Bonus) Roll The Dice

Expected result:

  • The treemap changes somehow, then changes back to how it looked before.
  • Changing source data looks fine

Observed results:

  1. Load page:
    image
  2. Leaves Only, On:
    image
  3. Leaves Only, Off:
    image
  4. Roll The Dice:
    image

Also

Leaves Only says

Only render leaf nodes (no children).

Shouldn't that be (no parents)?

ResponsivePie not rendering anything.

I try to output a Pie chart, but the responsive pie chart only outputs an empty div:

<div style="width: 100%; height: 100%;"></div>

My settings look like this (and I use the sample data from website):

const settings = {
      width: 300,
      height: 300,
      margin: { top: 10, right: 10, bottom: 10, left: 10 },
      innerRadius: 0.9,
      cornerRadius: 3,
      padAngle: 1,
      enableSlicesLabels: false,
      enableRadialLabels: false,
      isInteractive: false,
    };

It does not work if I remove width/height either. Am I doing something wrong?

Problem with http://nivo.rocks

I have tried to visit the website and got an error (waterfox screenshot):

selection_001

Also, to double-confirm the issue, I have tested it via curl:

stefanos@debian:~$ curl -vI https://nivo.rocks/
*   Trying 104.18.44.131...
* TCP_NODELAY set
* Connected to nivo.rocks (104.18.44.131) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.0 (IN), TLS header, Unknown (21):
* TLSv1.0 (IN), TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* stopped the pause stream!
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

As you can see, on the ticket title I use http://nivo.works whereas in curl I use https protocol, because the link used in project description it redirects to https://nivo.rocks.

Cannot resolve 'file' or 'directory' ./BubbleProps

After Updating to nivo@^0.26.2:
ERROR in .//nivo/lib/components/charts/bubble/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./BubbleProps in */node_modules/nivo/lib/components/charts/bubble
@ ./
/nivo/lib/components/charts/bubble/index.js 41:19-43

Feature request: Canvas

Opening this so there's a way to track the "I'm also considering canvas support" comment from the README

Labels overflow on Pie chart

If I have a pie chart with labels, some labels end up outside of the drawn SVG and are since not shown:
image
In this image, I gave the SVG tag a gray border color so it is clear what is been cut off.

The code for the chart looks like this:

<Pie 
    data={this.props.chartData}
    height={500} 
    width={500}
    margin={{
      left: 10,
      right: 50,
      top: 10,
      bottom: 10
    }}
    // not relevant other info
 />

Animation when changing pie data

Great lib!

I was wondering why there were no animation when pie datas are updated?
It works for the line component for example and its nice.

Negative Values on <Chart />

Hello guys,

I'm trying to display negative values on a chart, they will display <> when all of them are negative, when there's more than one positive, anything below zero will be ignored, is there a way to have minY maxY config?

Regards,

Add ability to filter stack component layers

We should be able to hide certain layers from the Stack component.

Workflow:

  • user clicks on a layer
  • if there's more than 1 active layer
    • the layer disappear
    • a small circle having the same color appear to re-activate the hidden layer
    • if user clicks on the circle, the layer becomes active

This feature also have an impact on StackDots component.

Memoization

Some components requires intensive calculations when a property change, those calculations should be memoized in order to improve performance.

  • CalendarLayout monthPathAndBBox

Ability to customize hovering label

Hello! Is there currently a way to customize the label that shows in when one hovers over a section of a chart? For example, on the following Pie chart:
image
Say I want to display the number in a friendlier matter by formatting it the same way one formats the other labels (passing a string or a function that receives the node)

Only import from `d3-*` modules

There are a few files which import from d3 which brings in all the d3-* modules even if they aren't used. While webpack & rollup can mitigate this, they still leave many unused functions.

Looking through the code I found these examples:

# src/lib/charts/bubble/BubbleD3.js
import { hierarchy, pack } from 'd3'

# src/lib/scale.js
import { scaleLinear, scaleBand, scalePoint } from 'd3'

# src/lib/charts/labels.js
import d3 from 'd3'

#src/lib/charts/pie/PieD3Svg.js
import d3 from 'd3'

# src/lib/charts/bubble/BubbleD3Svg.js
import d3 from 'd3'

I apologize for the noise if I've simply found some loose ends that aren't used/exported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.