diff --git a/app/build.gradle b/app/build.gradle
index 42025c3..1ffb7d9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -15,7 +15,7 @@ android {
minSdk 28
targetSdk 34
versionCode 1
- versionName "0.1a"
+ versionName "1.0"
}
signingConfigs {
create("release") {
diff --git a/app/src/main/assets/aeqd01.svg b/app/src/main/assets/aeqd01.svg
index 1ede913..4694818 100644
--- a/app/src/main/assets/aeqd01.svg
+++ b/app/src/main/assets/aeqd01.svg
@@ -1,4893 +1,4408 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/assets/loxim01.svg b/app/src/main/assets/loxim01.svg
index 398fb21..40e410b 100644
--- a/app/src/main/assets/loxim01.svg
+++ b/app/src/main/assets/loxim01.svg
@@ -1,4893 +1,4408 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/assets/webmercator01.svg b/app/src/main/assets/webmercator01.svg
index 9ad85eb..570189c 100644
--- a/app/src/main/assets/webmercator01.svg
+++ b/app/src/main/assets/webmercator01.svg
@@ -1,4893 +1,4408 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt b/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt
index f63d5ee..84a8aea 100644
--- a/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt
+++ b/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt
@@ -39,17 +39,20 @@ class CSSWrapper(private val ctx: Context) {
private fun refresh() {
val id = if (Settings.isRegional(ctx)) "1" else "2"
customCSS = visits.getVisitedByValue().map { (k, v) ->
- if (groups.getGroupFromKey(k).key != NO_GROUP || (!Settings.isRegional(ctx) && k == AUTO_GROUP)) {
- v.joinToString(",") { "#${it}$id,#${it}" } + "{fill:${
- colorToHex6(
- if (k == AUTO_GROUP)
- colorWrapper(ctx, android.R.attr.colorPrimary)
- else groups.getGroupFromKey(k).color
- )
- };}"
+ (if (groups.getGroupFromKey(k).key != NO_GROUP) {
+ v
+ } else if (!Settings.isRegional(ctx) && k == AUTO_GROUP) {
+ v.filter { it !in World.WWW.children.map { it1 -> it1.code } }
} else {
- ""
- }
+ emptyList()
+ }).takeIf { it.isNotEmpty() }
+ ?.joinToString(",") { "#${it}$id,#${it}" } + "{fill:${
+ colorToHex6(
+ if (k == AUTO_GROUP)
+ colorWrapper(ctx, android.R.attr.colorPrimary)
+ else groups.getGroupFromKey(k).color
+ )
+ };}"
}.joinToString("")
}
diff --git a/app/src/main/res/values/en.xml b/app/src/main/res/values/en.xml
index dd0d464..2c17ce2 100644
--- a/app/src/main/res/values/en.xml
+++ b/app/src/main/res/values/en.xml
@@ -18,7 +18,7 @@
Regional
About
Beans is free and open source software, licensed under the GNU General Public License (version 3 or later)
- Project repository: https://git.helcel.net/helcel/beans\n Feel free to report issues or contribute to the project.
+ Project repository: https://github.com/helcel-net/beans\n Feel free to report issues or contribute to the project.
Free and open source dependencies and licenses
About the Beans application
Select the group to assign. Long press on a group to edit its name and color.
diff --git a/gensvg.sh b/gensvg.sh
index f1ce7ce..168830a 100644
--- a/gensvg.sh
+++ b/gensvg.sh
@@ -15,13 +15,13 @@ countries=(
"DNK" "DJI" "DMA" "DOM" "ECU" "EGY" "SLV" "GNQ" "ERI" "EST" "ETH" "FLK" "FRO" "FJI" "FIN" "FRA" "GUF" "PYF" "ATF"
"GAB" "GMB" "GEO" "DEU" "GHA" "GIB" "GRC" "GRL" "GRD" "GLP" "GUM" "GTM" "GGY" "GIN" "GNB" "GUY" "HTI" "HMD" "HND" "HUN"
"ISL" "IND" "IDN" "IRN" "IRQ" "IRL" "IMN" "ISR" "ITA" "JAM" "JPN" "JEY" "JOR" "KAZ" "KEN" "KIR" "XKO" "KWT" "KGZ"
- "LAO" "LVA" "LBN" "LSO" "LBR" "LBY" "LIE" "LTU" "LUX" "SXM"
- "MKD" "MDG" "MWI" "MYS" "MDV" "MLI" "MLT" "MHL" "MTQ" "MRT" "MUS" "MYT" "MEX" "FSM" "MDA" "MCO" "MNG" "MNE" "MSR" "MAR" "MOZ" "MMR"
- "NAM" "NRU" "NPL" "NLD" "NCL" "NZL" "NIC" "NER" "NGA" "NIU" "NFK" "PRK" "ZNC" "MNP" "NOR" "OMN"
- "PAK" "PLW" "PSE" "PAN" "PNG" "PRY" "PER" "PHL" "PCN" "POL" "PRT" "PRI" "QAT" "COG" "REU" "ROU" "RUS" "RWA" "BLM" "MAF"
- "SHN" "KNA" "LCA" "SPM" "VCT" "WSM" "SMR" "STP" "SAU" "SEN" "SRB" "SYC" "SLE" "SGP" "SVK" "SVN" "SLB" "SOM" "ZAF" "SGS" "KOR" "SSD" "ESP"
- "LKA" "SDN" "SUR" "SJM" "SWZ" "SWE" "CHE" "SYR" "TWN" "TJK" "TZA" "THA" "TLS" "TGO" "TKL" "TON" "TTO" "TUN" "TUR" "TKM" "TCA" "TUV" "UGA"
- "UKR" "ARE" "GBR" "USA" "UMI" "URY" "UZB" "VUT" "VAT" "VEN" "VNM" "VIR" "WLF" "ESH" "YEM" "ZMB" "ZWE"
+"LAO" "LVA" "LBN" "LSO" "LBR" "LBY" "LIE" "LTU" "LUX" "SXM"
+"MKD" "MDG" "MWI" "MYS" "MDV" "MLI" "MLT" "MHL" "MTQ" "MRT" "MUS" "MYT" "MEX" "FSM" "MDA" "MCO" "MNG" "MNE" "MSR" "MAR" "MOZ" "MMR"
+"NAM" "NRU" "NPL" "NLD" "NCL" "NZL" "NIC" "NER" "NGA" "NIU" "NFK" "PRK" "ZNC" "MNP" "NOR" "OMN"
+"PAK" "PLW" "PSE" "PAN" "PNG" "PRY" "PER" "PHL" "PCN" "POL" "PRT" "PRI" "QAT" "COG" "REU" "ROU" "RUS" "RWA" "BLM" "MAF"
+"SHN" "KNA" "LCA" "SPM" "VCT" "WSM" "SMR" "STP" "SAU" "SEN" "SRB" "SYC" "SLE" "SGP" "SVK" "SVN" "SLB" "SOM" "ZAF" "SGS" "KOR" "SSD" "ESP"
+"LKA" "SDN" "SUR" "SJM" "SWZ" "SWE" "CHE" "SYR" "TWN" "TJK" "TZA" "THA" "TLS" "TGO" "TKL" "TON" "TTO" "TUN" "TUR" "TKM" "TCA" "TUV" "UGA"
+"UKR" "ARE" "GBR" "USA" "UMI" "URY" "UZB" "VUT" "VAT" "VEN" "VNM" "VIR" "WLF" "ESH" "YEM" "ZMB" "ZWE"
)
@@ -117,25 +117,28 @@ toSVG_1() {
toSVG_01() {
- input_files=("./temp/1/ATA.json" "./temp/0/ATA.json")
-
+ input_files=()
+
+ input_files+=("./temp/1/ATA.json")
for country in "${countries[@]}"
do
input_file1="./temp/1/${country}.json"
- input_file0="./temp/0/${country}.json"
if [ -f "$input_file1" ]; then
input_files+=("$input_file1")
fi
+ done
+ input_files+=("./temp/0/ATA.json")
+ for country in "${countries[@]}"
+ do
+ input_file0="./temp/0/${country}.json"
if [ -f "$input_file0" ]; then
input_files+=("$input_file0")
fi
done
-
- "$mapshaper" -i combine-files ${input_files[@]} snap -proj eqdc +lat_1=55 +lat_2=60 -simplify 0.005 weighted keep-shapes resolution=1200x1200 -o ./app/src/main/assets/eqdc01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
- "$mapshaper" -i combine-files ${input_files[@]} snap -proj loxim densify -simplify 0.005 weighted keep-shapes resolution=1200x1200 -o ./app/src/main/assets/loxim01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
- "$mapshaper" -i combine-files ${input_files[@]} snap -proj webmercator densify -simplify 0.005 weighted keep-shapes resolution=1200x1200 -o ./app/src/main/assets/webmercator01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
- "$mapshaper" -i combine-files ${input_files[@]} snap -proj aeqd +lat_0=90 densify -simplify 0.005 weighted keep-shapes resolution=1200x1200 -o ./app/src/main/assets/aeqd01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
+ "$mapshaper" -i combine-files ${input_files[@]} snap -proj loxim densify -simplify 0.001 weighted keep-shapes -o ./app/src/main/assets/loxim01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
+ "$mapshaper" -i combine-files ${input_files[@]} snap -proj webmercator densify -simplify 0.001 weighted keep-shapes -o ./app/src/main/assets/webmercator01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
+ "$mapshaper" -i combine-files ${input_files[@]} snap -proj aeqd +lat_0=90 densify -simplify 0.001 weighted keep-shapes -o ./app/src/main/assets/aeqd01.svg svg-data=GID_0,COUNTRY,GID,NAME id-field=GID
}
do_1() {
@@ -152,8 +155,8 @@ do_0() {
done
wget -q -O "./temp/1/ATA.json" "$ATA_URL"
}
-do_0
-do_1
+# do_0
+# do_1
# toSVG_0
# toSVG_1
toSVG_01
\ No newline at end of file
diff --git a/mapping.js b/mapping.js
new file mode 100644
index 0000000..02a1bbd
--- /dev/null
+++ b/mapping.js
@@ -0,0 +1,325 @@
+var continents = {
+XAD:"EEE",
+ALA:"EEE",
+ALB:"EEE",
+AND:"EEE",
+AUT:"EEE",
+BLR:"EEE",
+BEL:"EEE",
+BIH:"EEE",
+BGR:"EEE",
+HRV:"EEE",
+CYP:"EEE",
+CZE:"EEE",
+DNK:"EEE",
+EST:"EEE",
+FRO:"EEE",
+FIN:"EEE",
+FRA:"EEE",
+DEU:"EEE",
+GIB:"EEE",
+GRC:"EEE",
+GGY:"EEE",
+HUN:"EEE",
+ISL:"EEE",
+IRL:"EEE",
+IMN:"EEE",
+ITA:"EEE",
+JEY:"EEE",
+KAZ:"EEE",
+XKO:"EEE",
+LVA:"EEE",
+LIE:"EEE",
+LTU:"EEE",
+LUX:"EEE",
+MLT:"EEE",
+MDA:"EEE",
+MCO:"EEE",
+MNE:"EEE",
+NLD:"EEE",
+MKD:"EEE",
+NOR:"EEE",
+POL:"EEE",
+PRT:"EEE",
+ROU:"EEE",
+RUS:"EEE",
+SMR:"EEE",
+SRB:"EEE",
+SVK:"EEE",
+SVN:"EEE",
+ESP:"EEE",
+SJM:"EEE",
+SWE:"EEE",
+CHE:"EEE",
+UKR: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U:"UUU",
+NCL:"UUU",
+NZL:"UUU",
+NIU:"UUU",
+NFK:"UUU",
+MNP:"UUU",
+PLW:"UUU",
+PNG:"UUU",
+PCN:"UUU",
+WSM:"UUU",
+SLB:"UUU",
+TKL:"UUU",
+TON:"UUU",
+TUV:"UUU",
+VUT:"UUU",
+WLF:"UUU",
+
+ATA:"XXX",
+BVT:"XXX",
+HMD:"XXX",
+SGS:"XXX",
+}
+
+import fs from "fs"
+import {JSDOM} from "jsdom"
+
+function groupByContinent(svgFilePath) {
+ // Read the SVG file
+ fs.readFile(svgFilePath, 'utf-8', (err, data) => {
+ if (err) {
+ console.error('Error reading SVG file:', err);
+ return;
+ }
+
+ // Create a virtual DOM with JSDOM
+ const dom = new JSDOM(data);
+ const document = dom.window.document;
+
+ // Select the root