Arranger Charts Docs#1083
Conversation
There was a problem hiding this comment.
good call adding this! however, it belongs at the Overture-stack org level, so we can relocate it there. I'll put that in the roadmap, and we can leave it here for now 👍
There was a problem hiding this comment.
scratch that. this file can be removed, we already point at a code of conduct in the overture docs site from the CONTRIBUTING.md in this repo
|
|
||
| ### BarChart | ||
|
|
||
| Renders a horizontal bar chart for aggregation data. |
There was a problem hiding this comment.
If introducing a visual component please include a screenshot of the component.
| # Overview | ||
|
|
||
| **Arranger Charts** is a plugin for Arranger UIs for adding interactive aggregated data charts to React applications. It currently supports Bar and Sunburst charts. Arranger Charts also uses a React context provider to request data from Arranger Server for all charts on the page. Interacting with the charts can update the filters for data requested from Arranger Server. | ||
|
|
There was a problem hiding this comment.
Please include a screen shot of the charts within a discovery page
|
|
||
| ## Developer Setup | ||
|
|
||
| This guide will walk you through setting up a complete development environment for Arranger Charts, including its complementary services. |
There was a problem hiding this comment.
This statement seems out of place given the context of the page
| npm i @overture-stack/arranger-charts @overture-stack/arranger-components | ||
| ``` | ||
|
|
||
| ### Quick Start |
There was a problem hiding this comment.
Not really a quick start more of an implementation guide which is great, should think about how we can flesh this out a bit more, "building a discovery page"
Co-authored-by: Mitchell Shiell <59712867+MitchellShiell@users.noreply.github.com>
| | `debugMode` | `boolean` | No | Enable verbose logging for development | | ||
| | `disableIncludeMissing` | `boolean` | No | Hide properties with "No Data" | | ||
| | `loadingDelay` | `number` | No | Delay network results by milliseconds | |
There was a problem hiding this comment.
while debugMode and loadingDelay are correctly marked as optional, the type actually requires them in Provider.tsx:22-26. they need to be made optional there
There was a problem hiding this comment.
sorry, should I do that on this PR or make a new issue/PR?
| | `components` | `object` | No | Custom fallback components | | ||
| | `components.EmptyData` | `ReactComponent` | No | Custom empty state component | | ||
| | `components.ErrorData` | `ReactComponent` | No | Custom error component | | ||
| | `components.Loader` | `ReactComponent` | No | Custom loading component | |
There was a problem hiding this comment.
i think components.TooltipComp could also go here, but maybe not worth adding? 🤔
not sure what the right call is here.
There was a problem hiding this comment.
TooltipComp never gets used :/
| | `handlers.onClick` | `function` | No | Callback when clicking a bar segment | | ||
| | `maxBars` | `number` | Yes | Maximum number of bars to display | | ||
| | `ranges` | `Range[]` | No | For numeric fields, specify value ranges. A `Range` is `{ key: string, from: number, to: number }`. | | ||
| | `theme` | `object` | No | Event handlers | |
There was a problem hiding this comment.
the description here seems like missed copy/pasta, and this is a required property at BarChart.tsx:23-30
|
|
||
| const chartFilters = useMemo( | ||
| () => ({ | ||
| [fieldName]: chartFilter(fieldName, sqon, setSQON), |
There was a problem hiding this comment.
chartFilter is not shown as imported... if this is something consumers are expected to implement themselves, a comment here may help identify that
There was a problem hiding this comment.
I decided to remove this example because there's a fair bit of additional code involved and it's really specific to OHCRN.
| <ChartsThemeProvider> | ||
| <BarChart | ||
| fieldName={fieldName} | ||
| maxBars={maxBars} |
There was a problem hiding this comment.
maxBars wasn't defined anywhere. this could be shown as commented with a comment if BarChart has a default
| [sqon, setSQON], | ||
| ); | ||
|
|
||
| return ( |
There was a problem hiding this comment.
the other examples in this doc are wrapped in <ArrangerDataProvider>
may be worth adding it here too as it's needed and for consistency
| | Name | Type | Required | Description | | ||
| | ------------------ | ---------- | -------- | ----------------------------------------------- | | ||
| | `fieldName` | `string` | Yes | GraphQL field name to visualize | | ||
| | `maxSegments` | `number` | Yes | Custom fallback components | |
There was a problem hiding this comment.
the description doesn't seem accurate. it used to say "Maximum number of segments to display".
copy pasta from components @ ChartsThemeProvider?
| # Arranger Charts | ||
|
|
||
| A React chart library for visualizing Arranger aggregation. | ||
| !TODO Rename to README.md |
There was a problem hiding this comment.
probably not needed anymore?
| - `Loader`: Custom loading component | ||
| - `ErrorData`: Custom error component | ||
| - `EmptyData`: Custom empty state component | ||
| - Node 22 or above |
There was a problem hiding this comment.
line 80 states v24+ (which i like)
| @@ -0,0 +1,46 @@ | |||
| # Development | |||
|
|
|||
| This guide covers how to develop or contribute to Arranger Charts. For using Arranger Charts in a React application, see !TODO LINK TO GUIDES/USAGE. | |||
There was a problem hiding this comment.
this link can be added now 👍
| ```bash | ||
| # in your local Arranger folder | ||
| cd modules/charts | ||
| npm link | ||
| cd ../.. | ||
| cd modules/components | ||
| npm link | ||
| ``` |
There was a problem hiding this comment.
note to self @justincorrigible: make this a batch/make command
… into feat/docs-charts
Summary
Issues
Description of Changes
Readiness Checklist
.env.schemafile and documented in the README