Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[portaljs/components] Tidy API and docs of the components #1089

Closed
3 of 8 tasks
olayway opened this issue Mar 29, 2024 · 3 comments
Closed
3 of 8 tasks

[portaljs/components] Tidy API and docs of the components #1089

olayway opened this issue Mar 29, 2024 · 3 comments
Assignees
Labels

Comments

@olayway
Copy link
Member

olayway commented Mar 29, 2024

Acceptance

  • all the components stories are reviewed and components props are documented clearly
  • hide BucketViewer for now as not really usable
  • hide OpenLayers one as we're using a new Map component
  • unify components data-passing API to allow for passing only data prop (no csv, url, or rawCsv), which would have the following interface (or similar)
interface DataProp {
    url?: "string";
    values?: Array<number | string>,
    csv?: "string"
}

Notes / Shaping

Tasks:

  • 🚧 go through all the components' stories and add missing field descriptions and enhance existing ones, making it super-clear on how to use them
  • (maybe) deprecate the Table component as I've heard

data argument: Multiple names - Situation + Problem + Solution

  • (maybe) tidy up the API just a bit: e.g. some components allow for passing either csv OR data OR url props, some allow for passing data that can be either of those three things, some allow for passing rawCsv (instead of csv)
    • Solution A: use only one data prop in all those components that can take in either csv string or url or data array
    • Solution B: use csv, url, data props in all those components

NB: mostly what we are doing is just wrapping an existing library so that it can be used in DataHub ...

e.g. already have ReactVega but we modify it a litle ...

  • What do we modify it ...

In terms of design:

  • If i were building a component

// data is preparsed in a nice form ...
Table(data=...)
Chart(data=...)

Usage

mydata = loadAndParseCsv(pathToCsv)
Table(data=mydata)
Chart(data=mydata)

But for markdown we don't have this option ... and we need to wrap ...

TableForUseInMarkdown(data={table: ...})
TableForUseInMarkdown(data={url: ...})
@olayway
Copy link
Member Author

olayway commented Apr 8, 2024

@demenech any progress here? :)

@demenech
Copy link
Member

demenech commented Apr 9, 2024

PR: #1103

CC: @olayway

olayway added a commit that referenced this issue Apr 17, 2024
…vements

Components API and docs improvements
Related to: #1089
@olayway
Copy link
Member Author

olayway commented Apr 18, 2024

FIXED

@olayway olayway closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants