diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ada2f4..12cca17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,6 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # No multiple versions for now (to save on build time) python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 003b22a..0622c73 100644 --- a/README.md +++ b/README.md @@ -101,20 +101,16 @@ A more detailed introduction and a plot gallery can be found [here](examples/REA Preview _route_ plot (screenshot of .html-file, cartodbdark_matter selected): -![sample-plot-html](https://nextmv-io.github.io/nextplot/plots/sneak/example-route-html.png) +![sample-popup](https://nextmv-io.github.io/nextplot/plots/sneak/example-popup.png) -Preview _route_ plot (full .png-file): +Another preview _route_ plot (screenshot of .html-file, cartodbdark_matter selected): -![sample-plot-png](https://nextmv-io.github.io/nextplot/plots/sneak/example-route-png.png) +![sample-plot-html](https://nextmv-io.github.io/nextplot/plots/sneak/example-route-html.png) Preview _cluster_ plot (screenshot of .html-file, cartodbdark_matter selected): ![sample-plot-html](https://nextmv-io.github.io/nextplot/plots/sneak/example-cluster-html.png) -Preview _cluster_ plot (full .png-file): - -![sample-plot-png](https://nextmv-io.github.io/nextplot/plots/sneak/example-cluster-png.png) - ## Auto-completion Auto-completion (using _tab_) is supported via `argcomplete`. To enable it, install the package: diff --git a/nextplot/__about__.py b/nextplot/__about__.py index 22a0910..ef20c19 100644 --- a/nextplot/__about__.py +++ b/nextplot/__about__.py @@ -1 +1 @@ -__version__ = "v0.1.0" +__version__ = "v0.1.1" diff --git a/nextplot/route.py b/nextplot/route.py index 3b5cd25..8873872 100644 --- a/nextplot/route.py +++ b/nextplot/route.py @@ -381,6 +381,7 @@ def create_map( + f"Distance: {point.distance:.2f} km " + f"({common.km_to_miles(point.distance):.2f} miles)
" + f"Location (lon/lat): {point[0]}, {point[1]}" + + "".join([" " for _ in range(0, 80)]) + "

" + f"JSON:
{d}

" ) @@ -401,6 +402,7 @@ def create_map( "

" + f"First stop in route {i+1}
" + f"Location (lon/lat): {start[0]}, {start[1]}" + + "".join([" " for _ in range(0, 80)]) + "

" + f"JSON:
{d}

" ) @@ -418,6 +420,7 @@ def create_map( "

" + f"Last stop in route {i+1}
" + f"Location (lon/lat): {end[0]}, {end[1]}" + + "".join([" " for _ in range(0, 80)]) + "

" + f"JSON:
{d}

" ) @@ -435,6 +438,7 @@ def create_map( "

" + f"Unassigned point: {p+1} / {len(group)}
" + f"Location (lon/lat): {point[0]}, {point[1]}" + + "".join([" " for _ in range(0, 80)]) + "

" + f"JSON:
{d}

" ) diff --git a/requirements-dev.txt b/requirements-dev.txt index bfbf228..d53b332 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,4 +9,4 @@ scipy>=1.8.0 pytest>=7.1.1 imagehash>=4.2.1 ruff>=0.1.7 -twine>=4.0.2 +hatch>=1.9.1 diff --git a/tests/testdata/paris-route-indexed.map.html.golden b/tests/testdata/paris-route-indexed.map.html.golden index fa867dc..1e6efcf 100644 --- a/tests/testdata/paris-route-indexed.map.html.golden +++ b/tests/testdata/paris-route-indexed.map.html.golden @@ -135,7 +135,7 @@ - var html_ = $(`

