GithubHelp home page GithubHelp logo

riatelab / magrit Goto Github PK

View Code? Open in Web Editor NEW
118.0 11.0 18.0 250 MB

Thematic cartography entirely in the browser ♥

Home Page: https://magrit.cnrs.fr

License: GNU General Public License v3.0

CSS 2.19% HTML 0.07% TypeScript 97.64% Dockerfile 0.10%
cartography d3js mapping maps geography solidjs

magrit's Introduction

Magrit - Thematic cartography

Magrit - Banner

[en] Magrit is an online thematic mapping application developed by UAR RIATE.
[fr] Magrit est une application de cartographie thématique développée par l'UAR RIATE.

GitHub Release

OpenSSF Best Practices

Basics

  • Magrit is a web application for thematic mapping (cartography).
  • Everything happens in the browser, so your data never leaves your computer.
  • It's intentionally simple (the UI follows the basic steps of map creation).
  • It's designed for teaching and learning cartography.
  • It lets you import your own geometry dataset (Shapefile, GeoJSON, GML, GeoPackage, etc.) and optionally your tabular file (CSV, XLS, XLSX, etc.).
  • We also provide many sample datasets to try out the various representations and become familiar with the application.
  • It allows you to render and combine a wide variety of maps: choropleth, proportional symbols, cartogram, discontinuity, smoothed maps, links, etc.
  • It allows you to customize the appearance of your maps in various ways.
  • It supports all the most popular modern desktop browsers.
  • Magrit is written in modern JS and uses notably solid.js and d3.js libraries as well as various WebAssembly modules (GDAL, GEOS, Contour-wasm, go-cart-wasm).

Try it out

Examples

Example map - Youth in Europe Example map - World wealth Example map - Cinemas in Paris

Latest changes

You can find the latest changes in the Changelog file, either in the source code (in French or in English) or directly on the Web site (French or English).

Information about changes are also available in the release notes of the GitHub repository.

Development

Requirements:

  • Node.js (>= 20) / NPM (>= 10).

Installation

npm install

Running for development

npm run dev

The application will be available at http://localhost:3000.

Running for development, with electron

npm run dev:electron

A window will open with the application running.

Building for production

npm run build

The application and it's documentation will be built in the dist directory.

Building for production, with electron

npm run build:electron

The application (for Windows and GNU/Linux) will be built in the release directory.

Contributing to Magrit

Contributions are welcome! There are various ways to contribute to the project which are detailed in CONTRIBUTING file! You can notably:

  • Report bugs or send us feedback.
  • Add new translations or fix existing ones.
  • Contribute code (you're in the right place! Clone the repo, fix what you want to be fixed and submit a pull request - note that for all non-trivial modifications, it's best to start by opening an issue to discuss it together!).

If you want to read more about what we are planning to do, you can check the roadmap of the project.

License

GPL-3.0-or-later

magrit's People

Contributors

armelvidali avatar justeraimbault avatar mthh avatar rcarto avatar rekyt avatar roblittiere avatar rysebaert avatar vinber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magrit's Issues

Problème de rendu svg

Quand je veux exporter certaines projections, cela ne semble pas fonctionner.

Exemple

  • un nouveau projet
  • Sélection d'un fond de carte d'exemple (world_countries_data)
  • dans les choix de projections, choisir plus d'option, sélectionner lambert93, reprojetter
  • cela fonctionne
  • export de la carte en svg
  • le fichier est vide

Cet exemple est également vérifié avec la projection conique conforme

Firefox 68 / Ubuntu 18.04

Order of appearance and renaming of variables in Waffle map

In waffle maps:

  • the variables used should be reorderable (order of appearance in the legend and order of appearance within a waffle).
  • the name of the variables should be editable.

For example in the following map

  • I would have liked to have "P07_POP" appearing before "P12_POP" in the legend (and thus the squares of "P07_POP" drawn before (below) the squares of "P12_POP") and it is impossible,
  • I would have liked to rename my variables to "Population 2007" and "Population 2012" and it is impossible.

