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

Create custom heat-map components, layouts, aggregation widgets #3196

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

cemalettin-work
Copy link
Contributor

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

  • anet.yml needs change
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@cemalettin-work cemalettin-work force-pushed the GH-3172-Create-custom-heatmap-layouts-widgets branch from 4f1cb0d to 623281b Compare September 16, 2020 07:45
@cemalettin-work cemalettin-work changed the title Gh 3172 create custom heatmap layouts widgets Create custom heat-map components, layouts, aggregation widgets Sep 16, 2020
@gjvoosten gjvoosten force-pushed the GH-3172-Create-custom-heatmap-layouts-widgets branch from 2f9d152 to 3537817 Compare September 16, 2020 11:51
@cemalettin-work cemalettin-work force-pushed the GH-3172-Create-custom-heatmap-layouts-widgets branch 5 times, most recently from 42725a5 to fe67639 Compare September 21, 2020 06:03

const Chart = ({ items, layoutType, widgetElement, widgetConfig, style }) => {
const aggregator = LAYOUT_AGGREGATORS[layoutType]
const [aggregatedItems] = aggregator(items)
Copy link
Contributor

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 => {
Copy link
Contributor

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, ",
Copy link
Contributor

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

@cemalettin-work cemalettin-work force-pushed the GH-3172-Create-custom-heatmap-layouts-widgets branch 2 times, most recently from 47ebe45 to 76610c0 Compare October 14, 2020 08:21
@cemalettin-work cemalettin-work force-pushed the GH-3172-Create-custom-heatmap-layouts-widgets branch from 76610c0 to a1391c0 Compare October 23, 2020 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change fullcalendar to a custom calendar+heatmap library/components for extended features
3 participants