Skip to content

Commit

Permalink
Merge pull request #89 from oslabs-beta/dev
Browse files Browse the repository at this point in the history
Performance improvement
  • Loading branch information
hi2dmitri committed Jan 29, 2022
2 parents 4241cdd + 886e0a3 commit 377d7f0
Show file tree
Hide file tree
Showing 26 changed files with 8,066 additions and 260 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/no-unsafe-call": 0,
"react/display-name": 0

"react/display-name": 0,
"react-hooks/exhaustive-deps": "off"
},
"plugins": ["react", "import", "@typescript-eslint"],
"parser": "@typescript-eslint/parser",
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions
name: DEV CI

# Controls when the workflow will run
on:
pull_request:
branches: [ dev ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "format"
format-lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Install dependencies
- name: Install
run: npm install

# Format project
- name: Format project
run: npm run format

# Lint project
- name: Lint project
run: npm run lint
6 changes: 5 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

@oslabs-beta:registry=https://npm.pkg.github.com
<<<<<<< HEAD
@oslabs-beta:registry=https://npm.pkg.github.com
=======
@oslabs-beta:registry=https://npm.pkg.github.com
>>>>>>> main
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
# d3reactor

An open-source library of chart components for creating performant, responsive data visualizations in React
An open-source library of charts for creating performant, responsive data visualizations built with React and D3.

# The problem:

D3 and React compete for control of the DOM, making it difficult to leverage D3's capabilities while taking advantage of React's virtual DOM. This often results in D3 code that re-renders the DOM unnecessarily, resulting in charts with poor performance.
The main goal of this library to help you create customizable charts easily.

# Installation
Let's get your first d3reactor chart set up in less < 5 minutes.
Let's get your first d3reactor chart setup in less < 5 minutes.

## Install the d3reactor package
```
npm i d3reactor
npm install d3reactor
```
OR
```
yarn install d3reactor
yarn add d3reactor
```
## Import d3reactor into your React file

## Import d3reactor into your React project

```
import d3reactor from 'd3reactor'
import * as d3reactor from "d3reactor"
```

## Instantiate a new d3reactor component in the return statement of your parent component
OR you can import each chart separately

```
function MyParentComponent() {
return (
<d3reactor.AreaChart
data={my_data}
xKey='my_xkey_value'
yKey='my_ykey_value'
groupBy='my_group' // if you want a multi-chart
/>
);
}
import {AreaChart, BarChart, PieChart, ScatterPlot, LineChart} from "d3reactor"
```

# Examples

```
<AreaChart
data={my_data}
xKey='my_xkey_value'
yKey='my_ykey_value'
groupBy='my_group' // if you want a multi-chart
/>
```

And you're good to go!

<img width="667" alt="Screen Shot 2022-01-27 at 11 49 44" src="https://user-images.githubusercontent.com/83984184/151405131-82e9c38f-806a-4cb1-8d6a-b24a62595279.png">


38 changes: 38 additions & 0 deletions data/coffee_shop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"product": "Mint",
"sales": 8342
},
{
"product": "Caffe Latte",
"sales": 8665
},
{
"product": "Amaretto",
"sales": 6781
},
{
"product": "Darjeeling",
"sales": 17758
},
{
"product": "Decaf Espresso",
"sales": 18888
},
{
"product": "Regular Espresso",
"sales": 6744
},
{
"product": "Decaf Irish Cream",
"sales": 14831
},
{
"product": "Colombian",
"sales": 30761
},
{
"product": "Caffe Mocha",
"sales": 21716
}
]
109 changes: 109 additions & 0 deletions data/historical_gdp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[{"group": "USA",
"year": "2012",
"GDP": 16961
},
{"group": "USA",
"year": "2013",
"GDP": 17273
},
{"group": "USA",
"year": "2014",
"GDP": 17709
},
{"group": "USA",
"year": "2015",
"GDP": 18238
},
{"group": "USA",
"year": "2016",
"GDP": 18550
},
{"group": "USA",
"year": "2017",
"GDP": 18978
},
{"group": "USA",
"year": "2018",
"GDP": 19550
},
{"group": "USA",
"year": "2019",
"GDP": 19968
},
{"group": "USA",
"year": "2020",
"GDP": 19269
},
{"group": "Developed Countries Less USA",
"year": "2012",
"GDP": 23909
},
{"group": "Developed Countries Less USA",
"year": "2013",
"GDP": 24134
},
{"group": "Developed Countries Less USA",
"year": "2014",
"GDP": 24536
},
{"group": "Developed Countries Less USA",
"year": "2015",
"GDP": 25033
},
{"group": "Developed Countries Less USA",
"year": "2016",
"GDP": 25467
},
{"group": "Developed Countries Less USA",
"year": "2017",
"GDP": 26107
},
{"group": "Developed Countries Less USA",
"year": "2018",
"GDP": 26574
},
{"group": "Developed Countries Less USA",
"year": "2019",
"GDP": 26939
},
{"group": "Developed Countries Less USA",
"year": "2020",
"GDP": 25350
},
{"group": "Developing Countries",
"year": "2012",
"GDP": 25829
},
{"group": "Developing Countries",
"year": "2013",
"GDP": 27212
},
{"group": "Developing Countries",
"year": "2014",
"GDP": 28555
},
{"group": "Developing Countries",
"year": "2015",
"GDP": 29821
},
{"group": "Developing Countries",
"year": "2016",
"GDP": 31170
},
{"group": "Developing Countries",
"year": "2017",
"GDP": 32697
},
{"group": "Developing Countries",
"year": "2018",
"GDP": 34127
},
{"group": "Developing Countries",
"year": "2019",
"GDP": 35391
},
{"group": "Developing Countries",
"year": "2020",
"GDP": 34752
}
]
Loading

0 comments on commit 377d7f0

Please sign in to comment.