From b88c3fae3ee7ab191c88c06cbd978048474c948b Mon Sep 17 00:00:00 2001 From: Justin Kunimune Date: Thu, 14 Dec 2023 21:03:25 -0800 Subject: [PATCH] simplify SVGs I tried to make my SVGs more robust in terms of only using features supported on a wide variety of platforms. in particular, it turns out nested CSS blocks may not be a core CSS thing... they're a Sass thing? but chrome and firefox both seem to interpret it correctly automaticly. in any case, I got rid of that and told the user to do their circle showing manually. I also deleted all these namespaces and metadata tags because it seems like intellij is having trubble resolving their sources and idk what's the point of including them in the first place. all of this information is either already included or is better given in supplementary files. I also added more background rectangles. --- input/Advanced/Template countries.svg | 58 +++++++------------------ input/Advanced/Template provinces.svg | 47 ++++---------------- input/Advanced/Test.svg | 38 +++------------- input/Advanced/Tissot Wikipedia +0.svg | 38 +++------------- input/Advanced/Tissot Wikipedia -20.svg | 38 +++------------- input/Basic.svg | 39 +++-------------- input/Compound.svg | 38 +++------------- input/Graticule.svg | 38 +++------------- input/Orthodromes.svg | 38 +++------------- input/Political.svg | 43 ++++-------------- input/Simplified.svg | 39 +++-------------- src/zupplemental/compose_maps.py | 6 ++- 12 files changed, 79 insertions(+), 381 deletions(-) diff --git a/input/Advanced/Template countries.svg b/input/Advanced/Template countries.svg index ad8cf61..e352395 100644 --- a/input/Advanced/Template countries.svg +++ b/input/Advanced/Template countries.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Blank world map (de facto country borders) A map of the world, showing all countries' de facto borders, with major lakes overlaid. Borders precise to 110km. Equirectangular projection. @@ -41,17 +13,16 @@ stroke:#ffffff; stroke-width:.1; fill:#c0c0c0; /* gray */ - circle { - display:none; - } } - /* color in countries here by inserting their ISO 3166 A3 codes. */ - /* for example: - .BRA, .FRA, .USV { - fill:#00ff00; - circle { - display:block; - } + .country circle { + display:none; + } + /* color in countries and show their circles here by inserting their ISO 3166 A3 codes. for example: + .BRA, .FRA, .VIR { + fill:#00ff00; (color Brazil, France, and the US Virgin Islands green) + } + .BRA circle, .FRA circle, .VIR circle { + display:block; (display the small-country circles for these regions and their dependencies) } */ .water { @@ -60,6 +31,7 @@ } + diff --git a/input/Advanced/Template provinces.svg b/input/Advanced/Template provinces.svg index 4a722e6..01bd1cc 100644 --- a/input/Advanced/Template provinces.svg +++ b/input/Advanced/Template provinces.svg @@ -1,50 +1,20 @@ - - - - - - - - - - - - - - - - - + Blank world map A map of the world with the top-level administrative divisions for all countries shown. Borders precise to 50 km. + diff --git a/input/Advanced/Test.svg b/input/Advanced/Test.svg index 2d353ae..6d63361 100644 --- a/input/Advanced/Test.svg +++ b/input/Advanced/Test.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines and lakes A map of the world, showing all landmasses as SVG paths. Coastlines precise to 50 km. diff --git a/input/Advanced/Tissot Wikipedia +0.svg b/input/Advanced/Tissot Wikipedia +0.svg index 1a4fcb0..2728c80 100644 --- a/input/Advanced/Tissot Wikipedia +0.svg +++ b/input/Advanced/Tissot Wikipedia +0.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines, graticule, and indicatrices A map of the world, showing all landmasses with 10° graticule and Tissot's indicatrices of diameter 1,000 km and spacing 30°. Coastlines precise to 110 km. diff --git a/input/Advanced/Tissot Wikipedia -20.svg b/input/Advanced/Tissot Wikipedia -20.svg index c2ecf57..c3d3f69 100644 --- a/input/Advanced/Tissot Wikipedia -20.svg +++ b/input/Advanced/Tissot Wikipedia -20.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines, graticule, and indicatrices A map of the world, showing all landmasses with 10° graticule and Tissot's indicatrices of diameter 1,000 km and spacing 30°. Coastlines precise to 110 km. diff --git a/input/Basic.svg b/input/Basic.svg index 775790d..b1f4e3a 100644 --- a/input/Basic.svg +++ b/input/Basic.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines and lakes A map of the world, showing all landmasses as SVG paths. Coastlines precise to 50 km. @@ -47,6 +19,7 @@ } + diff --git a/input/Compound.svg b/input/Compound.svg index 341addd..d7749a8 100644 --- a/input/Compound.svg +++ b/input/Compound.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines, graticule, and indicatrices A map of the world, showing all landmasses with 15° graticule. Coastlines precise to 50 km. diff --git a/input/Graticule.svg b/input/Graticule.svg index 82e1ce4..82d742d 100644 --- a/input/Graticule.svg +++ b/input/Graticule.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map – 5° graticule An Equirectangular graticule, showing all landmasses with 5° graticule, including the Polar Circles and the Tropics. diff --git a/input/Orthodromes.svg b/input/Orthodromes.svg index badc43e..ddca762 100644 --- a/input/Orthodromes.svg +++ b/input/Orthodromes.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Icosahedral orthodromic mesh – Equirectangular projection A mesh of great circles that intersect with 10-fold symmetry at 12 principal nodes and 6-fold symmetry at 20 minor nodes. Aligns with the edges of an icosahedron and its dual dodecahedron. diff --git a/input/Political.svg b/input/Political.svg index 4edea15..7b8f20f 100644 --- a/input/Political.svg +++ b/input/Political.svg @@ -1,43 +1,15 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – political borders A map of the world, showing all countries recognised by the UN as SVG paths, with major lakes overlaid. Borders precise to 50 km. + @@ -357,7 +330,7 @@ - + diff --git a/input/Simplified.svg b/input/Simplified.svg index dca8a8c..4967cdb 100644 --- a/input/Simplified.svg +++ b/input/Simplified.svg @@ -1,37 +1,9 @@ - - - - - - - - - - - - - - - - - + Equirectangular map of the world – coastlines and lakes A map of the world, showing all landmasses as SVG paths. Coastlines precise to 50 km. @@ -47,6 +19,7 @@ } + \n' diff --git a/src/zupplemental/compose_maps.py b/src/zupplemental/compose_maps.py index c3dee53..8547451 100644 --- a/src/zupplemental/compose_maps.py +++ b/src/zupplemental/compose_maps.py @@ -17,6 +17,7 @@ def main(): write_svg_code_to_file( "../../input/Basic.svg", ' \n' + ' \n' ' \n' + plot_shapes('ne_50m_land', trim_antarctica=True, mark_antarctica=True) + ' \n' @@ -112,10 +113,11 @@ def main(): write_svg_code_to_file( "../../input/Political.svg", ' \n' + ' \n' ' \n' + plot_political_shapes('ne_50m_admin_0_countries', trim_antarctica=True) + ' \n' - ' \n' + ' \n' + plot_shapes('ne_50m_lakes', max_rank=4) + ' \n' ' \n' @@ -126,6 +128,7 @@ def main(): write_svg_code_to_file( "../../input/Advanced/Template countries.svg", ' \n' + ' \n' ' \n' + plot_political_shapes('ne_110m_admin_0_countries', trim_antarctica=True, add_title=True, mode="normal") @@ -145,6 +148,7 @@ def main(): write_svg_code_to_file( "../../input/Advanced/Template provinces.svg", ' \n' + ' \n' ' \n' + plot_political_shapes('ne_10m_admin_1_states_provinces', trim_antarctica=True, add_title=True) + ' \n'