umap-project 2.1.1__py3-none-any.whl → 2.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of umap-project might be problematic. Click here for more details.

Files changed (44) hide show
  1. umap/__init__.py +1 -1
  2. umap/models.py +20 -11
  3. umap/static/umap/js/modules/request.js +1 -1
  4. umap/static/umap/js/umap.controls.js +29 -0
  5. umap/static/umap/js/umap.features.js +3 -1
  6. umap/static/umap/js/umap.importer.js +4 -5
  7. umap/static/umap/js/umap.js +27 -36
  8. umap/static/umap/js/umap.layer.js +7 -6
  9. umap/static/umap/test/Map.js +0 -304
  10. umap/static/umap/test/Polygon.js +0 -256
  11. umap/static/umap/test/Polyline.js +0 -116
  12. umap/static/umap/test/index.html +1 -4
  13. umap/tests/conftest.py +9 -0
  14. umap/tests/fixtures/test_upload_data.csv +2 -1
  15. umap/tests/fixtures/test_upload_data.umap +171 -0
  16. umap/tests/fixtures/test_upload_data_osm.json +33 -0
  17. umap/tests/integration/conftest.py +5 -0
  18. umap/tests/integration/test_anonymous_owned_map.py +3 -0
  19. umap/tests/integration/test_browser.py +4 -11
  20. umap/tests/integration/test_choropleth.py +89 -0
  21. umap/tests/integration/test_collaborative_editing.py +30 -1
  22. umap/tests/integration/test_datalayer.py +130 -0
  23. umap/tests/integration/test_edit_datalayer.py +134 -0
  24. umap/tests/integration/test_edit_map.py +15 -0
  25. umap/tests/integration/test_facets_browser.py +31 -0
  26. umap/tests/integration/test_import.py +347 -2
  27. umap/tests/integration/test_map.py +17 -37
  28. umap/tests/integration/test_owned_map.py +18 -0
  29. umap/tests/integration/test_picto.py +20 -33
  30. umap/tests/integration/test_polygon.py +363 -0
  31. umap/tests/integration/test_polyline.py +325 -0
  32. umap/tests/integration/test_tableeditor.py +27 -0
  33. umap/tests/test_datalayer.py +31 -17
  34. umap/views.py +2 -1
  35. {umap_project-2.1.1.dist-info → umap_project-2.1.3.dist-info}/METADATA +4 -4
  36. {umap_project-2.1.1.dist-info → umap_project-2.1.3.dist-info}/RECORD +39 -36
  37. umap/static/umap/test/Choropleth.js +0 -245
  38. umap/static/umap/test/DataLayer.js +0 -463
  39. umap/static/umap/test/Permissions.js +0 -74
  40. umap/static/umap/test/TableEditor.js +0 -104
  41. umap/tests/integration/test_drawing.py +0 -243
  42. {umap_project-2.1.1.dist-info → umap_project-2.1.3.dist-info}/WHEEL +0 -0
  43. {umap_project-2.1.1.dist-info → umap_project-2.1.3.dist-info}/entry_points.txt +0 -0
  44. {umap_project-2.1.1.dist-info → umap_project-2.1.3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,27 @@
1
+ import json
2
+ import re
3
+ from pathlib import Path
4
+
5
+ from playwright.sync_api import expect
6
+
7
+ from umap.models import DataLayer
8
+
9
+
10
+ def test_table_editor(live_server, openmap, datalayer, page):
11
+ page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
12
+ page.get_by_role("link", name="Manage layers").click()
13
+ page.locator("#umap-ui-container").get_by_title(
14
+ "Edit properties in a table"
15
+ ).click()
16
+ page.once("dialog", lambda dialog: dialog.accept(prompt_text="newprop"))
17
+ page.get_by_text("Add a new property").click()
18
+ page.locator('input[name="newprop"]').fill("newvalue")
19
+ page.once("dialog", lambda dialog: dialog.accept())
20
+ page.hover(".umap-table-editor .tcell")
21
+ page.get_by_title("Delete this property on all").first.click()
22
+ with page.expect_response(re.compile(r".*/datalayer/update/.*")):
23
+ page.get_by_role("button", name="Save").click()
24
+ saved = DataLayer.objects.last()
25
+ data = json.loads(Path(saved.geojson.path).read_text())
26
+ assert data["features"][0]["properties"]["newprop"] == "newvalue"
27
+ assert "name" not in data["features"][0]["properties"]
@@ -1,4 +1,5 @@
1
1
  import os
2
+ from pathlib import Path
2
3
 
3
4
  import pytest
4
5
  from django.core.files.base import ContentFile
@@ -60,30 +61,43 @@ def test_clone_should_clone_geojson_too(datalayer):
60
61
  assert clone.geojson.path != datalayer.geojson.path
61
62
 
62
63
 
63
- def test_should_remove_old_versions_on_save(datalayer, map, settings):
64
+ def test_should_remove_old_versions_on_save(map, settings):
65
+ datalayer = DataLayerFactory(uuid="0f1161c0-c07f-4ba4-86c5-8d8981d8a813", old_id=17)
64
66
  settings.UMAP_KEEP_VERSIONS = 3
65
- root = datalayer.storage_root()
67
+ root = Path(datalayer.storage_root())
66
68
  before = len(datalayer.geojson.storage.listdir(root)[1])
67
- newer = f"{root}/{datalayer.pk}_1440924889.geojson"
68
- medium = f"{root}/{datalayer.pk}_1440923687.geojson"
69
- older = f"{root}/{datalayer.pk}_1440918637.geojson"
70
- other = f"{root}/123456_1440918637.geojson"
71
- for path in [medium, newer, older, other]:
72
- datalayer.geojson.storage.save(path, ContentFile("{}"))
73
- datalayer.geojson.storage.save(path + ".gz", ContentFile("{}"))
74
- assert len(datalayer.geojson.storage.listdir(root)[1]) == 8 + before
69
+ newer = f"{datalayer.pk}_1440924889.geojson"
70
+ medium = f"{datalayer.pk}_1440923687.geojson"
71
+ older = f"{datalayer.pk}_1440918637.geojson"
72
+ with_old_id = f"{datalayer.old_id}_1440918537.geojson"
73
+ other = "123456_1440918637.geojson"
74
+ for path in [medium, newer, older, with_old_id, other]:
75
+ datalayer.geojson.storage.save(root / path, ContentFile("{}"))
76
+ datalayer.geojson.storage.save(root / f"{path}.gz", ContentFile("{}"))
77
+ assert len(datalayer.geojson.storage.listdir(root)[1]) == 10 + before
78
+ files = datalayer.geojson.storage.listdir(root)[1]
79
+ # Those files should be present before save, which will purge them
80
+ assert older in files
81
+ assert older + ".gz" in files
82
+ assert with_old_id in files
83
+ assert with_old_id + ".gz" in files
75
84
  datalayer.save()
76
85
  files = datalayer.geojson.storage.listdir(root)[1]
77
86
  # Flat + gz files, but not latest gz, which is created at first datalayer read.
87
+ # older and with_old_id should have been removed
78
88
  assert len(files) == 5
79
- assert os.path.basename(newer) in files
80
- assert os.path.basename(medium) in files
81
- assert os.path.basename(datalayer.geojson.path) in files
89
+ assert newer in files
90
+ assert medium in files
91
+ assert Path(datalayer.geojson.path).name in files
82
92
  # File from another datalayer, purge should have impacted it.
83
- assert os.path.basename(other) in files
84
- assert os.path.basename(other + ".gz") in files
85
- assert os.path.basename(older) not in files
86
- assert os.path.basename(older + ".gz") not in files
93
+ assert other in files
94
+ assert other + ".gz" in files
95
+ assert older not in files
96
+ assert older + ".gz" not in files
97
+ assert with_old_id not in files
98
+ assert with_old_id + ".gz" not in files
99
+ names = [v["name"] for v in datalayer.versions]
100
+ assert names == [Path(datalayer.geojson.name).name, newer, medium]
87
101
 
88
102
 
89
103
  def test_anonymous_cannot_edit_in_editors_mode(datalayer):
umap/views.py CHANGED
@@ -1073,7 +1073,8 @@ class DataLayerUpdate(FormLessEditMixin, GZipMixin, UpdateView):
1073
1073
  """
1074
1074
 
1075
1075
  # Use the provided info to find the correct version in our storage.
1076
- for name in self.object.get_versions():
1076
+ for version in self.object.versions:
1077
+ name = version["name"]
1077
1078
  path = Path(settings.MEDIA_ROOT) / self.object.get_version_path(name)
1078
1079
  if reference_version == self.read_version(path):
1079
1080
  with open(path) as f:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: umap-project
3
- Version: 2.1.1
3
+ Version: 2.1.3
4
4
  Summary: Create maps with OpenStreetMap layers in a minute and embed them in your site.
5
5
  Author-email: Yohan Boniface <yb@enix.org>
6
6
  Maintainer-email: David Larlet <david@larlet.fr>
@@ -31,10 +31,10 @@ Provides-Extra: dev
31
31
  Requires-Dist: djlint==1.34.1; extra == 'dev'
32
32
  Requires-Dist: hatch==1.9.4; extra == 'dev'
33
33
  Requires-Dist: isort==5.13.2; extra == 'dev'
34
- Requires-Dist: mkdocs-material==9.5.14; extra == 'dev'
34
+ Requires-Dist: mkdocs-material==9.5.15; extra == 'dev'
35
35
  Requires-Dist: mkdocs==1.5.3; extra == 'dev'
36
36
  Requires-Dist: pymdown-extensions==10.7.1; extra == 'dev'
37
- Requires-Dist: ruff==0.3.3; extra == 'dev'
37
+ Requires-Dist: ruff==0.3.4; extra == 'dev'
38
38
  Requires-Dist: vermin==1.6.0; extra == 'dev'
39
39
  Provides-Extra: docker
40
40
  Requires-Dist: uwsgi==2.0.24; extra == 'docker'
@@ -44,7 +44,7 @@ Requires-Dist: playwright>=1.39; extra == 'test'
44
44
  Requires-Dist: pytest-django==4.8.0; extra == 'test'
45
45
  Requires-Dist: pytest-playwright==0.4.4; extra == 'test'
46
46
  Requires-Dist: pytest-xdist<4,>=3.5.0; extra == 'test'
47
- Requires-Dist: pytest==8.0.2; extra == 'test'
47
+ Requires-Dist: pytest==8.1.1; extra == 'test'
48
48
  Description-Content-Type: text/markdown
49
49
 
50
50
  # uMap project
@@ -1,4 +1,4 @@
1
- umap/__init__.py,sha256=phT4pPgO2cSrjTzTxIPA2PX-q_QkUfGy8kd_ZEIi4AA,18
1
+ umap/__init__.py,sha256=quW0BmC9Yqv06BNR-W3csWrRaFrAXIft7Gu-vCG69z0,18
2
2
  umap/admin.py,sha256=gL6zrexmDbIKIqOKHCuAM5wtqr8FIQkRtjbcXcNyBrs,749
3
3
  umap/apps.py,sha256=5ssKqPUuNJlapaBmr4LY_HDb7J1NFCT3wzythxQOOfs,109
4
4
  umap/autocomplete.py,sha256=WUsbsVBl_KzzEzxB4g3rAoS5-eEvCZGtelVzXeOFV90,444
@@ -8,11 +8,11 @@ umap/fields.py,sha256=c32tKWKF8aThrCXDJblwo0n9n2ET6hxBYzEupfr0B4o,900
8
8
  umap/forms.py,sha256=bpNLMSsB1sHUcaf24MmUpwVdEz_SHy_ohfhQMoKwDzI,3128
9
9
  umap/managers.py,sha256=-lBK0xYFRDfX76qDRdLnZOA8jEPYseEwIj8QOiHVM4w,243
10
10
  umap/middleware.py,sha256=p8EPW_gYW8Wh2lk0DNIAkZQbYlBZugW7Yq4iiA7L4aE,514
11
- umap/models.py,sha256=Ol1AqtsSwNXCU67yJxCyWxF8EVpHIWLjZy4rcHPHZn0,17180
11
+ umap/models.py,sha256=HZjDiK46y6D6ZRzKlqqJMBmv20a6M_pn_W6ubYDTrG0,17583
12
12
  umap/storage.py,sha256=bdjjdn768fZJYsyDNBxgwLvSu6rhde_Cc6yzyZZDmSg,2282
13
13
  umap/urls.py,sha256=frMCdfDQ2QB39xxqI8I12EeT-yChn5KDwDp-kQxp930,6876
14
14
  umap/utils.py,sha256=19i8ibi-1IXxafT4k_yOHMhD-DsPH74Ll9qw-UrUkM4,5856
15
- umap/views.py,sha256=Rveo68dTNeu08PZ5KQO-OTKzuH5HulxrqU-AphHL6lw,41043
15
+ umap/views.py,sha256=N2J9BOP5Yq6ClTy2K_11l34pRIgCL4jwvU_n2K_wM8c,41075
16
16
  umap/wsgi.py,sha256=IopIgnDZbCus3XpSetTHnra9VyzWi0Y2tJo-CmfTWCY,1132
17
17
  umap/bin/__init__.py,sha256=iA3ON4A6NCpenrn3q2OgefUKF5QRFIQS-FtS0pxruI8,234
18
18
  umap/locale/am_ET/LC_MESSAGES/django.mo,sha256=xdPMnJ3Z0fkxocaO7IKexPyomuWUKak01D2T6pVruco,5457
@@ -186,15 +186,15 @@ umap/static/umap/img/source/16.svg,sha256=OHwbeoiEMXfGLSzCauzOdBEkNzCr_sC4sNB1sT
186
186
  umap/static/umap/img/source/24-white.svg,sha256=31n0rwyxcoJ69Mm2hvSAifQV0x00px0z-Jkf__UetnA,29369
187
187
  umap/static/umap/img/source/24.svg,sha256=rocP2xyMQdigy8noiipCM8hJNOc9tvF4uoXUPFBAjxY,38901
188
188
  umap/static/umap/js/umap.autocomplete.js,sha256=h3Ap9towVTChGSSZaMCrhWjQUPCrGcvW6fD46dD3pTs,7740
189
- umap/static/umap/js/umap.controls.js,sha256=LnfUQ4bGc5NojBx9o-BzAjPCvCE_8NuJ_RZYs7hQjxA,43967
189
+ umap/static/umap/js/umap.controls.js,sha256=1LWARSx_CzxOAfMoyg8FfwW5vOV8xKKPoWoWgATnChU,44898
190
190
  umap/static/umap/js/umap.core.js,sha256=aiTfkNI8Z13OiblpYEis6YrRNOObhVn70uikgBkkCIc,26116
191
191
  umap/static/umap/js/umap.datalayer.permissions.js,sha256=kpGb7sZKdcSj0QhmGZ56LFtubysc68S48e3YzeXQNNs,1947
192
- umap/static/umap/js/umap.features.js,sha256=S6WYoRy63H5cvDpxOESWu6xkGksWpSYGbYyOXkWNuUQ,34677
192
+ umap/static/umap/js/umap.features.js,sha256=iMsmunpxNWFITEzVFBm3lqI5r1fuFHMod-6JWf-gMxs,34680
193
193
  umap/static/umap/js/umap.forms.js,sha256=KOtUkqVA7rmwi7O5PPqj_t3QusCqkRRbEbc2lcIENY0,26940
194
194
  umap/static/umap/js/umap.icon.js,sha256=woRRVru2jSOl0Ah5DAl2vZCTg3rsPeNSoTt57IIcUOg,7546
195
- umap/static/umap/js/umap.importer.js,sha256=B4kzV0VWrQK7ovIb2LDDdyaDK6tY7Q6TQejXtR8IakM,5305
196
- umap/static/umap/js/umap.js,sha256=TjWMc3Ardf7wjr895lKM7ZmvoVG8F78_FhtF8VC2rt0,55950
197
- umap/static/umap/js/umap.layer.js,sha256=nvAihcDr6XFIZ-eSWgKkqXM5GJWmOeuKZBJnL28lkS4,47423
195
+ umap/static/umap/js/umap.importer.js,sha256=1tNOyFguvH4Q9f2WBvmndVYJa-9wocKqrCaDxmpT4a0,5375
196
+ umap/static/umap/js/umap.js,sha256=XbabOc0tBc2sNujYg7IntXwFENuiH-VBZCALs_n15D4,55572
197
+ umap/static/umap/js/umap.layer.js,sha256=ZRdb90lR8fvp4Kq07qWGla6eZAA8SeTfiCKOt_CvSIg,47538
198
198
  umap/static/umap/js/umap.permissions.js,sha256=d7M3aoQ4QliSD7lFnCWgoUN4pHax1-6JnerH8BjvubY,6097
199
199
  umap/static/umap/js/umap.popup.js,sha256=jZzwRbH3iIJlq35XiZa5Ugnw3KkplWckEgJmW7CAOWY,10108
200
200
  umap/static/umap/js/umap.share.js,sha256=36IjZW9Gd_b-1OMD95-hJaKc2etPazILCDNS4iZJqCA,7774
@@ -206,7 +206,7 @@ umap/static/umap/js/modules/browser.js,sha256=-RPyTmnd8_d9FhkmL4wP3DlQHkaoA9QIAd
206
206
  umap/static/umap/js/modules/global.js,sha256=tp8tCmAqKlSVNPi7w3n9wiMTb5Wh-DVh_XedZz_Lo60,454
207
207
  umap/static/umap/js/modules/i18n.js,sha256=5EmqVuxda24BvXPZb8uOXNc21vHs7Rx8RF9fVZsnTR8,1207
208
208
  umap/static/umap/js/modules/leaflet-configure.js,sha256=P3aD8iNGxuVNv-xW4Di4txAjNmnlpKtCCzDvPaKEdQ8,243
209
- umap/static/umap/js/modules/request.js,sha256=7qMUuC5Q2Ql0U8bbojUMSdGMsWrvyqM364j3uF0sLZs,4001
209
+ umap/static/umap/js/modules/request.js,sha256=v10pLYqFcKeQeMTcjC1Vm9wlp5ehRFKQ65HfT7VrYLY,4007
210
210
  umap/static/umap/js/modules/schema.js,sha256=vP60-MU4rRowRrRQzWRQbT9vu4Klrp5sRTAy_ZgYyxQ,8926
211
211
  umap/static/umap/js/modules/urls.js,sha256=isqV_dslYuNQIErzf5Wgq-oZqORRK4as6e78sfQgaUo,1308
212
212
  umap/static/umap/js/modules/utils.js,sha256=sjCXiF3fb86evhDDJBDSRHjXTYTcKtjeC7SoNpFl680,558
@@ -310,18 +310,14 @@ umap/static/umap/locale/zh_TW.Big5.json,sha256=d4VV9je7iQ8Qz4-gD71uGFHMte4Y26uc8
310
310
  umap/static/umap/locale/zh_TW.js,sha256=ulTuzsMAtFe44WMJEzyhnza0Q0qU00_gEl4xSYEhk-A,25141
311
311
  umap/static/umap/locale/zh_TW.json,sha256=yBJE01xj58EXPwVZXndmH4lJOae6sbiJZoh5-LdUqOc,24580
312
312
  umap/static/umap/test/.eslintrc,sha256=lsy_EQL70iOehznbw1QtRqN858VT9vQAZXg9h2aTX2w,444
313
- umap/static/umap/test/Choropleth.js,sha256=3iTkpcmaXhfSQzf3A4wZTKITOVBBkpXEHve0aGObV8U,5266
314
- umap/static/umap/test/DataLayer.js,sha256=8dOWcOAg1N-Q7ppN9PatFxk43NbdSB1vXAF8CBgSSdM,14224
315
313
  umap/static/umap/test/Feature.js,sha256=NIW3FD156wwo6UZHbKf56lQfQ3dG9fHBWGPc1DN_XAE,11766
316
- umap/static/umap/test/Map.js,sha256=7VrgxQ_0uS7kLQe5TsCn7qSDwwDKJ_zYsE7Y_7xwOKc,17448
314
+ umap/static/umap/test/Map.js,sha256=LWCyIKxgUXBM61i3QIPkDubTXGlRhy6N2NdlAnaM_mQ,919
317
315
  umap/static/umap/test/Marker.js,sha256=pzMBY-l1xD35OgVCd2FNxEDrBMAhafAyZPAFsV2Gd34,4111
318
- umap/static/umap/test/Permissions.js,sha256=D2zw97L1bqIwZSG30r0NnbS1YLxGiCNQIKWmRuYuSGM,2239
319
- umap/static/umap/test/Polygon.js,sha256=3g0pdU05ITImNb7PrS6v1ZorwG-pT7AQEbE_82inaEI,12094
320
- umap/static/umap/test/Polyline.js,sha256=P3NNlyHYv2wvhreSfI7TWawetPMgiBqA3l1iRQf-FJM,13964
321
- umap/static/umap/test/TableEditor.js,sha256=NXjGGNzVa5A6SQHuY_uhvu1_EqAFEftFp4cODBSJhMo,3192
316
+ umap/static/umap/test/Polygon.js,sha256=Jrflfe76wmfu8_E3bDLMGG11w-iUmrgL9Oiv4CcCsb8,2320
317
+ umap/static/umap/test/Polyline.js,sha256=5VxRW-b6bnNgyIzDsHM6g5lPci-Td1wY5VPg_umpId0,9374
322
318
  umap/static/umap/test/Util.js,sha256=yhcmnlugm-D7ECvyw_RVdsn7sFdnR1XHnMgNiNCZ-XI,17972
323
319
  umap/static/umap/test/_pre.js,sha256=O3qaQf-M2SLQ6c7AGIrRwdPm3iULiSTt-KkmAIQnAGg,12960
324
- umap/static/umap/test/index.html,sha256=24lW8t4Trr1T33bKKmSVivckJ2NxKni4qphlT5BMWCQ,6803
320
+ umap/static/umap/test/index.html,sha256=kWkQbao_Hb1XW23PDzlKn-oTMV6lGgTIsaW5X3COaQE,6685
325
321
  umap/static/umap/unittests/URLs.js,sha256=IOifAKSNuCTtmEGdfV6lHBkg6CT0LftgxWlXWLa5_1U,1886
326
322
  umap/static/umap/vendors/colorbrewer/colorbrewer.js,sha256=FebyRte_vQrD_CLC8Xjc2cI_bR694S6hDSIu26tDnZ8,24622
327
323
  umap/static/umap/vendors/contextmenu/leaflet.contextmenu.min.css,sha256=_pRTmdgpDxfu1Oxb7DnP_DTdA44G-k3kf0otWP8gEnc,990
@@ -427,9 +423,9 @@ umap/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
427
423
  umap/templatetags/umap_tags.py,sha256=2eOMT_6lGHRNSarfUpVTXggg6E0SN_rjrJKDCt__gF8,1671
428
424
  umap/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
429
425
  umap/tests/base.py,sha256=WcrRnmgcTvx9hHekIJsGyVhFwvyNrgT7PYQ6DPwuAZU,4200
430
- umap/tests/conftest.py,sha256=hlUPzNq7JakJnT2k5LOp7a8CKhHBWhz3v9EwioPOVUg,1367
426
+ umap/tests/conftest.py,sha256=yLFE5sqz61tw_EoZp1nrH-8S49_aStA5Lt1JtZXd-Hg,1498
431
427
  umap/tests/settings.py,sha256=qzKYcWzVXUVYxNdv8m7lLV-xkNrV8A8-LWliTJagHOE,716
432
- umap/tests/test_datalayer.py,sha256=1C2z0VACCime11CMbp9ehbj-knLpW8r6j72EQ_hKLU4,6322
428
+ umap/tests/test_datalayer.py,sha256=HJYSQ11LVQe47nnsXdFeX5Ny4WMDPUYg3frnM5G1IzQ,6888
433
429
  umap/tests/test_datalayer_views.py,sha256=AJ-0YBorAgKZaKGd8rSYDguqy8acrz54EaQdfkNOH48,22111
434
430
  umap/tests/test_licence.py,sha256=BxNY3gdKhIoc2u5OPmAkmjCp0jJN-Jm-uPOfAZlpOHA,339
435
431
  umap/tests/test_map.py,sha256=nX2eE1HJY3bjycXulglK2SY1ybcnjDVgr0yntX6OgyA,3836
@@ -442,38 +438,45 @@ umap/tests/fixtures/choropleth_region_chomage.geojson,sha256=mVVbYlf92Sr3wWH9ETm
442
438
  umap/tests/fixtures/circle.svg,sha256=P37vV2PhFPecAtY8qR3VlRuB79_wFaMeqKm2tX-2tkA,254
443
439
  umap/tests/fixtures/display_on_load.umap,sha256=eo4ecB3QUeCVu1u7COp7mZ8sCPkf2j4gGERE7N1v8GU,1845
444
440
  umap/tests/fixtures/star.svg,sha256=zIi-j16L1Fzxtqz2rV2NDDm1NDHBWQfM5O6MIeoxgEU,256
445
- umap/tests/fixtures/test_upload_data.csv,sha256=b4RQw68ixs9UMj8TlTucV5YSfbactWhLLuE1yCKUTAY,109
441
+ umap/tests/fixtures/test_upload_data.csv,sha256=KZOO-DcXhdTgx2FrIYZz_ZNZAKOp8zpN_jCyfDw3PcQ,186
446
442
  umap/tests/fixtures/test_upload_data.gpx,sha256=sIfeKEGxYikzg121qBdkBIVTFpuYh8q2-yWZOZwbu38,674
447
443
  umap/tests/fixtures/test_upload_data.json,sha256=t4PmJtVDhyI1x-E1a36jD8YVSa87T-Vtg8eBmHfQ4KQ,5650
448
444
  umap/tests/fixtures/test_upload_data.kml,sha256=t66ms8oNI3999bhRJx01mn-UuHeqWoVY5LfXnChBaP8,1102
445
+ umap/tests/fixtures/test_upload_data.umap,sha256=WUmcwcQ4o5_rYw0SOqjnszbk2TOzfynrK3psyApSWsk,5463
446
+ umap/tests/fixtures/test_upload_data_osm.json,sha256=ekOwBHdp7qHQ-JUGlb-kGUXcVepdMsBqr7k51pVaCbA,916
449
447
  umap/tests/fixtures/test_upload_empty_coordinates.json,sha256=-mJ_1orzUAROfE4PXchHXyqxjS-q4tDfvEFPllJiHFU,786
450
448
  umap/tests/fixtures/test_upload_missing_name.json,sha256=klSMHb6laTghzU4AdIG1_p5UZ1LbAJCCKnJea0qEFAI,4566
451
449
  umap/tests/fixtures/test_upload_non_linear_ring.json,sha256=WOR0NnJHNUUW6VKzZyIxU7WL1llnAmEVJwCWla6XOds,1525
452
450
  umap/tests/integration/__init__.py,sha256=nqQ2miDnSZOKDuFhQ5saFN3qQuK73Cs6xL9Od-mEKG4,57
453
- umap/tests/integration/conftest.py,sha256=XuOKbABI1ugTJyPlJzjSK-6L-_vSs3NaQJdYJbyU-6k,607
454
- umap/tests/integration/test_anonymous_owned_map.py,sha256=dfx4SQ-K7Un98H1fyeSvv4T573VKgh5gP2Oyvk1ZIIQ,8415
451
+ umap/tests/integration/conftest.py,sha256=yV16s_9uzsMt-myJ4nhzbCzCcefElApCq68daQTjxmw,703
452
+ umap/tests/integration/test_anonymous_owned_map.py,sha256=OMieSBsR5yvB_Wk-cxB6G5NxJy72mHOHmDjmXJtp8E0,8628
455
453
  umap/tests/integration/test_basics.py,sha256=1FesSkjNBWi5pEqN0MQlC3kIXTFZzuILq7A5ac9L-3g,1598
456
- umap/tests/integration/test_browser.py,sha256=p1MvBuojYRh2k2sqVPGEiVKHxo5CbG1PE-ZcALc4Et4,14076
457
- umap/tests/integration/test_collaborative_editing.py,sha256=KsGmfVt4bkTc5uCOibnXIWlxIudn7wUYE_hy9v8Kiik,9493
454
+ umap/tests/integration/test_browser.py,sha256=YF2U5f0g4RQPCaBFBTrBaLy0dDusy3gQG3dRDORQvaQ,13929
455
+ umap/tests/integration/test_choropleth.py,sha256=6zeqgY6JTtFF7K5vIVXuE37zuN6JJPn_1ccAZLGZZew,3803
456
+ umap/tests/integration/test_collaborative_editing.py,sha256=auvyoGbUJ-xe3HpITrQoCby_X_OZC5tQKUsXASJwtqc,10959
458
457
  umap/tests/integration/test_dashboard.py,sha256=k--MGBZsek4ebjCoHbUyv-XNkPbc55aOwxH6a7WuIL0,1173
459
- umap/tests/integration/test_drawing.py,sha256=tgtUcvHEwbSbC1Up9OtkVguJYmQKZMxXH3CgZmz8jBQ,8825
460
- umap/tests/integration/test_edit_datalayer.py,sha256=TouE4gFzUuA3tMLSi5tUpvtz0kpGyHXf_feD4UdKQI4,1621
458
+ umap/tests/integration/test_datalayer.py,sha256=ttoR41XDlEfS1z4fZtpHAi0SHnnFD6N_8g-9BRHm8fk,5136
459
+ umap/tests/integration/test_edit_datalayer.py,sha256=LHGaHoAbztnilLytV8c2cTqxk2om9fKT4WfdxZ-2uNU,7872
460
+ umap/tests/integration/test_edit_map.py,sha256=fOc95CtjYNDZuu6hiId9MAP3GizYS75AE96y1fmASRc,500
461
461
  umap/tests/integration/test_export_map.py,sha256=Y_sgsT7ZTrrDCx5dLegioJ40GN_PtzK7yRFHTxtIb-4,12738
462
- umap/tests/integration/test_facets_browser.py,sha256=wRh5h2kQg-ORfHqZKoumeNJ-JSC8CtgNZG7EvJW5SLc,2670
462
+ umap/tests/integration/test_facets_browser.py,sha256=w-7wCLzkcDgzxKfDBekVMl33ajvi3WzjGbede01bydE,3579
463
463
  umap/tests/integration/test_features_id_generation.py,sha256=e99_8AxeMAi53JjVGlsI32zlrXGAU19FHJfTuYdiBVQ,1511
464
- umap/tests/integration/test_import.py,sha256=ufbJl0M5rqGVGmHBZjMhioI9uVETSajevtpnQNJCFOI,2005
465
- umap/tests/integration/test_map.py,sha256=IY7J47cDhPSylaEh35k9LPx_K8U2Tll_J1JXtyBQPJs,8764
464
+ umap/tests/integration/test_import.py,sha256=2XDbzCxrBMqvwkGEMB44E7QbiU2SHEFwZk_Il5BHzpE,15481
465
+ umap/tests/integration/test_map.py,sha256=Ekj1I7d1y14pkoCrtq8OEhoxXsBNjmyNIAs4E4q07m8,8088
466
466
  umap/tests/integration/test_map_preview.py,sha256=4rPQF1zfiwqN7PvwFeB3OagR1wLEMbug0Omcd6zQShQ,2702
467
- umap/tests/integration/test_owned_map.py,sha256=3Ls3vnHgYtHVsUkeWuS71GtuQCD7nA_12hncWSn5n4A,9029
468
- umap/tests/integration/test_picto.py,sha256=PKZ7R0XQnNzJodNtmx2R7iDqq0xD2ArHRV8eD6o96k0,9348
467
+ umap/tests/integration/test_owned_map.py,sha256=E5J7wNPkYuWJMkbbTpVCheyRgJ9NVtBzE5SZNDZZiyw,9905
468
+ umap/tests/integration/test_picto.py,sha256=ShQnpiA1yHTYd_BV9kmG3VZ2p2v2COi4Vf3xNwKC_8M,9034
469
+ umap/tests/integration/test_polygon.py,sha256=sL4sOpNAs1h09W455NY8UunVHQHDogS_eGWWfHqOT9s,14335
470
+ umap/tests/integration/test_polyline.py,sha256=FNMXL4a67Qo-Yhr1V0XCGl6kWsiAJLsoFlJJAg7mOxE,12426
469
471
  umap/tests/integration/test_querystring.py,sha256=zTEs6S01G7t4MYrxmMyZqS7G8LmDoUAjmkhYeSV32h8,2649
470
472
  umap/tests/integration/test_share.py,sha256=gDna-wFedwJ_-8HLBw_G5IO3zA3l96p1FGBSZ15g_7g,1813
471
473
  umap/tests/integration/test_slideshow.py,sha256=uLPw4SyhLgpqU4-jrTu5vKSqYuZG7hXjfY8JlEt1JkM,2020
472
474
  umap/tests/integration/test_star.py,sha256=icB5SbFbXe4KYp3DIJ0xAwCrSQS2rweqIaQTAng3CfY,842
473
475
  umap/tests/integration/test_statics.py,sha256=UqaN2O56yHwn1tEE9I8B1lGnyztDLC0p7_rG6J7vLIs,1494
476
+ umap/tests/integration/test_tableeditor.py,sha256=QIxuMmb1YtibJEgaY92s5Q4Yf7q1Jo974IWsHBord5U,1124
474
477
  umap/tests/integration/test_tilelayer.py,sha256=3Jn1KdOM39DuDkLG-P3heDrsCiYvD6_FEnt0EKGjj5g,4141
475
- umap_project-2.1.1.dist-info/METADATA,sha256=Fsye7JF3PY2Rtm7IiUW3B6RhkoOMIClhr-N0eJs5jJw,2559
476
- umap_project-2.1.1.dist-info/WHEEL,sha256=mRYSEL3Ih6g5a_CVMIcwiF__0Ae4_gLYh01YFNwiq1k,87
477
- umap_project-2.1.1.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
478
- umap_project-2.1.1.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
479
- umap_project-2.1.1.dist-info/RECORD,,
478
+ umap_project-2.1.3.dist-info/METADATA,sha256=ia2_saR7oUpY52jT0joF8VL8Q7vFazXJnCmCgp2XM_E,2559
479
+ umap_project-2.1.3.dist-info/WHEEL,sha256=mRYSEL3Ih6g5a_CVMIcwiF__0Ae4_gLYh01YFNwiq1k,87
480
+ umap_project-2.1.3.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
481
+ umap_project-2.1.3.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
482
+ umap_project-2.1.3.dist-info/RECORD,,
@@ -1,245 +0,0 @@
1
- const POLYGONS = {
2
- _umap_options: defaultDatalayerData(),
3
- type: 'FeatureCollection',
4
- features: [
5
- {
6
- type: 'Feature',
7
- properties: {
8
- name: 'number 1',
9
- value: 45,
10
- },
11
- geometry: {
12
- type: 'Polygon',
13
- coordinates: [
14
- [
15
- [0, 49],
16
- [-2, 47],
17
- [1, 46],
18
- [3, 47],
19
- [0, 49],
20
- ],
21
- ],
22
- },
23
- },
24
- {
25
- type: 'Feature',
26
- properties: {
27
- name: 'number 2',
28
- value: 87,
29
- },
30
- geometry: {
31
- type: 'Polygon',
32
- coordinates: [
33
- [
34
- [0, 49],
35
- [2, 50],
36
- [6, 49],
37
- [4, 47],
38
- [0, 49],
39
- ],
40
- ],
41
- },
42
- },
43
- {
44
- type: 'Feature',
45
- properties: {
46
- name: 'number 3',
47
- value: 673,
48
- },
49
- geometry: {
50
- type: 'Polygon',
51
- coordinates: [
52
- [
53
- [4, 47],
54
- [6, 49],
55
- [11, 47],
56
- [9, 45],
57
- [4, 47],
58
- ],
59
- ],
60
- },
61
- },
62
- {
63
- type: 'Feature',
64
- properties: {
65
- name: 'number 4',
66
- value: 674,
67
- },
68
- geometry: {
69
- type: 'Polygon',
70
- coordinates: [
71
- [
72
- [2, 46],
73
- [4, 47],
74
- [8, 45],
75
- [6, 43],
76
- [2, 46],
77
- ],
78
- ],
79
- },
80
- },
81
- {
82
- type: 'Feature',
83
- properties: {
84
- name: 'number 5',
85
- value: 839,
86
- },
87
- geometry: {
88
- type: 'Polygon',
89
- coordinates: [
90
- [
91
- [-2, 47],
92
- [1, 46],
93
- [0, 44],
94
- [-4, 45],
95
- [-2, 47],
96
- ],
97
- ],
98
- },
99
- },
100
- {
101
- type: 'Feature',
102
- properties: {
103
- name: 'number 6',
104
- value: 3829,
105
- },
106
- geometry: {
107
- type: 'Polygon',
108
- coordinates: [
109
- [
110
- [1, 45],
111
- [5, 43],
112
- [4, 42],
113
- [0, 44],
114
- [1, 45],
115
- ],
116
- ],
117
- },
118
- },
119
- {
120
- type: 'Feature',
121
- properties: {
122
- name: 'number 7',
123
- value: 4900,
124
- },
125
- geometry: {
126
- type: 'Polygon',
127
- coordinates: [
128
- [
129
- [9, 45],
130
- [12, 47],
131
- [15, 45],
132
- [13, 43],
133
- [9, 45],
134
- ],
135
- ],
136
- },
137
- },
138
- {
139
- type: 'Feature',
140
- properties: {
141
- name: 'number 8',
142
- value: 4988,
143
- },
144
- geometry: {
145
- type: 'Polygon',
146
- coordinates: [
147
- [
148
- [7, 43],
149
- [9, 45],
150
- [12, 43],
151
- [10, 42],
152
- [7, 43],
153
- ],
154
- ],
155
- },
156
- },
157
- {
158
- type: 'Feature',
159
- properties: {
160
- name: 'number 9',
161
- value: 9898,
162
- },
163
- geometry: {
164
- type: 'Polygon',
165
- coordinates: [
166
- [
167
- [4, 42],
168
- [6, 43],
169
- [9, 41],
170
- [7, 40],
171
- [4, 42],
172
- ],
173
- ],
174
- },
175
- },
176
- ],
177
- }
178
-
179
- describe('U.Choropleth', () => {
180
- let path = '/map/99/datalayer/edit/62/',
181
- poly1,
182
- poly4,
183
- poly9,
184
- map,
185
- datalayer
186
-
187
- before(async () => {
188
- fetchMock.mock(/\/datalayer\/62\/\?.*/, JSON.stringify(POLYGONS))
189
- map = initMap({ umap_id: 99 })
190
- const datalayer_options = defaultDatalayerData()
191
- await map.initDataLayers([datalayer_options])
192
- datalayer = map.getDataLayerByUmapId(62)
193
- datalayer.options.type = 'Choropleth'
194
- datalayer.options.choropleth = {
195
- property: 'value',
196
- }
197
- enableEdit()
198
- datalayer.eachLayer(function (layer) {
199
- if (layer.properties.name === 'number 1') {
200
- poly1 = layer
201
- } else if (layer.properties.name === 'number 4') {
202
- poly4 = layer
203
- } else if (layer.properties.name === 'number 9') {
204
- poly9 = layer
205
- }
206
- })
207
- })
208
- after(() => {
209
- fetchMock.restore()
210
- resetMap()
211
- })
212
-
213
- describe('#init()', () => {
214
- it('datalayer should have 9 features', () => {
215
- assert.equal(datalayer._index.length, 9)
216
- })
217
- })
218
- describe('#compute()', () => {
219
- it('choropleth should compute default colors', () => {
220
- datalayer.resetLayer(true)
221
- assert.deepEqual(
222
- datalayer.layer.options.breaks,
223
- [45, 673, 3829, 4900, 9898, 9898]
224
- )
225
- assert.equal(poly1._path.attributes.fill.value, '#eff3ff')
226
- assert.equal(poly4._path.attributes.fill.value, '#bdd7e7')
227
- assert.equal(poly9._path.attributes.fill.value, '#3182bd')
228
- })
229
- it('can change brewer scheme', () => {
230
- datalayer.options.choropleth.brewer = 'Reds'
231
- datalayer.resetLayer(true)
232
- assert.equal(poly1._path.attributes.fill.value, '#fee5d9')
233
- assert.equal(poly4._path.attributes.fill.value, '#fcae91')
234
- assert.equal(poly9._path.attributes.fill.value, '#de2d26')
235
- })
236
- it('choropleth should allow to change steps', () => {
237
- datalayer.options.choropleth.brewer = 'Blues'
238
- datalayer.options.choropleth.classes = 6
239
- datalayer.resetLayer(true)
240
- assert.equal(poly1._path.attributes.fill.value, '#eff3ff')
241
- assert.equal(poly4._path.attributes.fill.value, '#c6dbef')
242
- assert.equal(poly9._path.attributes.fill.value, '#3182bd')
243
- })
244
- })
245
- })