Coder Social home page Coder Social logo

codesuki / react-d3-components Goto Github PK

View Code? Open in Web Editor NEW
1.6K 47.0 210.0 3.12 MB

D3 Components for React

Home Page: http://codesuki.github.io/react-d3-components/example.html

License: MIT License

CSS 1.52% JavaScript 81.56% HTML 16.92%
javascript react d3 graph chart charting-library charts waveform pie-chart area-chart chart-component

react-d3-components's Introduction

Looking for maintainers. If you are interested in maintaining this library please open an issue.

react-d3-components

D3 Components for React

Let React have complete control over the DOM even when using D3. This way we can benefit from Reacts Virtual DOM.

charts

Table of Contents

Installation

npm install react-d3-components

Development

In order to compile the code, from the repository folder, type in your terminal

npm install & npm run build:js

This will install the dependencies required and run the build:js. At the end of the process the compiled .js and min.js will be available in the dist folder. Examples are available in the folder example. From the root folder type

python -m SimpleHTTPServer 8000

to start a webserver, and navigate to http://localhost:8000/example in order to visualize the new example page. Note that the example page directly points to the dist folder.

Description

Ideally the library should be usable with minimum configuration. Just put the data in and see the charts. I try to provide sensible defaults, but since for most use-cases we need to customize D3's parameters they will be made accessible to the user. Most Charts will turn into their stacked variant when given an array as input.

If you like the project please consider starring and a pull request. I am open for any additions.

Documentation

Documentation is in the Wiki. For quick testing the examples might be enough.

Features

  • Brushes
  • Tooltips
  • Custom accessors to support any data format
  • Negative axes
  • CSS classes to allow styling
  • Bar Chart
  • Stacked Bar Chart
  • Scatter Plot
  • Line Chart
  • Area Chart
  • Stacked Area Chart
  • Pie Plot

Todo

  • More Charts
  • Animations
  • Legend
  • Documentation
  • Tests

Changelog

  • 0.6.6: Fix ticks rendering over bar chart
  • 0.6.5:
    • Add tickDirection property to Axis
    • Add hideLabels property to PieChart
    • Add yOrientation property to AreaChart
    • Fix Line Chart rendering
  • 0.6.4: Fixed react dependency version (was 0.15.0 instead of 15.0.0)
  • 0.6.3: Changed react dependency version to >=0.14.0 to allow react 0.15.
  • 0.6.2: Fixed build system. Added colorByLabel property to BarChart.
  • 0.6.1: Fixed 'BarChart.getDOMNode(...) is deprecated.'
  • 0.6.0: Added Waveform Chart. Moved to React 0.14.
  • 0.5.2: Fixed default scale for dates
  • 0.5.1: Fixed new props not being used by DefaultScalesMixin
  • 0.5.0:
    • Improved tooltip. (see example below)
      • Tooltip now has different modes.
      • AreaChart tooltip now contains x-value argument.
    • Support for grouped bar charts. (see example below)
    • Support to include child elements inside charts.
    • Several bug fixes including recent pull requests.
      • React is now a peer dependency
  • 0.4.8: Fixed bug were graphs don't resize correctly.
  • 0.4.7: Moved to React 0.13.1
  • 0.4.6:
    • Added sort property to PieChart, same usage as d3.Pie.sort().
    • Added support for strokeWidth, strokeDasharray, strokeLinecap to LineChart, can be string or function.
    • Small bug fixes.
  • 0.4.5: Fixed tooltip not showing when mouse is over tooltip symbol. Tooltip will soon be revamped to allow custom components.
  • 0.4.4: Fixed tooltip position inside relative layout containers. Moved to webpack.
  • 0.4.3: Fixed tooltip not showing in Safari.
  • 0.4.2: Improved LineChart tooltip to show d3.svg.symbol() on nearest data point. Can be customized with shape and shapeColor props. LineChart toolip callback is callback(label, value) now where the format of value depends on your data format, default is {x: x, y: y}.
  • 0.4.1: Fixed compatibility issues with Safari and possible other browsers not supporting Number.isFinite().
  • 0.4.0: Added X-Axis Brush. Functioning but might change to improve ease of usage etc. Fixed Axis tickFormat not being set correctly.
  • 0.3.6: Fixed not correctly requiring D3.
  • 0.3.5: Fixed npm packaging.
  • 0.3.4: Charts now render correctly when included in another component. Line chart default axes now meet at 0.
  • 0.3.0: Added tooltips and made axis properties accessible.
  • 0.2.2: Fixed accessors not being used everywhere
  • 0.2.1: Excluded external libraries from build and make it usable as a browser include
  • 0.2.0: Custom accessors, stacked charts, default scales

Examples

Check out example/index.html found here.

BarChart

var BarChart = ReactD3.BarChart;

var data = [{
    label: 'somethingA',
    values: [{x: 'SomethingA', y: 10}, {x: 'SomethingB', y: 4}, {x: 'SomethingC', y: 3}]
}];

React.render(
    <BarChart
        data={data}
        width={400}
        height={400}
        margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
    document.getElementById('location')
);

barchart

Brush

