-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from oslabs-beta/dev
Performance improvement
- Loading branch information
Showing
26 changed files
with
8,066 additions
and
260 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
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 |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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"> | ||
|
||
|
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,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 | ||
} | ||
] |
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,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 | ||
} | ||
] |
Oops, something went wrong.