waffle

Joining data and basemap at the commune scale

Hi,

We are trying to plot data at the commune level. We're easily loading the template from http://magrit.cnrs.fr as well as our data ; however when attempting to join COMMUNES and our data using INSEE codes MAGRIT displays "Loading results" and never finishes.

Thanks for your help,
Alice

Opening of the overlay dedicated to file uploads

Sometimes when trying to reorder the layers in "gestion des couches / layers", or when reordering the modalities of the legend of a categorical map, the overlay dedicated to upload files appears.
(In fact it happens when going a bit beyond the appropriate area in both cases.)

I guess it could be easily fixed.

Adding sample layer

I would like to customize the list of sample base layers for a group of students. I have added TopoJSON and GeoJSON files to magrit_app/static/data_sample, and modified static/json/sample_layers.json and client/js/layers.js and can't make it work.

Change symbols color

In the layers panel, make possible to change color of displayed symbols, as proposed for categorical maps.
magrit
l

Joining data and basemap on a string field

Hi,

It would be really nice to be able to join data and basemap on a string field, say names, with some basic operations being performed on the field so that accents, small orthographic mistakes or punctuation differences don't influence the joint.

It could start as a joint on func(names) rather than names with
func = lambda x: unidecode(x.translate(str.maketrans('', '', string.punctuation)).lower().replace(' ', ''))

As to correcting orthographic mistakes I'm not sure which package/algorithm is the best for French pronunciation - any idea? It seems like Soundex, dMetaphone or NYIIS are rather optimized for English words (for example from a quick check they match Blainville and Blonville, and don't match Brévands and Brévan).

Thanks,
Alice

Waffle Map not locating

When projecting a waffle map, representation is send in the upper left corner of the map instead of being located on the basemap. The jointure is not the problem as the stock representation is working.

exemaple

Rasterisation of symbols when exporting

Hi all,

Magrit enables to add symbols (via the menu "basemap configuration and page layout" -> "add layout features"), it is very useful, but it is not possible to modify background and outline colours of symbols.

On the other hand, when exporting (SVG) the map, it seems that Magrit rasterizes symbols, which makes it impossible to modify their colours (background and outline) in a vector editing software such as Inkscape.

This leads me to two proposals:

  • make it possible to change the background and outline colours of symbols in Magrit (right-click -> options only allows you to change the size, now).

  • export the added symbols as vector objects, so that they can be modified in other software.

Thank you in advance for your answers and congratulations for your work on Magrit!

Romain

Unable to make jointure when the ID column contains empty values (on tabular dataset side)

Let say I have a basemap with 5 features like this

ID Geometry
A ...
B ...
C ...
D ...
E ...

A tabular dataset like this (i.e. there is less features in the tabular dataset) can be joined without problem :

Name ID variable
aaaa A ...
cccc C ...
eeee E ...

A tabular dataset like this (i.e. there is more features in the tabular dataset) can also be joined without problem :

Name ID variable
aaaa A ...
bbbb B ...
cccc C ...
dddd D ...
eeee E ...
ffff F ...

However I can't use the following format to make a jointure (it fails, saying that identifiers in the ID field have to be unique) :

Name ID variable
aaaa A ...
bbbb ...
cccc C ...
dddd ...
eeee E ...
ffff ...

I think it should be accepted (i.e. we should discard all features with an empty identifiers and try
to make the jointure after, which basically will be the same as if I tried to join my first example table, containing only feature A,C,E). However I think it should still fails if the identifiers in the ID field aren't unique (so, except for empty values !)

I have some examples to illustrate this (such as a dataset with incomplete values for the world; it contains a "Name" column and an "iso2" column. Some entries are like "Other Africa countries", "Total world", etc. and so the iso2 field is empty for these features).
Currently the workaround (such as removing these "others" features, or simply using there names to fill the "iso_2" column) involves to exit Magrit. I think its unnecessary and could be avoided !

Maybe i'm missing some good reasons we had to do this the current way ? Otherwise if interested I'm volunteering to implement this :)