With Brushes we can build interactive Graphs. My personal use-case is to select date ranges as shown below and in the example. The Brush feature is still incomplete, for now only offering a x-Axis Brush but y-Axis will follow soon as well as refactoring. For now the Brush is rendered in its own SVG, this allows flexible use but might change in the future, or become optional. Also there is no Brush support for the built-in default Scales.

.brush .extent {
  stroke: #000;
  fill-opacity: .125;
  shape-rendering: crispEdges;
}

.brush .background {
  fill: #ddd;
}
    var LineChart = ReactD3.LineChart;
    var Brush = ReactD3.Brush;

var SomeComponent = React.createClass({
    getInitialState: function() {
        return {
            data: {label: '', values: [
                {x: new Date(2015, 2, 5), y: 1},
                {x: new Date(2015, 2, 6), y: 2},
                {x: new Date(2015, 2, 7), y: 0},
                {x: new Date(2015, 2, 8), y: 3},
                {x: new Date(2015, 2, 9), y: 2},
                {x: new Date(2015, 2, 10), y: 3},
                {x: new Date(2015, 2, 11), y: 4},
                {x: new Date(2015, 2, 12), y: 4},
                {x: new Date(2015, 2, 13), y: 1},
                {x: new Date(2015, 2, 14), y: 5},
                {x: new Date(2015, 2, 15), y: 0},
                {x: new Date(2015, 2, 16), y: 1},
                {x: new Date(2015, 2, 16), y: 1},
                {x: new Date(2015, 2, 18), y: 4},
                {x: new Date(2015, 2, 19), y: 4},
                {x: new Date(2015, 2, 20), y: 5},
                {x: new Date(2015, 2, 21), y: 5},
                {x: new Date(2015, 2, 22), y: 5},
                {x: new Date(2015, 2, 23), y: 1},
                {x: new Date(2015, 2, 24), y: 0},
                {x: new Date(2015, 2, 25), y: 1},
                {x: new Date(2015, 2, 26), y: 1}
            ]},
            xScale: d3.time.scale().domain([new Date(2015, 2, 5), new Date(2015, 2, 26)]).range([0, 400 - 70]),
            xScaleBrush: d3.time.scale().domain([new Date(2015, 2, 5), new Date(2015, 2, 26)]).range([0, 400 - 70])
        };
    },

    render: function() {
        return (
                <div>
                <LineChart
                   data={this.state.data}
                   width={400}
                   height={400}
                   margin={{top: 10, bottom: 50, left: 50, right: 20}}
                   xScale={this.state.xScale}
                   xAxis={{tickValues: this.state.xScale.ticks(d3.time.day, 2), tickFormat: d3.time.format("%m/%d")}}
                />
                <div className="brush" style={{float: 'none'}}>
                <Brush
                   width={400}
                   height={50}
                   margin={{top: 0, bottom: 30, left: 50, right: 20}}
                   xScale={this.state.xScaleBrush}
                   extent={[new Date(2015, 2, 10), new Date(2015, 2, 12)]}
                   onChange={this._onChange}
                   xAxis={{tickValues: this.state.xScaleBrush.ticks(d3.time.day, 2), tickFormat: d3.time.format("%m/%d")}}
                />
                </div>
                </div>
        );
    },

    _onChange: function(extent) {
        this.setState({xScale: d3.time.scale().domain([extent[0], extent[1]]).range([0, 400 - 70])});
    }
});

brush

Tooltips

You can provide a callback to every chart that will return html for the tooltip. Depending on the type of chart the callback will receive different parameters that are useful.

  • Bar Chart: label is the first parameter. y0, y of the hovered bar and the total bar height in case of a stacked bar chart.
  • Scatter Plot: x, y of the hovered point.
  • Pie Chart: label is the first parameter. y of the hovered wedge.
  • Area Chart: closest y value to the cursor of the area under the mouse and the cumulative y value in case of a stacked area chart. x value is the third parameter. label is the fourth parameter.

Example Scatter Plot:

var tooltipScatter = function(x, y) {
    return "x: " + x + " y: " + y;
};

React.render(<ScatterPlot
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}
                tooltipHtml={tooltipScatter}
                xAxis={{label: "x-label"}}
                yAxis={{label: "y-label"}}/>,
            document.getElementById('scatterplot')
);

Tooltip positioning is influenced by tooltipOffset tooltipContained and tooltipMode, which has 3 options mouse, fixed, element.

  • mouse is the default behavior and just follows the mouse
  • fixed uses tooltipOffset as an offset from the top left corner of the svg
  • element puts the tooltip on top of data points for line/area/scatter charts and on top of bars for the barchart

tooltipOffset is an object with top and left keys i.e. {top: 10, left: 10}

If tooltipContained is true the tooltip will try to stay inside the svg by using css-transform.

tooltip

Axis parameters

All D3 axis parameters can optionally be provided to the chart. For detailed explanation please check the documentation.

React.render(<LineChart
                    data={data}
                    width={400}
                    height={400}
                    margin={{top: 10, bottom: 50, left: 50, right: 10}}
                    tooltipHtml={tooltipLine}

                    xAxis={{innerTickSize: 10, label: "x-label"}}
                    yAxis={{label: "y-label"}}/>,
            document.getElementById('linechart'));