Stop: 1 / 7
Distance: 0.00 km (0.00 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; + var html_ = $(`

Stop: 1 / 7
Distance: 0.00 km (0.00 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656                                                                                

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; popup_.setContent(html_); @@ -156,7 +156,7 @@ - var html_ = $(`

Stop: 2 / 7
Distance: 2.59 km (1.61 miles)
Location (lon/lat): 2.3373478124467524, 48.86064983816991

JSON:
[
48.86064983816991,
2.3373478124467524
]

`)[0]; + var html_ = $(`

Stop: 2 / 7
Distance: 2.59 km (1.61 miles)
Location (lon/lat): 2.3373478124467524, 48.86064983816991                                                                                

JSON:
[
48.86064983816991,
2.3373478124467524
]

`)[0]; popup_.setContent(html_); @@ -177,7 +177,7 @@ - var html_ = $(`

Stop: 3 / 7
Distance: 3.89 km (2.42 miles)
Location (lon/lat): 2.3211691026573686, 48.86548659130954

JSON:
[
48.86548659130954,
2.3211691026573686
]

`)[0]; + var html_ = $(`

Stop: 3 / 7
Distance: 3.89 km (2.42 miles)
Location (lon/lat): 2.3211691026573686, 48.86548659130954                                                                                

JSON:
[
48.86548659130954,
2.3211691026573686
]

`)[0]; popup_.setContent(html_); @@ -198,7 +198,7 @@ - var html_ = $(`

Stop: 4 / 7
Distance: 6.01 km (3.74 miles)
Location (lon/lat): 2.2950561481174456, 48.873730646108235

JSON:
[
48.873730646108235,
2.2950561481174456
]

`)[0]; + var html_ = $(`

Stop: 4 / 7
Distance: 6.01 km (3.74 miles)
Location (lon/lat): 2.2950561481174456, 48.873730646108235                                                                                

JSON:
[
48.873730646108235,
2.2950561481174456
]

`)[0]; popup_.setContent(html_); @@ -219,7 +219,7 @@ - var html_ = $(`

Stop: 5 / 7
Distance: 7.75 km (4.81 miles)
Location (lon/lat): 2.2945793548805833, 48.85814487640506

JSON:
[
48.85814487640506,
2.2945793548805833
]

`)[0]; + var html_ = $(`

Stop: 5 / 7
Distance: 7.75 km (4.81 miles)
Location (lon/lat): 2.2945793548805833, 48.85814487640506                                                                                

JSON:
[
48.85814487640506,
2.2945793548805833
]

`)[0]; popup_.setContent(html_); @@ -240,7 +240,7 @@ - var html_ = $(`

Stop: 6 / 7
Distance: 10.42 km (6.48 miles)
Location (lon/lat): 2.321845363923588, 48.842085594729355

JSON:
[
48.842085594729355,
2.321845363923588
]

`)[0]; + var html_ = $(`

Stop: 6 / 7
Distance: 10.42 km (6.48 miles)
Location (lon/lat): 2.321845363923588, 48.842085594729355                                                                                

JSON:
[
48.842085594729355,
2.321845363923588
]

`)[0]; popup_.setContent(html_); @@ -261,7 +261,7 @@ - var html_ = $(`

Stop: 7 / 7
Distance: 15.37 km (9.55 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; + var html_ = $(`

Stop: 7 / 7
Distance: 15.37 km (9.55 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656                                                                                

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; popup_.setContent(html_); @@ -311,7 +311,7 @@ - var html_ = $(`

Stop: 1 / 5
Distance: 0.00 km (0.00 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; + var html_ = $(`

Stop: 1 / 5
Distance: 0.00 km (0.00 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656                                                                                

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; popup_.setContent(html_); @@ -332,7 +332,7 @@ - var html_ = $(`

Stop: 2 / 5
Distance: 3.90 km (2.43 miles)
Location (lon/lat): 2.346233405549605, 48.84616060048901

JSON:
[
48.84616060048901,
2.346233405549605
]

`)[0]; + var html_ = $(`

Stop: 2 / 5
Distance: 3.90 km (2.43 miles)
Location (lon/lat): 2.346233405549605, 48.84616060048901                                                                                

JSON:
[
48.84616060048901,
2.346233405549605
]

`)[0]; popup_.setContent(html_); @@ -353,7 +353,7 @@ - var html_ = $(`

Stop: 3 / 5
Distance: 4.71 km (2.93 miles)
Location (lon/lat): 2.349489020192572, 48.853070514317345

JSON:
[
48.853070514317345,
2.349489020192572
]

`)[0]; + var html_ = $(`

Stop: 3 / 5
Distance: 4.71 km (2.93 miles)
Location (lon/lat): 2.349489020192572, 48.853070514317345                                                                                

JSON:
[
48.853070514317345,
2.349489020192572
]

`)[0]; popup_.setContent(html_); @@ -374,7 +374,7 @@ - var html_ = $(`

Stop: 4 / 5
Distance: 8.44 km (5.24 miles)
Location (lon/lat): 2.343046834223321, 48.88634368898782

JSON:
[
48.88634368898782,
2.343046834223321
]

`)[0]; + var html_ = $(`

Stop: 4 / 5
Distance: 8.44 km (5.24 miles)
Location (lon/lat): 2.343046834223321, 48.88634368898782                                                                                

JSON:
[
48.88634368898782,
2.343046834223321
]

`)[0]; popup_.setContent(html_); @@ -395,7 +395,7 @@ - var html_ = $(`

Stop: 5 / 5
Distance: 9.53 km (5.92 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; + var html_ = $(`

Stop: 5 / 5
Distance: 9.53 km (5.92 miles)
Location (lon/lat): 2.3552878933106447, 48.880769277577656                                                                                

JSON:
[
48.880769277577656,
2.3552878933106447
]

`)[0]; popup_.setContent(html_); diff --git a/tests/testdata/paris-route.map.html.golden b/tests/testdata/paris-route.map.html.golden index bd646f9..1c8a1c1 100644 --- a/tests/testdata/paris-route.map.html.golden +++ b/tests/testdata/paris-route.map.html.golden @@ -135,7 +135,7 @@ - var html_ = $(`

Stop: 1 / 7
Distance: 2.59 km (1.61 miles)
Location (lon/lat): 2.3373478124467524, 48.86064983816991

JSON:
{
"id": "Louvre",
"location": [
48.86064983816991,
2.3373478124467524
],
"quantity": -1
}

`)[0]; + var html_ = $(`

Stop: 1 / 7
Distance: 2.59 km (1.61 miles)
Location (lon/lat): 2.3373478124467524, 48.86064983816991                                                                                

JSON:
{
"id": "Louvre",
"location": [
48.86064983816991,
2.3373478124467524
],
"quantity": -1
}

`)[0]; popup_.setContent(html_); @@ -156,7 +156,7 @@ - var html_ = $(`

Stop: 2 / 7
Distance: 3.89 km (2.42 miles)
Location (lon/lat): 2.3211691026573686, 48.86548659130954

JSON:
{
"id": "Place de la Concorde",
"location": [
48.86548659130954,
2.3211691026573686
],
"quantity": -1
}

`)[0]; + var html_ = $(`

Stop: 2 / 7
Distance: 3.89 km (2.42 miles)
Location (lon/lat): 2.3211691026573686, 48.86548659130954                                                                                

JSON:
{
"id": "Place de la Concorde",
"location": [
48.86548659130954,
2.3211691026573686
],
"quantity": -1
}

`)[0]; popup_.setContent(html_); @@ -177,7 +177,7 @@ - var html_ = $(`

Stop: 3 / 7
Distance: 6.01 km (3.74 miles)
Location (lon/lat): 2.2950561481174456, 48.873730646108235

JSON:
{
"id": "Arc de Triomphe",
"location": [
48.873730646108235,
2.2950561481174456
],
"quantity": 1
}

`)[0]; + var html_ = $(`

Stop: 3 / 7
Distance: 6.01 km (3.74 miles)
Location (lon/lat): 2.2950561481174456, 48.873730646108235                                                                                

JSON:
{
"id": "Arc de Triomphe",
"location": [
48.873730646108235,
2.2950561481174456
],
"quantity": 1
}

`)[0]; popup_.setContent(html_); @@ -198,7 +198,7 @@ - var html_ = $(`

Stop: 4 / 7
Distance: 7.75 km (4.81 miles)
Location (lon/lat): 2.2945793548805833, 48.85814487640506

JSON:
{
"id": "Tour Eiffel",
"location": [
48.85814487640506,
2.2945793548805833
],
"quantity": -1
}

`)[0]; + var html_ = $(`

Stop: 4 / 7
Distance: 7.75 km (4.81 miles)
Location (lon/lat): 2.2945793548805833, 48.85814487640506                                                                                

JSON:
{
"id": "Tour Eiffel",
"location": [
48.85814487640506,
2.2945793548805833
],
"quantity": -1
}

`)[0]; popup_.setContent(html_); @@ -219,7 +219,7 @@ - var html_ = $(`

Stop: 5 / 7
Distance: 10.42 km (6.48 miles)
Location (lon/lat): 2.321845363923588, 48.842085594729355

JSON:
{
"id": "Tour Montparnasse",
"location": [
48.842085594729355,
2.321845363923588
],
"quantity": -1
}

`)[0]; + var html_ = $(`

Stop: 5 / 7
Distance: 10.42 km (6.48 miles)
Location (lon/lat): 2.321845363923588, 48.842085594729355                                                                                

JSON:
{
"id": "Tour Montparnasse",
"location": [
48.842085594729355,
2.321845363923588
],
"quantity": -1
}

`)[0]; popup_.setContent(html_); @@ -269,7 +269,7 @@ - var html_ = $(`

Stop: 1 / 5
Distance: 3.90 km (2.43 miles)
Location (lon/lat): 2.346233405549605, 48.84616060048901

JSON:
{
"id": "Panth\u00e9on",
"location": [
48.84616060048901,
2.346233405549605
],
"quantity": 0
}

`)[0]; + var html_ = $(`

Stop: 1 / 5
Distance: 3.90 km (2.43 miles)
Location (lon/lat): 2.346233405549605, 48.84616060048901                                                                                

JSON:
{
"id": "Panth\u00e9on",
"location": [
48.84616060048901,
2.346233405549605
],
"quantity": 0
}

`)[0]; popup_.setContent(html_); @@ -290,7 +290,7 @@ - var html_ = $(`

Stop: 2 / 5
Distance: 4.71 km (2.93 miles)
Location (lon/lat): 2.349489020192572, 48.853070514317345

JSON:
{
"id": "Notre-Dame",
"location": [
48.853070514317345,
2.349489020192572
],
"quantity": 0
}

`)[0]; + var html_ = $(`

Stop: 2 / 5
Distance: 4.71 km (2.93 miles)
Location (lon/lat): 2.349489020192572, 48.853070514317345                                                                                

JSON:
{
"id": "Notre-Dame",
"location": [
48.853070514317345,
2.349489020192572
],
"quantity": 0
}

`)[0]; popup_.setContent(html_); @@ -311,7 +311,7 @@ - var html_ = $(`

Stop: 3 / 5
Distance: 8.44 km (5.24 miles)
Location (lon/lat): 2.343046834223321, 48.88634368898782

JSON:
{
"id": "Sacr\u00e9-C\u0153ur",
"location": [
48.88634368898782,
2.343046834223321
],
"quantity": 1
}

`)[0]; + var html_ = $(`

Stop: 3 / 5
Distance: 8.44 km (5.24 miles)
Location (lon/lat): 2.343046834223321, 48.88634368898782                                                                                

JSON:
{
"id": "Sacr\u00e9-C\u0153ur",
"location": [
48.88634368898782,
2.343046834223321
],
"quantity": 1
}

`)[0]; popup_.setContent(html_);