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>
| | `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
There was a problem hiding this comment.
sunburst charts have maxSegments rather than maxBars
I think your comments are referring to the wrong part of the code since I updated the files, nm
| [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?
| ```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
Co-authored-by: Mitchell Shiell <59712867+MitchellShiell@users.noreply.github.com>
8db94c9 to
2cbbd40
Compare
| | `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` | Yes | Chart configuration options | | ||
| | `theme.sortByKey` | `string[]` | No | Array of keys to sort the data by. | |
There was a problem hiding this comment.
Maybe we can add a line for the customTickValueSize prop I added to the theme.axisBottom object? https://github.com/overture-stack/arranger/pull/1075/changes#diff-121c70166491dfb648797ab0e42d02e7eef8dd876485f6dd280aa14c0a4b402cR27
name: theme.axisBottom.customTickValueSize
type: number
required: false
description: For setting a custom step size for the bottom (X) axis
There was a problem hiding this comment.
I also added the suppression label ("Too few") for the Bar Chart rows tooltip, but that is for an irregular use case, not sure if worth mentioning in the docs.
Summary
Issues
Description of Changes
Readiness Checklist
.env.schemafile and documented in the README