The following are the default values.

{
tickArguments: [10],
tickValues: null,
tickFormat: x => { return x; },
innerTickSize: 6,
tickPadding: 3,
outerTickSize: 6,
className: "axis",
zero: 0,
label: ""
}

Custom Accessors

data = [{
    customLabel: 'somethingA',
    customValues: [[0, 3], [1.3, -4], [3, 7], [-3.5, 8], [4, 7], [4.5, 7],  [5, -7.8]]
}];

var labelAccessor = function(stack) { return stack.customLabel; };
var valuesAccessor = function(stack) { return stack.customValues; };
var xAccessor = function(element) { return element[0]; };
var yAccessor = function(element) { return element[1]; };

React.render(<ScatterPlot
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}

                label={labelAccessor}
                x={xAccessor}
                y={yAccessor}
                values={valuesAccessor}/>,
            document.getElementById('location'));

Overriding default parameters

All Charts provide defaults for scales, colors, etc... If you want to use your own scale just pass it to the charts constructor.

The scales are normal D3 objects, their documentation can be found here and here.

There are more parameters like barPadding, strokeWidth, fill, opacity, etc. please check the documentation for details.

var xScale = d3.scale.ordinal(); //... + set it up appropriately
var yScale = d3.scale.linear();
var colorScale = d3.scale.category20();

<BarChart xScale={xScale}
      yScale={yScale}
      colorScale={colorScale}
      barPadding={0.3}
      data={data}
      width={400}
      height={400}
      margin={{top: 10, bottom: 50, left: 50, right: 10}}/>

LineChart stroke style

You can customize the line style of LineCharts with CSS or if you want to have more control over how each line in your dataset gets rendered you can use the stroke property of LineChart as follows. Note that you do not have to set all the properties in the object.

    var dashFunc = function(label) {
        if (label == "somethingA") {
            return "4 4 4";
        }
        if (label == "somethingB") {
            return "3 4 3";
        }
    }

    var widthFunc = function(label) {
        if (label == "somethingA") {
            return "4";
        }
        if (label == "somethingB") {
            return "2";
        }
    }

    var linecapFunc = function(label) {
        if (label == "somethingA") {
            return "round";
        }
    }

    React.render(<LineChart
                    data={data}
                    width={400}
                    height={400}
                    margin={{top: 10, bottom: 50, left: 50, right: 10}}
                    tooltipHtml={tooltipLine}
                    xAxis={{innerTickSize: 6, label: "x-label"}}
                    yAxis={{label: "y-label"}}
                    shapeColor={"red"}
                    stroke={{strokeDasharray: dashFunc, strokeWidth: widthFunc, strokeLinecap: linecapFunc}}
                    />,
    document.getElementById('linechart')
    );

strokestyle

StackedBarChart

var BarChart = ReactD3.BarChart;

data = [
    {
    label: 'somethingA',
    values: [{x: 'SomethingA', y: 10}, {x: 'SomethingB', y: 4}, {x: 'SomethingC', y: 3}]
    },
    {
    label: 'somethingB',
    values: [{x: 'SomethingA', y: 6}, {x: 'SomethingB', y: 8}, {x: 'SomethingC', y: 5}]
    },
    {
    label: 'somethingC',
    values: [{x: 'SomethingA', y: 6}, {x: 'SomethingB', y: 8}, {x: 'SomethingC', y: 5}]
    }
];

React.render(<BarChart
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
            document.getElementById('location'));

stackedbarchart

Grouped Bar Chart

var BarChart = ReactD3.BarChart;

data = [
    {
    label: 'somethingA',
    values: [{x: 'SomethingA', y: 10}, {x: 'SomethingB', y: 4}, {x: 'SomethingC', y: 3}]
    },
    {
    label: 'somethingB',
    values: [{x: 'SomethingA', y: 6}, {x: 'SomethingB', y: 8}, {x: 'SomethingC', y: 5}]
    },
    {
    label: 'somethingC',
    values: [{x: 'SomethingA', y: 6}, {x: 'SomethingB', y: 8}, {x: 'SomethingC', y: 5}]
    }
];

React.render(<BarChart
                groupedBars
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
            document.getElementById('location'));

groupedbarchart

Other Charts

var ScatterPlot = ReactD3.ScatterPlot;
var LineChart = ReactD3.LineChart;
var AreaChart = ReactD3.AreaChart;

data = [
    {
    label: 'somethingA',
    values: [{x: 0, y: 2}, {x: 1.3, y: 5}, {x: 3, y: 6}, {x: 3.5, y: 6.5}, {x: 4, y: 6}, {x: 4.5, y: 6}, {x: 5, y: 7}, {x: 5.5, y: 8}]
    },
    {
    label: 'somethingB',
    values: [{x: 0, y: 3}, {x: 1.3, y: 4}, {x: 3, y: 7}, {x: 3.5, y: 8}, {x: 4, y: 7}, {x: 4.5, y: 7}, {x: 5, y: 7.8}, {x: 5.5, y: 9}]
    }
];

React.render(<ScatterPlot
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
            document.getElementById('location'));

React.render(<LineChart
                data={data}
                width={400}
                height={400}
                margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
            document.getElementById('location')
);

