Polaris Viz
Polaris Viz is a data visualization React component library. It was built to help Shopify merchants better understand their data.
Installation
Run the following command using npm:
npm install @shopify/polaris-viz --save
If you prefer Yarn, use the following command instead:
yarn add @shopify/polaris-viz
Usage
If your app is set up to consume esnext
builds, import components where you want to use them and the styles will automatically be applied.
If your app is not set up for esnext
, import the styles where you import components from the libary:
import '@shopify/polaris-viz/styles.css';
Components
Viz | Use cases | Props |
---|
Normalized stacked bar chart
|
Used for positive datasets with two to four items. If your dataset has more than four items, consider grouping the fourth item and the remainder into an “other” category before passing data to the component.
| - data (required):
{formattedValue: string, value: number, label: string}[]
- accessibilityLabel:
string
- size:
small | medium | large
- orientation:
vertical | horizontal
- colors:
colors[] | ColorScheme
|
Contributing
Pull requests are welcome.
Licenses
- Source code is under a custom license based on MIT. The license restricts Polaris Viz usage to applications that integrate or interoperate with Shopify software or services, with additional restrictions for external, stand-alone applications.