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

[IMP] charts: Add GeoChart type #5096

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

hokolomopo
Copy link
Contributor

Description:

This adds the geo chart type, which display a map of the world with countries highlighted based on the values in the sheet.

Task: 3265268

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

This commit simplifies the use of color scales in the conditional format
plugin and export the color scales to an helper.

Now we have a simple `getColorScale` helper, that take as argument
a number of value/color pairs (the thresholds) and return a function
that computes a color based on a value and the provided value/color
pairs.

All the complexity of the color scale computation is now hidden in
the helper, which simplify the use of color scale a lot and allows us
to use them in other places.

Task: 3265268
@robodoo
Copy link
Collaborator

robodoo commented Oct 15, 2024

Pull request status dashboard

@hokolomopo hokolomopo force-pushed the master-geo-chart-adrm branch 4 times, most recently from 5e17110 to fdff50e Compare October 16, 2024 14:14
This commit adds the geo chart type, which display a map of the world
with countries highlighted based on the values in the sheet.

The chart is drawn with the `chartjs-chart-geo` library that is an
extension of Chart.js.

To work, the geo chart need a `geoJsonService` given as parameter of
the model that contains three methods:

- `getAvailableRegions`: return the list of regions available
- `getTopoJson`: return the topoJson/geoJson of a region
- `geoFeatureNameToId`: convert an arbitrary string into a geo feature
id present in the topoJson file

Task: 3265268
Comment on lines +54 to +55
- probably too many colorScales we should pick some to keep
- same for projections => probably pick, one projection by region and stick with it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed for both

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.

3 participants