React.render(<AreaChart
                data={data}
                width={400}
                height={400}
                yOrientation='right' // if you do not provide right default left orientation for yAxis will be used
                margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
            document.getElementById('location')
);

scatterplot

linechart

areachart

PieChart

By default d3 sorts the PieChart but you can use the sort property to pass a custom comparator or null to disable sorting.

var PieChart = ReactD3.PieChart;

var data = {
        label: 'somethingA',
        values: [{x: 'SomethingA', y: 10}, {x: 'SomethingB', y: 4}, {x: 'SomethingC', y: 3}]
};

var sort = null; // d3.ascending, d3.descending, func(a,b) { return a - b; }, etc...

React.render(<PieChart
                data={data}
                width={600}
                height={400}
                margin={{top: 10, bottom: 10, left: 100, right: 100}}
                sort={sort}
                />,
            document.getElementById('location')
);

piechart

Waveform

The waveform chart displays a sequence of values as if they were part of an audio waveform. The values are centered on the horizontal axis and reflected along the horizontal origin. For now only values in the range [0,1] are supported.

The graph can accept a colorScale parameter, that is an array of values in the range [0,width], where width is the width of the graph. Following an example of gradient from white to black for a waveform of width 200.

colorScale={ d3.scale.linear()
                    .domain([0,200])
                    .range(['#fff','#000'])}

The graph is responsive and adopts a viewBox strategy to resize the graph maintaining its proportions. We also adopt subSampling in order to maintain the graph rapresentation of the waveform. As it is now each bar needs to have a minimum width of 1px, as well as 1px space between to adjacent bars. In order to allow this, we subsample the input data in order to have exactly a maximum of width/2 elements.

It is therefore a good strategy to select the width of the graph to be twice the length of the dataset. The viewBox responsiveness will then resize the graph to the width of the container. If the samples are less than half of the space available we just display them with a width >1px. Space between bars is increased in width as well.

waveform

Credits

This library uses parts of D3.js.

react-d3-components's People

Contributors

absk1317 avatar ahtik avatar b1f6c1c4 avatar budmore avatar codesuki avatar craga89 avatar fuzzy31u avatar jdstep avatar jeroencoumans avatar joshgagnon avatar mskeving avatar nicolabortignon avatar peterssonjonas avatar psdcoder avatar rahavlussato avatar reggino avatar solomein avatar tay 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

react-d3-components's Issues

Relative containers offsets tooltip

When using this library with a relative based css (in my case bootstrap) the tooltip is positioned way off. The image shows a small example
tooltip
css:

#test {
    position: relative;
    top: 200px;
}

html:

<div id="test">
    <div id="barchart"></div>
</div>

The hotfix beeing used at the moment is changing top and left calculations in TooltipMixin from
e.pageY + ... to e.nativeEvent.layerY + ... (and respectivly for x).

I'm unsure whether this is a proper solution to the problem or, as stated, just a hotfix for our case.

Still a resize bug after 0.4.8...

There's still a resize bug in there, but I have no idea whether it is related to D3 itself or this component (see attached screenshot). It's harder to provoke on desktop, but on an Android phone it manifests itself every time when switching from portrait to landscape.

As you can see from the screenshot, the inner g element that contains the actual graph does not resize correctly, while the rest of the graph does (axis and outer elements). A simple workaround is to set a "key" attribute with a "current timestamp", forcing React to recreate the graph element in the DOM on each (size related) update, but that's doing a lot more work than strictly necessary.

image

Histogram

Would be nice to have a histogram component (binned bar chart). Any ideas about how one would approach this?

Infamous d3 encoding issue.

Hi, I just spent 20 minutes tracking down a bug that I thought was caused this, then by Browserify, but then turned out to be caused by d3 itself.

d3/d3#1747

Basically, the authors of d3 have used some fancy characters which will cause a syntax error if loaded in a script tag without a charset="utf-8" attribute. They don't want to change them because they feel that most people using d3 will use a minified version. Unfortunately that is not the case for those using CommonJS.

Might be good to add something to the docs.

Scoping the adoption of this library

Hi there,
first of all, thanks for the great work done so far.

I'm migrating my frontend from angular to react. I have couple of graphs that are done via d3.
I was really interest to adopting this library as middleware between react and d3.

The graph that I would like to 'port' are pretty specific, the first is an audio waveform, the other is a sunburst (http://bl.ocks.org/kerryrodden/7090426)

Do you think I can try to integrate the two graphs into the library via PR?
How complicated is to convert a standalone d3 graph into a react-d3-component ?

PieChart does not preserve order of values

I just created a small test of a PieChart and noticed that apparently The values are not rendered in the same order as they are provided. When I provide the values [x,y,z] they are instead rendered as for example [y,x,z].

BarChart label tooltip

When I use the tooltipHtml attribute in a BarChart, I get only the parameters below:
_handleTooltip(x, y0, y, total) {
}

There is a possibility to add the label of the current bar?
I can't find any indication of which bar is it because there is not a legend either yet.

Default scale for date values

Hey,

Me again ;)
I'm neither fluent in ES6 nor d3 so I'm not doing any changes myself for now but maybe in the future when I'm more confident.