Carte de liens (flux)

Lors de la création d'une carte de lien, impossible de faire une jointure car il y a plusieurs entités avec le même id unique.
Lorsque j'ajoute le fichier CSV d'exemple et que je choisis une représentation sous la forme de liens, l'onglet apparaît dans la barre de gauche mais l'ensemble des fonctionnalités est grisé (désactivé) car il indique ne pas avoir de jointure.
Que faire ?
Merci

Suggestion template proposé

Bonjour,

Je voulais savoir si c'était possible de rajouter un template avec les collectivités d'outre-mer dans des encarts ainsi qu'un template avec un zoom sur l’Île-de-France dans un encart.

Merci.

Utilisation des templates cartographiques proposés, encarts DOM

Bonjour,

Nous aimerions pouvoir utiliser les templates proposés qui sont très pratiques (http://magrit.cnrs.fr/, bas de la page) ; malheureusement lorsque l'on importe un fond de carte principal type shapefile, les DOM du shapefile ne sont pas localisés sur les encarts prévus pour les DOM du template. Pourriez-vous nous indiquer une solution, par exemple nous fournir les coordonnées des polygones DOM dans le template afin que nous modifiions nos shapefiles ?

Merci !
Alice

Using Magrit on the Galaxy-E project ?

Hi everyone, I'm on the way to begin the building of a Galaxy instance dedicated to macro-ecology and I think this can be of interest to think about using Magrit for SIG data visualization instead of or in addition of Leaflet/PostGIS... Maybe we can exchange about this possible enhancement ?

Modality in legend but not on the map

In a colored (by category) proportional symbols map if a spatial unit has a 0 or no value in the 1st field there is no circle drawn. If this unit is the only unit with a specific modality then the modality appears in the legend but not on the map.

In the linked project see Antarctica (with special case of unnamed or "" modality, but that's should not be relevant).
magrit_project(4).zip

Problem with Geopackage import on Windows

Should a future release support the import of geopackage files?
That would keep up with current practices.

From a technical and UX point of view I think it's not too complicated, we would only take the vector files contained in the geopackage and ask the user which of these layers (if any) is the target layer (and so import all the others as layout layers).

To go further we could also ask the user which layers to import among the vector layers contained in the file...

EDIT: For those having issues with GeoPackage on the version 2 of Magrit, the July 2024 discussion starts here.

Improve the referencing of the web page

Magrit's web page is rather poorly referenced by search engines.

On Google, (not connected to a Google account, in private browsing, in French language), when searching for "cartographie thématique", the first mention of Magrit is page 5 (with the article published in Cartes et géomatique on the CFC website) then page 6 (with the Hypothèses research notebook).
In the following pages, various resources mention Magrit but the magrit.cnrs.fr page is not displayed in the first 20 pages of results.
As a comparison, the Khartis application appears in the first page of results for "cartographie thématique".

In the same conditions, but searching for "thematic cartography" (in English language in the search parameters) the results are more satisfactory, but still improvable I think : the GitHub repository appears on page 2 and magrit.cnrs.fr appears on page 4.

On Qwant, with "cartographie thématique" we have mentions of Magrit from the first page of results, but no entry corresponding to the magrit.cnrs.fr page in the 6 pages of proposed results.

I think we could improve this referencing (addition of meta description field on the index page ; possibly meta keywords?).
Google Search Central and Google Search Console could also help us to have a good referencing, at least on Google.

Data privacy

Hi,

I was wondering which processes occur locally in my browser, and which processes take place on your servers - for which data has to be sent and eventually stored on them. According to the documentation, only user basemaps as well as representations that generate a new geometry ("carte lissée, carroyage, discontinuité, cartogramme et liens") are stored on your servers. Thus am I correct in understanding that no raw data ever travels to your servers? Or are there certain cases in which it does, e.g. for the purpose of calculating new geometries? Or does it always travel to your servers, but is stored only in the above-mentioned cases?

Thanks,
Alice

Ideas to improve Magrit deployment / reuse

Following several discussions we were given ideas of things that could facilitate the reuse of Magrit (reuse in the sense: deploy it elsewhere, in other types of environment and possibly by customizing certain aspects, etc..)

Especially :

  • the ability to change the server address to use to start Magrit (merged in #44 )
  • the simplification of how the layers of examples are taken into account (PR #45)

Some of these ideas have been given to us in the context of efforts such as iiab/iiab#1568 and iiab/iiab#1579 and some previous discussions took place as part of #24.

Maybe this thread could be used to bring up these kinds of ideas !?

Bug siteweb : footer cache la fin de la page

Le Bonjour !
Pas sûr que se soit le bon lieu pour ça, mais j'ai un problème d'affichage du site http://magrit.cnrs.fr/

Sous Firefox, le footer recouvre le bas de la page, cachant la fin des paragraphes du bas (RIATE, ...) :

magrit cnrs fr-xs
magrit cnrs fr-l
magrit cnrs fr-m

En essayant plusieurs largeur, on a des formats qui fonctionnent :

magrit cnrs fr-s
magrit cnrs fr-xl

Config : Debian 8 stable / FireFox ESR 45.7.0 / Pas de module ou autre.
Je peux donner plus de détails / faire des essais sur demande.

Actualisation des données communales

Bonjour,

Les données communales datent de 2016, or, des fusions de communes sont depuis apparues et faussent le maillage, savez-vous s'il y aura prochainement une mise à jour ?

PS : peut-on également espérer les données communales sur Mayotte ?

Bonne journée à vous.
Tom

Pouvoir masquer le contour des polygones

J'aimerais, avec une carte choroplèthe (France par commune pour situer), pouvoir masquer complètement le contour des communes (pas de stroke) pour gagner en lisibilité et en fluidité.
Mais si je fixe l'épaisseur de la bordure à 0 , et même l'opacité de la bordure à 0,
image

j'ai toujours un contour visible :
image

Projection and drawing issues on large rectangular boxes

When uploading a rectangular frame in Magrit with EPSG:3035 (ETRS89-extended / LAEA Europe), it seems that there is a mistake with the reprojection (cf below screenshot with associated layer, attached). Any idea ?

This layer in R or QGIS
should_be

Same in Magrit
is

Associated geojson file
frame.zip

problem with xlsx import

From comment under https://magrit.hypotheses.org/75

Bonjour,

J’ai depuis hier le message suivant qui s’affiche lorsque j’essaye d’importer un jeu de données via un tableau excel :

Une erreur s’est produite – L’opération en cours a été stoppée.
Détails : Unable to convert the provided file. Please check that it is a tabular file supported by the application (in xls, xlsx, ods or csv format).

J’ai vérifié et le fichier est au bon format, et même avec seulement deux colonnes, une avec les code_insee et l’autre avec les noms de communes cela ne marche pas. Avez-vous une idée de pourquoi ?

Problème avec Lambert 93

Exemple 1

  • un nouveau projet
  • Sélection d'un fond de carte d'exemple (world_countries_data)
  • dans le menu des projections, choisir plus d'options, lambert 93, reprojetter, confirmer,
  • cela fonctionne parfaitement

Exemple 2

  • un nouveau projet
  • Sélection d'un fond de carte d'exemple (world_countries_data)
  • choisir lambert93
  • et cela patine, même en laissant longtemps cela ne fonctionne pas

Position des symboles proportionnels parfois en dehors du territoire correspondant

Les symboles sont semble-t-il dessinés au milieu du rectangle englobant le territoire correspondant, ce qui fait qu'ils peuvent parfois se situer en dehors.
image

J'ai vu qu'on pouvait les déplacer à la main. Toutefois serait-il possible d'inclure un test pointInPolygon et une correction qui si besoin recentre le symbole dans le territoire associé ?
L'idéal serait de pouvoir prendre en compte une colonne de coordonnées x/y quand elle est fournie dans le fond de carte (par exemple l'IGN fournit la position de la mairie, ce qui est pratique).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.