- Fork this repository to your own GitHub account and then clone it to your local device
- Install yarn:
npm install -g yarn
| yarn installation - Install the dependencies:
yarn
- Link Silky Charts:
yarn link
- Run
yarn dev
to build and watch for code changes - Get into the Playground:
cd playground
- Install the dependencies:
yarn
- Link to Silky Charts:
yarn link silky-charts
- Start the playground:
yarn start
Once you are in the playground you will find a React application created with RCA. The App structure is the following:
.
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
├── src
│ ├── App.js
│ ├── components
│ │ ├── ChartContainer.js
│ │ └── Container.js
│ ├── data.js
│ ├── index.js
│ └── styles.css
└── yarn.lock
After installing all the dependencies you will be able to start the application and use the App.js
to play with the current charts or test new ones. The App file is already importing all the charts available and the example data sets included in the application for testing purposes, and is also already rendering one of the charts with most common props already defined and comment out to make it easier to test these.
There is also a data.js
that contains all the testing data sets. Use this data set to test your charts and add new ones if you need them for your new chart or just for testing the current ones and include them in your pull request.
Silky Charts uses git flow in its repository, so if you want to contribute and publish a pull request please create a feature
branch out of develop
with a name describing you change or feature and create the pull request pointing back to the develop
branch.
git flow feature start <feature-name>
- Make your changes and commit them
- Run the tests with
yarn test
ornpm run tests
- Add unit tests and fix the linting issues and broken tests (as today the tests are in plan of refactoring so don't worry about broken ones)
- Create the pull request.
Running all tests:
yarn test
If you haven't yet, follow the first five steps described in Contributing to Silky Charts then inside your project directory:
- Link to Silky Charts:
yarn link silky-charts
And start coding...
- When you use bundlers like Webpack and Parcel you might encounter some issues related with Hooks throwing an error that says "
Hooks can only be called inside the body of a function component
". This problem is caused by a duplicate React in your bundle and you have to follow this workaround to make it work. -- Use this package.json file as an example.