dataforgoodfr / dataforgoodfr/Coordonnees
[Coordo Backend] Feature - Adding a dashboard/graph engine to the lib
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
This issue MAY be divided into smaller issues. The goal of this issue is to discuss and validate an approach to be able to generate charts on the dasboard, with an API similar to the one we are using for MapLibre.
Here are the steps I think are relevant :
- Define a JSON schema which could represents a set of graphs, for ex for a graph of medium height over months
{
"package": "inventaire",
"resource": "inventaire_id",
"charts": [
{
"type": "line",
"x": "month(date)",
"y": "mean(ind.haut)"
}
]
}
-
Write a config parser which can take this config, and generates a list of ChartJS configurations (including the data), some logic can be reused from the map config parser, and the datapackage part of the code can be reused as-is.
-
Write both a request handler (python side) and a createCharts() func (javascript side) which are able to instantiate charts in HTML elements and to update filters by communicating with each other (a lot of logic from the map part can also be reused here I think)
Here the complexity is to find a way which is easy to integrate for devs, but also can update multiple graphs depending on the same data source which can be at multiple places in the HTML, this part should be discussed further because I don't see a straightforward solution to this.
Maybe having we should add an explicit "source" object, which will be common to both the map and chart engine. And when updating filters it should not happens at the layer level but at the source (and this way, only one call to setSourceFilter(source, layer) would update the layers AND the graphs automatically. But that would require more change to the javascript part (because it would need to track the source-layer and source-chart relations and update them accordingly)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing map config parser and datapackage logic, then inspect the Python request-handler and JavaScript map integration entry points mentioned in the issue. Review the ChartJS configuration format and determine how the proposed schema, shared data sources, filters, and multiple charts should be validated. Done means the approach is agreed before the implementation is split into smaller issues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- chart.js, javascript, python
- Domain
- backend, data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100