[docs][xs] - added catalog example
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
# How to have data rich documents with charts and tables?
|
# How to have data rich documents with charts and tables?
|
||||||
|
|
||||||
|
|
||||||
## Tables
|
## Data previews
|
||||||
|
|
||||||
- You can use the table component
|
- If you want to have data previews, you can use the `<Table>` component
|
||||||

|

|
||||||
|
|
||||||
- It can be used with raw data
|
- It can be used with raw data
|
||||||
@@ -43,7 +43,8 @@
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
- It can be used with a raw csv string
|
|
||||||
|
- It can be used by passing a raw csv string
|
||||||

|

|
||||||
```
|
```
|
||||||
<Table
|
<Table
|
||||||
@@ -54,17 +55,20 @@
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
- It can be used with a URL string
|
|
||||||
|
- It can be used by passing a URL string
|
||||||

|

|
||||||
```
|
```
|
||||||
<Table url="https://raw.githubusercontent.com/datasets/finance-vix/main/data/vix-daily.csv" />
|
<Table url="https://raw.githubusercontent.com/datasets/finance-vix/main/data/vix-daily.csv" />
|
||||||
```
|
```
|
||||||
|
- More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-table--docs)
|
||||||
|
|
||||||
## Charts
|
## Charts
|
||||||
|
|
||||||
### Linecharts
|
### Linecharts
|
||||||
|
|
||||||
- You can add LineCharts passing in a array of data
|
- You can add simple line charts with the `<LineChart>` component
|
||||||
|
- Here is an example passing in a array of data
|
||||||

|

|
||||||
```
|
```
|
||||||
<LineChart
|
<LineChart
|
||||||
@@ -92,7 +96,7 @@
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
- You can pass a URL
|
- And here passing an url
|
||||||

|

|
||||||
```
|
```
|
||||||
<LineChart
|
<LineChart
|
||||||
@@ -102,6 +106,7 @@
|
|||||||
yAxis="Price"
|
yAxis="Price"
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
- More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-linechart--docs)
|
||||||
|
|
||||||
### Vega Charts
|
### Vega Charts
|
||||||
|
|
||||||
@@ -141,6 +146,7 @@ You can add Vega charts with the `<Vega />` component like this, it supports all
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
- More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vega--docs)
|
||||||
|
|
||||||
### VegaLite Charts
|
### VegaLite Charts
|
||||||
|
|
||||||
@@ -179,3 +185,19 @@ You can add Vega charts with the `<Vega />` component like this, it supports all
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
- More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vegalite--docs)
|
||||||
|
|
||||||
|
## Catalog
|
||||||
|
|
||||||
|
- You can add a `<Catalog>` component that takes a list of dataset and will provide you with a searchable interface.
|
||||||
|

|
||||||
|
- The dataset object requires the following structure
|
||||||
|
```
|
||||||
|
_id //A unique identifique for the item in the catalog
|
||||||
|
metadata //The dataset metadata
|
||||||
|
url_path //The url for the dataset showcase page
|
||||||
|
```
|
||||||
|
- You can also add facets that are going to act as filters for your metadata
|
||||||
|

|
||||||
|
|
||||||
|
- More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-catalog--docs)
|
||||||
|
|||||||
Reference in New Issue
Block a user