When creating the default scale for date values, you only specify one value for the domain instead of a range [min, max]
See https://github.com/codesuki/react-d3-components/blob/master/src/DefaultScalesMixin.jsx line 89.

Any reason for that? Because for my specific case, the graph looks much better with a [min, max] scale and I don't see how the current implementation could be better in other cases:

var data= JSON.parse("{\"label\":\"\",\"values\":[{\"x\":\"2015-02-07T23:00:00.000Z\",\"y\":2},{\"x\":\"2015-02-22T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-03-04T23:00:00.000Z\",\"y\":2},{\"x\":\"2015-03-08T23:00:00.000Z\",\"y\":3},{\"x\":\"2015-03-10T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-03-11T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-04-04T22:00:00.000Z\",\"y\":2},{\"x\":\"2015-06-27T22:00:00.000Z\",\"y\":1},{\"x\":\"2015-07-31T22:00:00.000Z\",\"y\":2},{\"x\":\"2015-11-15T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-12-29T23:00:00.000Z\",\"y\":1}]}");
<LineChart data={data} width={840} height={500} margin={{top: 10, bottom: 50, left: 50, right: 10}}, xAxis={{tickFormat: d3.time.format("%y-%m-%d")}} />

gives this graph (a zoom on the first date of the next chart):
default scale

Now,

var data= JSON.parse("{\"label\":\"\",\"values\":[{\"x\":\"2015-02-07T23:00:00.000Z\",\"y\":2},{\"x\":\"2015-02-22T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-03-04T23:00:00.000Z\",\"y\":2},{\"x\":\"2015-03-08T23:00:00.000Z\",\"y\":3},{\"x\":\"2015-03-10T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-03-11T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-04-04T22:00:00.000Z\",\"y\":2},{\"x\":\"2015-06-27T22:00:00.000Z\",\"y\":1},{\"x\":\"2015-07-31T22:00:00.000Z\",\"y\":2},{\"x\":\"2015-11-15T23:00:00.000Z\",\"y\":1},{\"x\":\"2015-12-29T23:00:00.000Z\",\"y\":1}]}");
var dates = _.map(data.values, function(val){ return val.x; });
var minDate = _.min(dates);
var maxDate = _.max(dates);
var scale = d3.time.scale().domain([minDate, maxDate]).range([0, innerWidth]);
<LineChart data={data} scale={scale} width={840} height={500} margin={{top: 10, bottom: 50, left: 50, right: 10}}, xAxis={{tickFormat: d3.time.format("%y-%m-%d")}} />

gives this chart:
custom scale

Am I missing the general case here?

Adding line at an index-number

Hi,

really interesting component.

This is purely meant as a question/add-on.

I have a small request/question.

Is it possible to indicate an index-number that will create a straight line running through the graph. Like the image below:

graph

Regards

Martin

Selectable points

Is it possible to select points in a line chart, for example? I'm looking for a react graphing library that allows the user to select a point, or maybe even a single bar on a bar chart.

Placement on x-axis

Hi,

Thanks for the good job with this library.
One thing I noticed that you probably want to know is that the data points are shifted (to the left) for most charts (actually all the charts I tried except the bar chart).
See screenshots:
bar-chart
line-chart
Seems that points are placed to the top-left of the bars (in bar chart), whereas it should be at the top-center? Of course, the bigger the chart, the more important the shift.

Dynamic sizes of charts

Cool library!

We are trying to use this on our project to create a pretty straightforward bar chart, but we are having a hard time making the chart responsive. It seems to me that there is no way around specifying the width and the height of a chart when you create it. We might be missing something, though.

For now, we are trying out a workaround where we specify the width and height of the BarChart based on the viewport height and width. I am not completely satisfied with it. In my mind, it would be ideal if there was a way to make the chart stretch to 100% of its container's size. Do you have any plans to implement something like that? Or do you think it is even technically possible?

DefaultScalesMixin uses different versions of props for updating

The function _makeScales is called by the lifecycle function componentWillRecieveProps and is fed nextProps. However after _makeScales, all subsequent functions called in the code path use this.props, which are the old props.

We've fixed this by passing the nextProps down to the subsequent functions.

Demo not loading dependencies over https

Some browsers seem to be pinning github.io to https - likely a recent use of HSTS. Since your scripts are not loaded over HTTPS, modern browsers will refuse to load them and the demo shows a blank white page.

