-
Notifications
You must be signed in to change notification settings - Fork 11
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
Create custom heat-map components, layouts, aggregation widgets #3196
base: main
Are you sure you want to change the base?
Create custom heat-map components, layouts, aggregation widgets #3196
Conversation
4f1cb0d
to
623281b
Compare
2f9d152
to
3537817
Compare
42725a5
to
fe67639
Compare
|
||
const Chart = ({ items, layoutType, widgetElement, widgetConfig, style }) => { | ||
const aggregator = LAYOUT_AGGREGATORS[layoutType] | ||
const [aggregatedItems] = aggregator(items) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A chart should not assume it contains aggregations. It could be a simple bar chart.
It should take a collection of items, and map them to the appropriate GUI components based on how it is configured.
I suggest to have chart take a collection of items. If they have been aggregated, it should take as an input the list of aggregated groupings as items, with the original items referenced from the aggregations
}) => { | ||
return ( | ||
<> | ||
{items.map(item => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mapping of items to widgets should is not specific to dates, It should probably happen in Chart, as it is the main function of a Chart.
This will allow us not to have a specific DateChart component. This will allow us to have an instance of Chart that then can be reconfigured from date to geo, to etc. Doing so, will allow us to reuse the same instances of the widgets and be able to animate the transitions.
} | ||
}) | ||
} | ||
export const COLOR_NAMES_TO_RGB = { | ||
red: "rgb(155, 0, 0, ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably make use of https://github.com/d3/d3-color
and possibly create continuous color palettes/legends:
https://github.com/d3/d3-scale-chromatic/blob/master/README.md
47ebe45
to
76610c0
Compare
Prettier trailingComma none
Storybook was using old anet.yml, now anet-dictionary.yml
Add month layout to storybook, move constants to utils
76610c0
to
a1391c0
Compare
Added Month, Year layouts and Chart component for future use, which includes yearly heatmap and monthly, yearly calendar features.
Release notes
Closes #3172 and may also close #3075
User changes
Super User changes
Admin changes
System admin changes
Checklist
repo#issue: Title
title format and these 7 rules