-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/improve standards #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kuncheria-KV
wants to merge
12
commits into
master
Choose a base branch
from
refactor/improve-standards
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3cc285a
change name of prop to dataPoints
Kuncheria-KV c0b28ee
change types.d.ts to types.ts so that .d.ts file is generated in build
Kuncheria-KV d5a6468
add PR template and style guide
Kuncheria-KV 1ac28b2
feat: added onMouseEnter and onMouseLeave callbacks to handle bar hov…
arjunrtk-kv 5564edb
feat: fixed storybook issue, added unit tests and more stories, updat…
arjunrtk-kv 860d173
feat: updated LICENSE, PULL_REQUEST_TEMPLATE, README and STYLE_GUIDEL…
arjunrtk-kv dede2c1
fix: added EOL to files
arjunrtk-kv 4587bd0
fix: update email id in the CODE_OF_CONDUCT.md . file
arjunrtk-kv de1211f
fix: unit tests and pr comments resolved
arjunrtk-kv a0a51e4
Updated testcases for 100% test coverage
ReshmaJoshy 8b4460c
Updated readme
ReshmaJoshy 4fc0af9
Test cleanup
ReshmaJoshy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
# builds | ||
/build | ||
/dist | ||
/coverage | ||
.rpt2_cache | ||
|
||
# misc | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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,76 @@ | ||
<!-- Thank you for contributing to @keyvaluesystems/react-waterfall-chart! --> | ||
<!-- Before submitting a pull request, please review our contributing guidelines. --> | ||
|
||
| ||
|
||
## Pull Request Checklist | ||
|
||
| ||
|
||
- [ ] **Read the contributing guidelines.** | ||
- [ ] **Linked to an issue:** Fixes # (replace with the issue number, if applicable) | ||
- [ ] **Branch is up-to-date with the base branch:** `master` | ||
- [ ] **Changes pass tests locally:** `npm test` or `yarn test` | ||
- [ ] **Documentation has been updated, if necessary** | ||
- [ ] **Code follows the style guide of the project** | ||
| ||
|
||
## Description | ||
|
||
| ||
|
||
<!-- Provide a brief description of your changes. --> | ||
|
||
| ||
|
||
## Screenshots (if applicable) | ||
|
||
| ||
|
||
<!-- Add screenshots or GIFs to help explain your changes. --> | ||
|
||
| ||
|
||
## Additional Notes | ||
|
||
| ||
|
||
<!-- Any additional information you want to provide that is not covered by the checklist or description. --> | ||
|
||
| ||
|
||
## Related Issues or PRs | ||
|
||
| ||
|
||
<!-- If your pull request is related to any issue(s) or other pull request(s), mention them here. --> | ||
|
||
| ||
|
||
## Reviewer Guidelines | ||
|
||
| ||
|
||
<!-- Suggest specific areas of the codebase that you would like the reviewer to focus on. --> | ||
|
||
| ||
|
||
## Testing Instructions | ||
|
||
| ||
|
||
<!-- Provide step-by-step instructions on how to test your changes. --> | ||
|
||
| ||
|
||
## Checklist for Reviewers | ||
|
||
| ||
|
||
- [ ] Code follows project conventions and style | ||
- [ ] Changes do not introduce new warnings or errors | ||
- [ ] Unit tests cover the changes | ||
- [ ] Documentation is updated | ||
| ||
|
||
## By submitting this pull request, I confirm that my contribution is made under the terms of the MIT License. |
This file contains hidden or 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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
|
||
|
||
|
||
Try tweaking a waterfall chart using this codesandbox link <a href="https://codesandbox.io/s/waterfall-chart-example-uvr8jd">here</a> | ||
Try tweaking a waterfall chart using this codesandbox link <a href="https://codesandbox.io/p/sandbox/react-water-fall-chart-nxkyrt">here</a> | ||
|
||
|
||
|
||
|
@@ -38,7 +38,7 @@ You’ll need to install React separately since it isn't included in the package | |
|
||
## Usage | ||
|
||
React Waterfall chart can run in a very basic mode by just providing the `transactions` like given below: | ||
React Waterfall chart can run in a very basic mode by just providing the `dataPoints` like given below: | ||
|
||
|
||
|
||
|
@@ -47,27 +47,27 @@ React Waterfall chart can run in a very basic mode by just providing the `transa | |
import WaterfallChart from '@keyvaluesystems/react-waterfall-chart'; | ||
|
||
<WaterfallChart | ||
transactions={transactionList} | ||
dataPoints={dataPoints} | ||
/> | ||
|
||
``` | ||
|
||
|
||
|
||
The transactions prop is an array of transactions with the following keys: | ||
The dataPoints prop is an array of dataPoint with the following keys: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this prop renaming is a breaking change, it would be better to specify it in the readme along with the migration steps. For more info refer other repos that has similar changes |
||
|
||
|
||
|
||
- `label` - a string to represent each transaction | ||
- `label` - a string to represent each dataPoint | ||
|
||
- `value` - a number that specifies the transaction quantity | ||
- `value` - a number that specifies the dataPoint quantity | ||
|
||
An example for transactions array is shown below: | ||
An example for dataPoint array is shown below: | ||
|
||
|
||
|
||
```jsx | ||
const transactionsList = [{ | ||
const dataPoints = [{ | ||
label: 'Quarter 1, 2020', | ||
value: 1000 | ||
},{ | ||
|
@@ -78,11 +78,11 @@ const transactionsList = [{ | |
|
||
You can use `barWidth` prop to specify the width of each bar present in the chart. The given value will be converted to pixels (px) and applied to the chart. | ||
With the help of `showBridgeLines` prop, the line connecting the adjacent bars can be shown/hidden. | ||
`showFinalSummary` can be used to display the summary as the last transaction. | ||
`showFinalSummary` can be used to display the summary as the last bar. | ||
|
||
```jsx | ||
<WaterfallChart | ||
transactions={transactionsList} | ||
dataPoints={dataPoints} | ||
barWidth={100} | ||
showBridgeLines={true} | ||
showFinalSummary={false} | ||
|
@@ -95,7 +95,7 @@ You can specify whether to show or hide the scale lines in the Y axis with the h | |
|
||
```jsx | ||
<WaterfallChart | ||
transactions={transactionsList} | ||
dataPoints={dataPoints} | ||
showYAxisScaleLines={true} | ||
/> | ||
``` | ||
|
@@ -113,9 +113,9 @@ You can specify whether to show or hide the scale lines in the Y axis with the h | |
</thead> | ||
<tbody> | ||
<tr> | ||
<td><code><b>transactions:</b> object[]</code></td> | ||
<td><code><b>dataPoints:</b> object[]</code></td> | ||
<td> | ||
An array of transaction objects to specifying the value and label | ||
An array of dataPoint objects to specifying the value and label | ||
</td> | ||
<td><code>[]</code></td> | ||
</tr> | ||
|
@@ -150,7 +150,7 @@ The distance between each y axis scale unit. The value specified will be applied | |
<tr> | ||
<td><code><b>showFinalSummary?:</b> boolean</code></td> | ||
<td> | ||
The boolean value to control the display of summary section. The summary will be displayed as the last transaction | ||
The boolean value to control the display of summary section. The summary will be displayed as the last bar | ||
</td> | ||
<td><code>true</code></td> | ||
</tr> | ||
|
@@ -162,6 +162,19 @@ The x axis label to be shown for the summary section. | |
<td><code>Summary</code></td> | ||
</tr> | ||
<tr> | ||
<td><code><b>onMouseEnter?:</b> function</code></td> | ||
<td> | ||
The callback function which will be triggered on mouse entering the bars in the waterfall chart. The mouse event and current bar element will be passed as the prop in the function | ||
</td> | ||
<td><code>undefined</code></td> | ||
<tr> | ||
<td><code><b>onMouseLeave?:</b> function</code></td> | ||
<td> | ||
The callback function which will be triggered on mouse leaving the bars in the waterfall chart. The mouse event and current bar element will be passed as the prop in the function | ||
</td> | ||
<td><code>undefined</code></td> | ||
</tr> | ||
<tr> | ||
<td><code><b>onChartClick?:</b> function</code></td> | ||
<td> | ||
The callback function which will be triggered on clicking the bars in the waterfall chart. The current bar element will be passed as the prop in the function | ||
|
@@ -187,7 +200,7 @@ the below code shows all the overridable styles: | |
|
||
```jsx | ||
<WaterfallChart | ||
transactions={transactionsList} | ||
dataPoints={dataPoints} | ||
showYAxisScaleLines={true} | ||
styles={{ | ||
summaryBar: CSSProperties, | ||
|
This file contains hidden or 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,23 @@ | ||
## SCSS Style Guidelines for @keyvaluesystems/react-waterfall-chart | ||
|
||
**Introduction** | ||
|
||
As an open-source project utilizing SCSS, @keyvaluesystems/react-waterfall-chart strives to maintain a consistent and well-structured codebase. These SCSS style guidelines serve as a reference for contributors, ensuring that their SCSS code adheres to established conventions and best practices. | ||
|
||
**SCSS Coding Conventions** | ||
|
||
- Organize SCSS files into a logical structure. | ||
- Use meaningful and descriptive names for variables, mixins, and classes. | ||
- Use SCSS nesting judiciously to organize complex styles. | ||
- Include comments to explain non-obvious logic and complex styles. | ||
- Utilize SCSS variables to define reusable values. | ||
- Employ a SCSS linting tool. | ||
- Should support devices with all resolutions | ||
- Follow CamelCase conventions for class names that concisely convey their purpose, enhancing code organization and readability | ||
- Adhere to the practice of reusing style classes to improve code organization and maintainability. | ||
|
||
**Documentation Practices** | ||
|
||
- Provide clear documentation for exported mixins and variables. | ||
- Include a README file within the SCSS directory if necessary. | ||
- Add comments to SCSS files. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.