You can fix this by simply changing the scripts to be protocol-agnostic (starting with // instead of http:// or https://).

breaking cordova builds

the line

var ReactD3 = require('react-d3-components');

will immediately break any cordova build.

Custom tooltipSymbol

Currently, tooltipSymbol is merely a symbol. Yet I want more, for example, I need focus lines:

image

I implemented this by introducing a new attribute "tooltipSymbol", which is a function that accepts data, x and y. The code for my example is (coffeescript):

<LineChart
    tooltipSymbol={(data, x, y) ->
        <g className="util-focus">
            <line
                className="focusLine"
                x1={x}
                y1={yScale(yDomain[0])}
                x2={x}
                y2={yScale(yDomain[1])}
            />
            <line
                className="focusLine"
                x1={xScale(xDomain[0])}
                y1={y}
                x2={xScale(xDomain[1])}
                y2={y}
            />
            <path
                className="dot"
                d={d3.svg.symbol().type("circle")()}
                transform="translate(#{x}, #{y})"
                fill="red"
            />
        </g>
    ...
/>

This might be needed for other people as well. Since it gives an easy way to access the x and y of selected data point and to append additional stuff on the chart.

xScale.rangeBand is not a function

I'm getting the following error on 0.6.0:

Uncaught TypeError: xScale.rangeBand is not a function(anonymous function) @ BarChart.js:73(anonymous function)

My component looks like this:

import React, {Component} from 'react'
import {BarChart} from 'react-d3-components';

export default class Graph extends Component {
  render() {
    const {history} = this.props;

    const data = [{
      label: 'Average Ping',
      values: [
        {x: 1, y: 2},
        {x: 2, y: 1},
        {x: 3, y: 3},
        {x: 4, y: 5},
      ]
    }];

    return (
      <BarChart data={data} width={500} height={500} />
    )
  }
}

Any clues? I'm guess that this should be coming from DefaultScalesMixin but for some reason isn't.

Tooltip not showing up

The function being assigned to generate the tooltip is being called and I can access the respective 'x', 'y' etc values, but no tooltip is showing up. Tried this for the BarChart component.

BarChart: uncaught TypeError: cannot read property 'x' of undefined

I'm using version 0.4.8 along with react v0.13.3 to create a BarChart. I use gulp/browserify/reactify to compile, and that step does not give me any errors. But, when I try to see the output in the browser, I get the error message:
uncaught TypeError: cannot read property 'x' of undefined from:
getDefaultProps() in StackAccessorMixin

My code looks like this:
var React = require('react');
var d3 = require('d3');
var ReactD3 = require('react-d3-components');

var BarChart = ReactD3.BarChart;

var WeightlogBarChart = React.createClass({
propTypes: {
entries: React.PropTypes.array.isRequired,
user: React.PropTypes.object.isRequired,
width: React.PropTypes.number.isRequired,
height: React.PropTypes.number.isRequired
},
render: function() {
var values = this.props.entries.map(function(d) {
return {x: d.logdate, y:d.weight_lbs};
});
var data = [{
label: this.props.user.login,
values: values
}];
console.log(data);
return (
<BarChart
data={data}
width={this.props.width}
height={this.props.height}
margin={{top: 10, bottom: 10, left: 10, right:10}}
/>
);
}
});

module.exports = WeightlogBarChart;

I verified that data[0].values is an array of Objects with keys 'x' and 'y'. Any help is appreciated. Thanks.

"lineClip" id conflict

I noticed that you have set the "clipPath" style of the element in LineChart to "lineClip". If I put two lineCharts, there is an id conflict between these two, causing the chart to be clipped to wrong size.

Stacked Bar tooltipHtml callback needs series info

The bar chart tooltipHtml callback takes 3 parameters: x, y0, and y. However, there's no way to tell which "series" it's in if it's a stacked bar chart. It would be nice to have another parameter with the label of the series.

A performance issue

Will you consider calling tooltipLine method in a delayed fashion? Since it is the only access to the selected data and I need to do a lot of time-consuming things with that. It significantly reduced the UI responsiveness.

When I say delayed fashion, I mean this:

before:

onMouseEnter: (e, data) ->
    tooltip = @props.tooltipLine(data, position)
    @setState
        tooltip: tooltip

after:

onMouseEnter: (e, data) ->
    if @delayedTooltip?
        clearTimeout @delayedTooltip
    @delayedTooltip = setTimeout =>
        tooltip = @props.tooltipLine(data, position)
        @setState
            tooltip:tooltip
        @delayedTooltip = null

Actually, I can just put my heavy work in a setTimeout callback. And that is what I did, but it took me hours to realize that. I think it might be a good practice to put every callback function in this fashion, because who knows what user will do.

Brush support

I added horizontal (X-Axis) Brush support, but the code needs refactoring and I am not completely sure how to best integrate Brush support with default charts and scales. Thinking about giving an option to show a default Brush or just leave Brushes for use with custom scales. Probably the former if I can make it work nicely. Other open questions, should the Brush share the SVG with the Graph or have its own..

Any feedback is welcome.

A bug in tooltip generation

In your code, you have

var indexRight = idx == stack.length ? idx - 1 : idx;
var valueRight = x(values(stack)[indexRight]);

but stack cannot be guaranteed to be an array and you should use values to find the array. Like this:

var indexRight = idx == values(stack).length ? idx - 1 : idx;
var valueRight = x(values(stack)[indexRight]);

Otherwise, when user moves mouse outside the xdomain to the right, it will generate an error due to index out of bound.

HorizontalBarChart

Is there a reasonable way to flip the <BarChart /> to be on the horizontal axis instead of a vertical one or would that need to be a new component?

Can't add property context, object is not extensible

Hey guys, I'm using React 0.13.1, along with Babel+Browserify. My source is:

let React = require('react');
let ReactD3 = require('react-d3-components');
let AreaChart = ReactD3.AreaChart;

let data = [
  {
    label: 'somethingA',
    values: [{x: 0, y: 2}, {x: 1.3, y: 5}, {x: 3, y: 6}, {x: 3.5, y: 6.5}, {x: 4, y: 6}, {x: 4.5, y: 6}, {x: 5, y: 7}, {x: 5.5, y: 8}]
  },
  {
    label: 'somethingB',
    values: [{x: 0, y: 3}, {x: 1.3, y: 4}, {x: 3, y: 7}, {x: 3.5, y: 8}, {x: 4, y: 7}, {x: 4.5, y: 7}, {x: 5, y: 7.8}, {x: 5.5, y: 9}]
  }
];

React.render(<AreaChart
  data={data}
  width={400}
  height={400}
  margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
  document.body);

And I compile it with:

browserify src/file.es6 -t babelify --outfile dist/file.js

I see everything getting compiled correctly, but I got the "Can't add property context, object is not extensible". Any idea?

Invariant Violation: addComponentAsRefTo with LineChart

Hey any ideas what's going on here. I'm trying to add a simple LineChart.

<LineChart
data={{label:'now', values:[{x:0,y:100}, {x:1, y:200}]}}
width={600}
height={400}
margin={{top: 10, bottom: 50, left: 150, right: 10}}
xAxis={{innerTickSize: 5, label: 'Age'}}
yAxis={{label: 'Funds'}}
/> 



Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's render method). Try rendering this component inside of a new top-level component which will hold the ref.

invariant.js:43 
invariantReactOwner.js:71
ReactOwner.addComponentAsRefToReactRef.js:24 
attachRefReactRef.js:40 
ReactRef.attachRefsReactReconciler.js:23 
attachRefsCallbackQueue.js:69 
assign.notifyAllReactReconcileTransaction.js:82 ON_DOM_READY_QUEUEING.closeTransaction.js:208 
Mixin.closeAllTransaction.js:149
Mixin.performReactMount.js:270
batchedMountComponentIntoNodeTransaction.js:135 
Mixin.performReactDefaultBatchingStrategy.js:67 ReactDefaultBatchingStrategy.batchedUpdatesReactUpdates.js:111 
batchedUpdatesReactMount.js:405
ReactMount._renderNewRootComponentReactPerf.js:71
ReactPerf.measure.wrapperReactMount.js:494
ReactMount.renderReactPerf.js:71
ReactPerf.measure.wrapperclient.js:46
(anonymous function)client.js:25
gclient.js:46
(anonymous function)client.js:46
/Users/dmmalam/Code/q/goku/app/client.js../app.jsx_prelude.js:1
s_prelude.js:1
e_prelude.js:1 (anonymous function)

Documentation is in the wiki?

README says:

Documentation is in the Wiki. For quick testing the examples might be enough.

The wiki appears to be empty. There are links, but no content.

DataSet as components?

Hi codesuki, in your implementation, you separate the actual chart content from the axes/tooltip by introducing a companion class DataSet. I wonder will it be viable if you offer a Cartesian coordinates system as a component and those DataSets as seperate components. Since I would like to draw something on top of the graph using the axes. And another benefit is that we can group the data.

An using example will be something like:

<CartesianCoord
        xAxis={...}
        yAxis={...}
        xScale={...}
        yScale={...}
        width={...}
        height={...}
        margin={...}
        charts={[
            {
                LineChartDataSet:
                    data: {...}
                    tooltipHtml: {...}
            }, {
                ScatterPlotDataSet:
                    data: {...}
                    tooltipHtml: {...}
            }
        ]}
/>

This way, in the future we may even add PolarCoord. And when we pass a BarChart to a PolarCoord, we get a PieChart. : )

resize issue***

In this file: HeightWidthMixin.jsx
i wonder why passing this.pros and not props?

_calculateInner(props) {
    let {height, width, margin} = this.props;

this causing resize problems....check about it

Custom colorScale for LineChart

Edit: Later I found out that it was my css file setting the stroke style. Apparently style has a higher priority than stroke attribute.

Hi codesuki, you implemented the stroke color as an attribute rather than a style:

image

However according to SVG color attributes, you can only use named color as an attribute this way. Would you add support for custom valued color such rgb and hex color?

Not usable as a node module

Hi there,

Great job with this, but it seems that I can't really use this as a node module. If I don't install babel-loader (webpack's 6to5 loader) I get this error on require:

./~/react-d3-components/src/LineChart.js
Module parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (
You may need an appropriate loader to handle this file type.
|   },
| 
|   render() {
|     let {width,
|        height,
 @ ./~/react-d3-components/src/index.js 4:16-38 0 [ './~/react-d3-components/src/LineChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {width,\n| \t\t\t height,\n @ ./~/react-d3-components/src/index.js 4:16-38',
  './~/react-d3-components/src/AreaChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t area,\n @ ./~/react-d3-components/src/index.js 5:16-38',
  './~/react-d3-components/src/BarChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t xScale,\n @ ./~/react-d3-components/src/index.js 1:15-36',
  './~/react-d3-components/src/ScatterPlot.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t symbol,\n @ ./~/react-d3-components/src/index.js 3:18-42',
  './~/react-d3-components/src/PieChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {fill, d, data, onMouseEnter, onMouseLeave} = this.props;\n| \n @ ./~/react-d3-components/src/index.js 2:15-36' ]
./~/react-d3-components/src/AreaChart.js
Module parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (
You may need an appropriate loader to handle this file type.
|   },
| 
|   render() {
|     let {data,
|        area,
 @ ./~/react-d3-components/src/index.js 5:16-38 1 [ './~/react-d3-components/src/LineChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {width,\n| \t\t\t height,\n @ ./~/react-d3-components/src/index.js 4:16-38',
  './~/react-d3-components/src/AreaChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t area,\n @ ./~/react-d3-components/src/index.js 5:16-38',
  './~/react-d3-components/src/BarChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t xScale,\n @ ./~/react-d3-components/src/index.js 1:15-36',
  './~/react-d3-components/src/ScatterPlot.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t symbol,\n @ ./~/react-d3-components/src/index.js 3:18-42',
  './~/react-d3-components/src/PieChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {fill, d, data, onMouseEnter, onMouseLeave} = this.props;\n| \n @ ./~/react-d3-components/src/index.js 2:15-36' ]
./~/react-d3-components/src/BarChart.js
Module parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (
You may need an appropriate loader to handle this file type.
|   },
| 
|   render() {
|     let {data,
|        xScale,
 @ ./~/react-d3-components/src/index.js 1:15-36 2 [ './~/react-d3-components/src/LineChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {width,\n| \t\t\t height,\n @ ./~/react-d3-components/src/index.js 4:16-38',
  './~/react-d3-components/src/AreaChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t area,\n @ ./~/react-d3-components/src/index.js 5:16-38',
  './~/react-d3-components/src/BarChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t xScale,\n @ ./~/react-d3-components/src/index.js 1:15-36',
  './~/react-d3-components/src/ScatterPlot.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t symbol,\n @ ./~/react-d3-components/src/index.js 3:18-42',
  './~/react-d3-components/src/PieChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {fill, d, data, onMouseEnter, onMouseLeave} = this.props;\n| \n @ ./~/react-d3-components/src/index.js 2:15-36' ]
./~/react-d3-components/src/ScatterPlot.js
Module parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (
You may need an appropriate loader to handle this file type.
|   },
| 
|   render() {
|     let {data,
|        symbol,
 @ ./~/react-d3-components/src/index.js 3:18-42 3 [ './~/react-d3-components/src/LineChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {width,\n| \t\t\t height,\n @ ./~/react-d3-components/src/index.js 4:16-38',
  './~/react-d3-components/src/AreaChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t area,\n @ ./~/react-d3-components/src/index.js 5:16-38',
  './~/react-d3-components/src/BarChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t xScale,\n @ ./~/react-d3-components/src/index.js 1:15-36',
  './~/react-d3-components/src/ScatterPlot.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t symbol,\n @ ./~/react-d3-components/src/index.js 3:18-42',
  './~/react-d3-components/src/PieChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {fill, d, data, onMouseEnter, onMouseLeave} = this.props;\n| \n @ ./~/react-d3-components/src/index.js 2:15-36' ]
./~/react-d3-components/src/PieChart.js
Module parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (
You may need an appropriate loader to handle this file type.
|   },
| 
|   render() {
|     let {fill, d, data, onMouseEnter, onMouseLeave} = this.props;
| 
 @ ./~/react-d3-components/src/index.js 2:15-36 4 [ './~/react-d3-components/src/LineChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/LineChart.js Line 23: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {width,\n| \t\t\t height,\n @ ./~/react-d3-components/src/index.js 4:16-38',
  './~/react-d3-components/src/AreaChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/AreaChart.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t area,\n @ ./~/react-d3-components/src/index.js 5:16-38',
  './~/react-d3-components/src/BarChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/BarChart.js Line 30: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t xScale,\n @ ./~/react-d3-components/src/index.js 1:15-36',
  './~/react-d3-components/src/ScatterPlot.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/ScatterPlot.js Line 26: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {data,\n| \t\t\t symbol,\n @ ./~/react-d3-components/src/index.js 3:18-42',
  './~/react-d3-components/src/PieChart.js\nModule parse failed: /User/folder/node_modules/react-d3-components/src/PieChart.js Line 18: Unexpected token (\nYou may need an appropriate loader to handle this file type.\n| \t},\n| \n| \trender() {\n| \t\tlet {fill, d, data, onMouseEnter, onMouseLeave} = this.props;\n| \n @ ./~/react-d3-components/src/index.js 2:15-36' ]
Built with error:

If I do use the loader (and compile your src) I still get this error:
Uncaught TypeError: Cannot read property 'category20' of undefined

It seems that your node_modules are not installed because you ignore them in .npmignore.

Is it setup correctly following these instructions?
http://howtonode.org/how-to-module

Event support

Especially for mouse events like onClick and onContextMenu. Currently I have to wrap it in a div to catch those events.

Changing react dependency naming from 'React' to 'react'

The official react library now is exported as 'react'. In this library we are still using the 'React' name with the capital letter.
I start getting error messages when implementing the library in other projects.
If it's ok I'd like to PR the change.

Let me know

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.