# How to have data rich documents with charts and tables? ## Data previews - If you want to have data previews, you can use the `` component ![](https://hackmd.io/_uploads/HyrtR_mS2.png) - It can be used with raw data ```
``` - It can be used by passing a raw csv string ![](https://hackmd.io/_uploads/SJglXtQrh.png) ```
``` - It can be used by passing a URL string ![](https://hackmd.io/_uploads/S19GXYXBn.png) ```
``` - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-table--docs) ## Charts ### Linecharts - You can add simple line charts with the `` component - Here is an example passing in a array of data ![](https://hackmd.io/_uploads/S1TBXYXH3.png) ``` ``` - And here passing an url ![](https://hackmd.io/_uploads/SkHd7KXS3.png) ``` ``` - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-linechart--docs) ### Vega Charts You can add Vega charts with the `` component like this, it supports all the Vega specification: ![](https://hackmd.io/_uploads/ryN5mYmSh.png) ``` ``` - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vega--docs) ### VegaLite Charts - You can add VegaLite charts with the `` component like this, it supports all the VegaLite specification: ![](https://hackmd.io/_uploads/rJ2nQt7B3.png) ``` ``` - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vegalite--docs) ## Catalog - You can add a `` component that takes a list of dataset and will provide you with a searchable interface. ![](https://hackmd.io/_uploads/rJv-d3Xr3.png) - 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 ![](https://hackmd.io/_uploads/HygOF3XH2.png) - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-catalog--docs)