Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bpk-component-barchart
Advanced tools
Backpack bar chart component.
npm install bpk-component-barchart --save-dev
import React from 'react';
import BpkBarchart from 'bpk-component-barchart';
const priceData = [
{
day: 'mon',
price: 240,
},
// ...
];
export default () => (
<BpkBarchart
xAxisLabel="Weekday"
yAxislabel="Price (£)"
xScaleDataKey="day"
yScaleDataKey="price"
initialWidth={500}
initialHeight={300}
data={priceData}
/>
);
Property | PropType | Required | Default Value |
---|---|---|---|
data | custom(validates usage of scale keys) | true | - |
xScaleDataKey | string | true | - |
yScaleDataKey | string | true | - |
xAxisLabel | string | true | - |
yAxisLabel | string | true | - |
initialWidth | number | true | - |
initialHeight | number | true | - |
className | string | false | null |
outlierPercentage | number | false | null |
showGridlines | bool | false | false |
xAxisMargin | number | false | 3 |
xAxisTickValue | func | false | identity |
xAxisTickOffset | number | false | 0 |
xAxisTickEvery | number | false | 1 |
yAxisMargin | number | false | 2.625 |
yAxisTickValue | func | false | identity |
yAxisNumTicks | number | false | null |
onBarClick | func | false | null |
onBarHover | func | false | null |
onBarTouch | func | false | null |
getBarLabel | func | false | See prop details |
getBarSelection | func | false | See prop details |
BarComponent | func | false | BpkBarchartBar |
disableDataTable | bool | false | false |
An array of data points with a value for the x axis and y axis respectively. The keys for the x axis and y axis can be anything you choose. Specify the keys with the props xScaleDataKey
and yScaleDataKey
. For this data the xScaleDataKey
would be day
and the yScaleDataKey
price
.
[
{
"day": "mon",
"price": 240
},
{
"day": "tus",
"price": 340
},
{
"day": "wen",
"price": 300
},
{
"day": "thu",
"price": 340
},
{
"day": "fri",
"price": 353
},
{
"day": "sat",
"price": 290
},
{
"day": "sun",
"price": 380
}
]
The key in each data point that holds the value for the x axis of that data point.
The key in each data point that holds the value for the y axis of that data point.
Values that are outlierPercentage
percent above the mean of the whole dataset are considered outliers and rendered cut off instead of at their full height.
const onBarClick = (event, {
point: <Object>, // The `data` array object from the bar clicked
}) => {
...
}
const onBarHover = (event, {
point: <Object>, // The `data` array object from the bar hovered
}) => {
...
}
const onBarTouch = (event, {
point: <Object>, // The `data` array object from the bar touched
}) => {
...
}
By default the following function is used:
(point, xScaleDataKey, yScaleDataKey) => {
return `${point[xScaleDataKey]} - ${point[yScaleDataKey]}`;
}
Must be a function which returns true based on the point
argument:
const getBarSelection = (point) => {
return point.myKnownProperty === 'foo';
}
FAQs
Backpack bar chart component.
The npm package bpk-component-barchart receives a total of 51 weekly downloads. As such, bpk-component-barchart popularity was classified as not popular.
We found that bpk-component-barchart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.