From f52832624fd9a23dfc17774c06d49d77b6dcf44e Mon Sep 17 00:00:00 2001 From: Luccas Mateus de Medeiros Gomes Date: Thu, 18 May 2023 13:43:29 -0300 Subject: [PATCH] [docs][howto] - added catalog code --- site/content/howto/drd.md | 93 ++++++++++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 12 deletions(-) diff --git a/site/content/howto/drd.md b/site/content/howto/drd.md index 8b0cd18c..d64e9a3f 100644 --- a/site/content/howto/drd.md +++ b/site/content/howto/drd.md @@ -4,6 +4,7 @@ PortalJS comes with a library of components that provides essential pieces for y You can install the library with: ```sh npm i @portaljs/components +``` ## Table @@ -12,7 +13,7 @@ An easy-to-use table component with built-in pagination, search, and sorting. ### Use with raw data -``` +```js ``` + - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-table--docs) ## Charts @@ -75,7 +79,8 @@ An easy-to-use table component with built-in pagination, search, and sorting. - 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) -``` + +```js ``` + - 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) -``` +```js ``` + - More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-vegalite--docs) ## Catalog A searchable catalog that will index a list of datasets and allow for contextual searching + filters. ![](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 +- The dataset object requires the following structure(the metadata field can have any structure that you may want) + +```js + ``` + - You can also add facets that are going to act as filters for your metadata ![](https://hackmd.io/_uploads/HygOF3XH2.png) + +```js + +``` >[!info] > More info on the [storybook page](https://storybook.portaljs.org/?path=/docs/components-catalog--docs)