-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider embedding interactive map as <iframe> into "Country - Map" note type (Extended deck version) #638
Comments
Thanks for bringing this up! It's a very interesting idea! Just to make sure: the point is to embed an interactive, unlabelled (but with country borders) map on the front side of the "Country - Map" cards? (So that one just has to "choose" the country from a visible map, rather than visualising the map oneself.) (Aside: this is also interesting because it helps narrow down the goal of the "Country - Map" cards, which is rather than unclear with the current design (that has long bothered me) — whether it's a) to be able to locate the country on a map, b) to be able visualise the country's borders, c) to be able to visualise the country's borders and its neighbours, d) something else. Here it'd be clear that it's just a.) Unfortunately, there are many probably-hard-to-resolve issues (see below) that would make me very hesitant accepting such an iframe solution into the main extended deck. (If Anki had a convenient global opt-in/opt-out mechanism then many of these wouldn't hold, but unfortunately it doesn't.) However, an alternative approach would be for this to go into a "variant deck" (e.g. we'd have ~ "experimental extended deck with interactive map" in addition to "standard" and "extended" (probably just for English and/or some small subset of languages to avoid an n×m proliferation of decks)), where the barrier to entry would be much lower (though the flipside would be that the deck would likely also have far fewer users) — i.e. in effect an internal soft fork (if that makes sense) — if that's something that you'd be interested in. Issues with iframe solution
Of these 1, 2 and 4 wouldn't hold for a variant deck (the user would be clearly opting in), 3 might still hold (but since it'd be an experimental variant, it'd arguably be less of a ToS violation?) and 5 isn't essential. (Sorry for the wall of text — didn't have time to make it any shorter...) |
Could you elaborate please? What do you mean by "opt-in/opt-out"?
Exactly! Here is what I managed to get for temporary use: As you see from the gif, the issue with embedding the link I attached is 1) Slow loading (relatively); 2) Unnecessary labels displayed Additionally, I've performed a bit of research and the points 3 and 4 (ToS and Licensing) are actually problematic with the map, link to which I attached - according to their pricing model users are billed by views of their map, if I understand correctly. So, unless we want to bring someone in deep debt, we might not use this map. Moreover, the user might delete the map from the profile at any time, bringing the whole idea down I see 2 alternatives to the aforementioned issue: Usage of open-source map API with labeling (i.e. country names) removal.I've researched this idea a bit and there are certain providers of maps like OpenStreetMap that allow to make use of their map with the requirement of crediting them The only thing left to figure out is whether I will be able to apply some filters to display non-labelled map. There is JS library called Leaflet that is explicitly stated as mobile-friendly. Its intention is exactly to make use of open-source maps. If I manage to figure out how to make it work, even mobile users might benefit from this idea as there should not be performance issues. Note, that point 1 (Mobile bandwidth) remains HTML CanvasThis idea came to me literally today as a complete turnover from the previous one of embedding labelless map cards. Instead of providing interactive map and make user "choose" the country with already existing border, we might provide a picture of, say, borderless Europe in the canvas and the user is themselves responsible for highlighting the borders of required country and deciding on whether they did it correctly enough The downsides I see is 1) Mobile under question; 2) The need to provide different canvases to different continents (probably even more, as there are some islands far from the continent); 3) User is not required to interactively look up the country (might impact the memory effect?) As a general conclusionFirst off, the initial idea is not valid enough (at least in its purest form, as is) and needs to be improved by either (but not restricting to) of the alternatives stated (though as a hacky way it still works and I think I might continue using it until there is better solution) Revisiting your points assuming first idea is to be implemented (OS map API usage):
(Sorry for the wall of text as well, just trying to help improve something I admire) |
Thanks very much for your detailed, thought-out reply!
I mean more-or-less what you wrote here:
at the very least as an overall per-user option (to apply everywhere for the given user). (Preferably there'd be easy access to a toggle (so that users can quickly switch between having it displayed/not displayed), and ideally it'd be on a per-platform basis — so that users can, say, choose to always have the map displayed on desktop but never on mobile; however these are even less likely.) One simple-ish (at least for the more technically-inclined users..) approach that I missed earlier might be to control the loading of the interactive map with a variable in the JS code, along the following lines: // With nicer function/var names
const shouldLoadInteractiveMap = false; // switch to true to opt-in
function loadInteractiveMap() {
// create iframe or apply whatever approach we choose
}
if (shouldLoadInteractiveMap) {
loadInteractiveMap();
} Unfortunately, this is very user-unfriendly for the non-technically-inclined, and possibly even less convenient than just using a variant deck. (Aside: using localStorage to store user preference doesn't work (like I hoped it might) as it's currently not persisted on either Anki or AnkiDroid.)
Yes, gauge user feedback and merge if critical points are solved and users like it (but keep it as a variant otherwise (in effect as a heavy opt-in mechanism)). (Note that the points I've brought up are my viewpoint. My co-maintainers might have more stringent or more relaxed opinions and depending on user preference we might also adjust what is considered critical (in either direction), so I'm not making any promises regarding inclusion into the extended deck.)
Yeah, I don't think there's a way around a setting option of some sort. (Very crazy) local mapA very crazy idea would be to store the JS library and all the tiles locally (in the deck!). Since we don't need to have high zoom levels, the amount of tiles might be just about feasible. To get a feel for the potential data size, the Organic Maps (offline maps app) "WorldCoasts" mwm file is 8 MB, while the "World" file is 46 MB. The "World location map" SVG file on Wikipedia is 5 MB. For comparison, all our AUG image files are currently 16 MB. The amount of detail available in the World Map on OM (without extra data files) is slightly greater than what we need, and the detail in the SVG file is about right, so maybe we could manage without ballooning our media size? Clearly, this would also be very hard to get to work, since we'd be embedding everything... (It seems that
There's also the issue that by displaying different canvases we'd be telling the user which continent the country is on. Also, for larger continents like Asia a single canvas might not be detailed enough.
I'm glad that at the very least you have an ok-ish approach for your personal use! :)
I agree that the OS map approach is promising. (Definitely something we'd want for a variant deck, and IMO for the main deck if we find a convenient "setting option".) |
I'm keen on the idea of storing an SVG world map in the deck. I feel like we might even be able to make it interactive with a bit of JS so users can zoom in and tap on the country to answer. Maybe another shared deck has already done something this? |
This seems promising: https://jvm-docs.vercel.app/ |
Amazing finding! From a first glance at the docs, the library provides a lot of the features that fit the issue needs:
Just a note from a few days of usage of interactive content on AnkiDroid: It is horribly incompatible when there are certain gestures set up in the card reviewer (e.g. "Undo", "Edit note"). |
If you don't mind, I will take the things discussed into consideration and start the research of the library mentioned above with further development I think I will get back with updates once in a while. Just note, that it won't be quick (think a month or so) as I am not the fast one 🙂. Having other things on the agenda does not help either. So if it is such a revolutionary thing that needs to be done immediately, then probably it is beneficial if someone else volunteers to take control of development. |
It's definitely not revolutionary/urgent — take as long as you need! Thanks very much for looking into this! |
Getting back with updates on the current implementation status. Please, take your time going through the comment, it is another long-read, this time with all the technical details 🙃. Here is a raw example of a card of "Country - Map" note type (Refer to PoC section for code): User is suggested to pick a country from the map. After picking a country card gets swapped automatically, zooming in on the correct answer. Emphasizing on the adjective "raw" as there are a lot of things to be clarified/adjusted Here is a list of notes/questions/ideas: Note (# 1 - Baseline change):First of all, for such solution to work there is a need to introduce a way for JS code to highlight correct region on answer. In PoC in was achieved by setting "Map" field to appropriate region code: Note (# 2 - Region border width limitation):In the PoC demo you can see that the style of map coloring was attempted to be maximally preserved. Still, borders of regions look excessively wide relative to the map viewport, unfortunately with current API there is no way to make them any more thinner (see Note #5 section for proposed solution). Note (# 3 - Crossplatform compatibility):The PoC was tested on both Anki Desktop and AnkiDroid. Unfortunately I am not able to get my hands on AnkiMobile app (IOS). Probably will need help from fellow Iphone users. Note (# 4 - Local library storage):As initially hinted by @axelboc, the library is easily stored locally. This eliminates bandwith problem completely, while optimizing the performance to the maximum. The PoC is using code of the library from Note (# 5 - Library limitations, solution):As an aside, the library lacks a lot of useful features / contains certain bugs. For example:
Some of them have corresponding issues on the GitHub page of source code. Apparently, code maintainer is aware of them, just quite busy to implement the changes. I have became quite familiar with codebase of the library (as documentation does not describe all the details properly there is a need to dive deeper) so I think I will contribute to it with fixes/updates at some point. Just not sure if maintainer will accept them soon as it feels the author rarely patches up the repo nowadays. Since the library is intended to be stored locally (including SVG maps) one of the solutions is to include a fork (instead of master version) with agreed critically needed features/bug fixes added (if any) in case of their delayed acceptance into original codebase. The idea is further solidified by the next section Note (# 6 - Additional maps)There is a number of reasons behind the motivation to create extended maps aside from the "world.js" (further - default map) provided by library author:
The concept(not yet included in the PoC) is to programmatically decide to show to the user a map depending on the region specified in the note. For example:
It is proven to be programatically achievable (tried it). The major implementation detail is storing JS In case points stated above are valid it needs to be discussed what maps to create. Thoughts on the subject? Idea (# 7 - Green/Red answer):It is possible to make coloring of a region on answer either red or green, depending on whether the answer is correct to visually aid user: Although ideally in case of incorrect answer two regions should be highlighted - selected in red and correct in green. But, again, the library right now lacks the ability to highlight regions with different colors (see Note #5 section). Thoughts? Idea (# 8 - Capitals on map):The library allows for "Markers" feature: I understand the idea is significantly remote from the current issue, but still worth considering: Not an immediate thing to discuss, just a matter of thought for the future. To summarize:The concept and underlying implementation library have proven to be promising, although require a lot of work to be adjusted to the project's needs - thus such a long-read comment with so many points Proof of Concept (PoC)Codepen: https://codepen.io/helitopia/pen/BaeErdz Sample deck: https://github.com/user-attachments/files/16232607/UG_Anki_PoC_jsvectormap.zip Direct notetype code: |
Hi @helitopia Sorry for the very late response! Firstly (limitations aside), this is really, really cool and it looks like a huge amount of work! :) For a "raw" implementation it works quite smoothly and nicely!
Yeah, we can add a "Region code" field (we can bikeshed names later :)) or if we completely remove the static map just repurpose the "Map" field like you did. (If we really don't want to add an extra field with region codes, then I'm sure that we could have a lookup table/dictionary, for country names to region codes, but IMO that'd be over-complicated, especially given multilinguality.)
You've managed to replicate the style of our maps quite accurately!
Unfortunately, I only have access to an ancient iPad (with iOS 9 (current version is 17)), so I'm not much help.
This is great! And it's great that it's already fully-local in the "raw" version! :)
Yes, in principle, I don't see any reason not to create and use our own fork of the library (though obviously trying to upstream everything, to the extent possible, like you suggest).
Yes, using a custom map might also allow for the main map to have finer detail (the default map from the library is rather "angular" when you zoom in, and completely lacks many smaller islands (even island countries not just dependent territories and the like)). Given that the default map is ~ 100 kB, we could probably easily have a resolution ~ three times bigger (for a file size of ~ 900 kB) or more. (No idea how difficult it's to generate an alternative map in the appropriate format for the library.) Some potential problems:
TBH maybe we should just implemement only sovereign states as a first implementation??
Very interesting, not sure! Given the limitations of the library, maybe just have an option to display a textual message ("you selected Belarus"??)?? Would that be annoyingly verbose? But while cool, I don't think that this is a priority — the user should know which region they just selected, and they can hover over it to find out what it was, so while nice, we don't have to display their selection.
An extra Capital-Map card is interesting! (FWIW I have a partial implementation of having static capital map cards (purely as auxiliary info on the current capital cards), that I haven't quite finished off, that I've been sitting on, for a while, but it's a different use-case.)
I think that one approach might be to initially just focus on UN-recognised sovereign states (and provide some static fallback in the other cases) to side-step the issue of hierarchical regions and alternative maps?? With a more detailed map and slightly narrower borders, I'd definitely want this as an experimental deck, even if we only have some subset of notes (and the borders deviate from our static maps)! (TBH I'd even want the current PoC as an experimental deck — I can imagine some people wanting to use the interactive map as a rough aide* — but the time spent tagging all relevant countries/integrating everything in might not be worth it for you, for now.) * in terms of user-experience it's probably worse than an iframe like you were using (though on the plus side it's much, much faster), but for local-first/highly-privacy-oriented people it might be worth it |
Hi @aplaice Thank you for the detailed review, I appreciate the effort! All the thoughts and comments are noted.
I suggest a smooth start - integration of PoC in experimental deck for European countries only (with static fallback for everything else). Edit: Europe is chosen solely on the basis of preference and assumed popularity among the users While it is true, that the efforts exist for such work, there is a huge benefit - user feedback. Up to this moment we have discussed all the issues from theoretical perspective, when, from personal experience, it is really difficult to account for all the things that might go wrong in practice. This way we gain enormous advantage while contributing relatively (to the whole deck) low effort in case current PoC is flawed. And in the meanwhile I will continue to work on the subjects discussed + probable issues/suggestions obtained from users What do you think? |
Yes, that's a sensible start (and your arguments make sense)! (But that's up to you, as the driver of this effort!) (I'm very happy to help if you have any questions about the slightly idiosyncratic way we arrange things, here, etc.) |
Fantastic work, thanks for providing so much details on your progress! The approach you both agreed on is also fine by me. |
Hi, I've been getting the emails about this issue and got a very rough idea of what was happening, but I just read this issue entirely and I'm very excited about all this. 😍 Tomorrow I want to read and take a look at the PR @helitopia did with detail. Just in case it helps, I have access to an iPhone and an iPad of a friend that uses Ankimobile. If you need anything, ping me. I'll try to keep in touch with this development, but just in case I miss something. 🥰 |
Hello @josealberto4444, Thank you for the kind words! It is really surprising how a simple idea with
Currently we are working on final minor changes to the PR to properly prepare for the first release. Please feel free to ping me anytime anywhere if you have any questions.
This is wonderful news! We will most definitely need someone to test the deck on AnkiMobile as unfortunately I don't have access to any IOS devices. |
Hi all, Just as you probably thought "how much longer his comments can be" :) Congratulations to everyone involved on the first experimental deck beta-release for this issue! 🎉 Getting back to the remaining agenda on this issue. The items below are listed in the high-to-low priority order (grouped by The only question is whether it is better to leave them all in scope of this issue only or to separate each one into separate issue. IMO the latter option would encourage other contributors to participate as well by modularizing each task (in contrast to reading this already terrifyingly large thread). Glossary
Major milestonesGeoJson migrationCurrently the world map in usage is generated based on SVG taken from the Web. This approach was first chosen due to its convenience. To eliminate the issue the following map utilization workflow is to be introduced:
The initial GeoJson can be created by either:
Custom maps implementationAfter the previous step is done the process of completing map(s) to fit project needs should start. The issue represents a large number of smaller sub-issues. See the following sections for details on each one. Small-area regions interactabilityThe problem with selecting such regions (read islands) at the moment is that some of them have small area relatively to the fixed border width: This is the reason (that is, absence of the solution) that current IM version limits maximum zoom level even though JSV allows it to be arbitrarily large. The solution to this issue is introduction of JSV option to reduce border width proportionally to a certain ZL starting from its certain value and then allowing for much higher maximum ZL (large enough to select the smallest islands present in the map). For example, Water bodies and their hierarchyAdditionally to currently existing regions water bodies should be added. As mentioned in the comment (section "How to deal with hierarchical seas"), there is an issue with the selection mechanism of water bodies that are fully inside other water bodies. At the moment there is an idea for the functionality - at all times (independently of a card and its side) to behave as follows (on the example of Mediterranean and Aegean seas):
The possibility of this behaviour needs to be investigated in JSV. Disputed borders and separate regions(Examples: Transnistria and Moldova, Corsica and France, Ireland and England) In addition to solution described in "Water bodies and their hierarchy" section, two things need to be considered:
This issue is probably the most complex in terms of required logic for implementation. ContinentsThis one should be pretty straight-forward. Currently there are neither map separate for continents nor the logic to display it when corresponding card is reviewed. Creation of the map in a way discussed in previous sections (via GeoJson) and addition of logic to work with it are required. Selected region pattern highlightAs was originally suggested ("Map colours" section) it is possible to employ the following selected region hightlighting schema:
As was further discussed in the comment (section "Patterns in regions"), JSV library in status quo does not natively support selected region pattern highlight. The implementation of such logic is required. But before getting to it, it is recommended to assemble a PoC of the idea in order to understand whether the idea is of any good at all (and thus avoid doing extra work that might be discarded anyway). Performance considerationsAs mentioned in the main description of the initial PR:
There is certainly a risk that any of the aforementioned changes may bring performance to the unusable level. Even if we do not introduce any more detalized maps than there currently exist, the JSV library still heavily relies on the ability to perform hube number of calculations. If we do stumble upon this issue, JSV codebase may be tried to be optimized. To hell with it, I am even willing to rewrite it into WebGL for the sake of experience, but unless we plan to roll out a Google Maps competitor, just taking care and be mindful of the performance would be enough. Other improvementsEdit: Incorrect selected and correct regions highlightAs was mentioned early on:
Currently, JSV does not allow for different selection styles of multiple regions. The intention of this item is to investigate the possibility of introduction of such logic. Mobile media refreshingAt the moment it is unclear of the criteria by which AnkiDroid decides to refresh files from server into media folder (in particular IM scripts). The issue should be investigated further. Mention of possible solution in the comment:
is non-preferred due to the reason specified in the next after aforementioned comment:
Zoom animation max levelThe problem with setting infinitely large zoom level (after "Small-area regions interactability" milestone is implemented) is that when region is animated to be shown (on the back card side), it will animate zoom up until a certain region fills either horizontal or vertical space leaving no context around the region. Here is an example for Iceland: Probable solution to this issue is a separate maximum zoom level (which is less than maximally allowed) when animating zoom on region show (and if user needs more context they can additionally zoom in / out) Edit: Zoom animation abrupt reset fixAs discussed in the thread AnkiDroid gesture disablingWhen IM is used in AnkiDroid with enabled gestures, there is a conflict arising, making usage of one feature impossible without accidental interaction with the other. At the moment, to workaround this issue additional notice was written in the wiki. To improve user experience and avoid making users disable gestures every time they want to review UG cards with IM in the note template, investigate the possibility of disabling gesture registering in the IM canvas. Dark modePossibility of introducing a switch for dark interactive map mode (example - source). If agreed, region highlighting colors should be determined. Configuration reset noticeWith each experimental-to-experimental deck update the configuration of the user (in note template) is reset. Write the corresponding notice in the wiki page and add an item to instruction list stating that to preserve custom configuration it must be manually saved prior to the update. BugsGlobal tooltip litteringCurrent version of the library inserts tooltip into Such situation leads to a problem as shown tooltip is not erased between different card reviews, thus making tooltips accumulate, which is distracting to say the least. Currently (commit 0f09943) this issue is resolved via separate function respondible for DOM manipulation: function clearTooltips() {
commonElements.mapTooltips.forEach(x => x.remove());
} In the future it would be nice to have ability to specify parent element of the created tooltip when initializing JSV.
|
Thanks for summarizing all this. ❤️ I completely agree with the idea of splitting this in different issues or we will go crazy, haha. For example, I already have some comments about the highlight colors and the small regions interactability (the comment: it is already happening with Bahrain and Singapore). |
Separate issues definitely, but maybe not for everything and/or not right away. This issue can remain open until we consider the interactive deck "stable". Once that happens, we can move all the remaining topics into separate issues to continue investigating and/or gather input from the community. For shorter term stuff (like the colours/patterns), we (i.e. anyone) can open issues/PRs/discussions as needed:
A quick search led me to MapLibre, OpenLayers, and gleo... 😂 but I doubt they meet our offline requirement. Might still be worth exploring though. Regarding prioritisation, here is my personal opinion:
|
Agreed on the workflow.
My point was to show the dedication for the idea to succeed 😄. Anyway, as I said, it is rather extreme.
Yeah, that and the fact that it will probably be less work (and more fun :)) to tailor JSV to our needs rather than to start from scratch with the new library.
Haven't heard of it before. Tried it, attaching multiple samples below.
As you see from the samples, currently (with such ad-hoc solution) border width is the same as on static images when either:
Note that with As a quick resolution for the "stable" deck we might as well set Edit: JSV library has event Tell me what you think of it. To reproduce:
To summarize prioritization:
Makes sense, assuming not everything needs to be in the first stable release.
|
I like |
Hello, Coming back with updates on the topic. Small-area regions interactabilityThe item is resolved via:
Mobile media refreshingAccording to Anki docs and the discussion I initiated:
Media is synchronized when file addition/deletion/replacement happens and is not synchronized when files are simply edited. Apparently, manipulations performed by BrainBrew are classified as "editing" since the media sync is not triggered between imports of experimental deck with different script contents. The solution to this issue is rather simple. With each release we may include a dummy non-empty* file having hashed name** (not starting with underscore). This will make sure that media sync is triggered while also allowing Anki to remove the dummy file on the next "Check Media" occasion (since the file does not start with underscore) * - important as Anki recognizes only non-empty files during "Check Media" ** - in case a name is constant sync might not be triggered if a user did not "Check Media" since last UG import It is important to note that any manual changes to configuration (or script logic) directly in media folder are thus not synchronized, so the decision to move customizable configuration into the note template was unconsciously the right one. Zoom animation max levelTo reiterate - the issue is that by default JSV will zoom in on correct region (back card side) up until maximum zoom level is reached or until the region fills either horizontal or vertical canvas space (see Iceland example in the comment above). Due to "Small-area regions interactability" topic being resolved, we are setting maximum zoom level to extremely large value (to be able to zoom in on such region as Barbados). Thus, the problem is exacerbated leading to each region being zoomed up until it fills the canvas, thus providing very little context of the region's relative location: As a neat solution I suggest:
In case we proceed with such solution, there is a need to determine:
As another option to discuss - setting manually max zoom and max zoom animation levels for each region which will ensure that all of them are displayed correctly. Attaching a link to the branch with recent changes in case you want to build a deck to play around and try to figuring out discussed items (changes on the branch are for testing purposes only yet). Note that zoom level is updated and displayed at the top for your convenience. Also note that displayed scale is 10% less actual one (e.g. setting Separate regions display (e.g. Scotland, England, Wales and Northern Ireland)As I mentioned one of the solutions in my previous comment:
To summarize the idea: United Kingdom case study:
* - if really necessary, additional option of back card side border removal between common regions might be investigated, making highlighted area appear as a whole (in this example - UK) France and Corsica case study:
Let me know what you think relating suggested solution (and, preferably, all other discussed items :)). |
Thanks very much for continuing to develop this!
CrowdAnki
This is actually under the purview of CrowdAnki and is something that we could fix for all CrowdAnki users! :) Anki apparently checks the mtime of the directory, when deciding what to do with media, when syncing: (See also this commit where this behaviour was reintroduced: ) The mtime of a directory is unchanged if you copy in a file that overwrites an existing one. If you want to check this yourself, on a unix-like system:# Use subdir for easier clean-up.
mkdir -p test_dir/subdir/
echo foo > test_dir/subdir/foo
stat -c %y test_dir/subdir/ # Get mtime 1
sleep 3 # or just wait manually
echo bar > test_dir/foo
cp test_dir/foo test_dir/subdir/foo
stat -c %y test_dir/subdir/ # Get mtime 2 The two mtimes for (In contrast, if you just add in a new file, and then remove it, the mtime of the dir does change (even though the actual contents of the dir hasn't changed compared to before adding the new file).) CrowdAnki just uses If you think it's a good idea, I'll open an issue for CrowdAnki to see if anyone complains and if nobody does, I'll implement the change. :) WorkaroundOtherwise, the workaround as described makes sense!
Thanks! These make sense! The countries become slightly "pointy" at high zoom levels, but as I understand that's a trade-off between performance+file size and detail of the map.
Just to make sure: if I understand the name correctly, this would only be important for sufficiently small regions? (i.e. large regions would still be fully displayed if their desired zoom animation level is smaller than the max level.)
Yes, this would be lovely! :) I'm not sure whether we need this as an essential part of the next iteration, though! (Even greater might be also having a zoom-box (i.e. a second, zoomed-in copy of the map, so that the user could both see the details of the country and the context, at a glance, without having to change zoom), but that's definitely for the very long-term, if at all.)
I'm not sure I understand this.
Why would we need a per-country max zoom level? If the user really wants to zoom in a huge amount (e.g. to inspect a smaller, neighbouring country) then why not let them? (Is there a performance disadvantage to allowing a high zoom level? Or would it mainly be about preventing the user from zooming in to the levels where things start getting granular? (but we would still allow such high zoom levels for some other countries anyway.)
Yeah, that might be useful, but probably a lot of work (choosing levels for each country). IMO we should just have a global (config-adjustable) max animation zoom level, for now, and let people play around with it, to see what is most convenient and whether different max levels for different countries would be useful in practice.
In principle, these could be stored in the note itself as (part of) a field. (e.g. as part of the region code field (say, (We could also have a look-up table somewhere in the
I don't think this is great (in terms of the visuals — the "click workflow" itself is perfect), but I agree that it seems to be the best solution (I don't have any better ideas :(). In case you or somebody else has some other ideas, I'll try to describe the desiderata, as I see them (obviously, everybody please feel free to disagree!). The overall behaviour of what happens when one clicks on a given region is (IMO) exactly what we want. However, stylistically, there are two main stumbling points:
For borders, we'd ideally have different kinds of borders (international borders, internal borders, disputed borders), which would (IMO) resolve the issue of having borders within some countries, but not others. AFAIU this would require significant changes to the JSV library, but at least I see a good (long-term) theoretical solution. For hover-highlighting we would like to both:
which are clearly inconsistent with each other... I'd almost be in favour of just dropping hover-highlighting, but that would also be unfortunate. I'm also worried about what we should do in cases like Serbia vs. Kosovo, Georgia vs. South Ossetia, Somalia vs. Somaliland or China vs. Taiwan. (Currently, in the interactive map, Kosovo and Taiwan are separate, while South Ossetia and Somaliland aren't, but I don't know what would be a generally correct approach here.)
Thanks again for the comment and the changes to the JSV library/AUG itself (and sorry for the length!)! |
Thanks for investigating Anki's media folder update. Looks like there's a solution in sight! Regarding the max zoom level, it would be ideal to find a programmatic solution in the library. I'll try to investigate if I find the time. Regarding "multi-part" regions, I think what you suggest is good enough for now: highlight/select the smallest parts on the front card on hover/click; highlight all parts on the back card. However, perhaps a long term solution would be to allow multiple selections on the front card? I'm thinking that users would first have to select one of the parts (e.g. Scotland) without any hints, then a counter would appear in the corner "1/4" hinting that there's more to select. If they select any wrong region, they fail right away; if they manage to select all regions without making any mistake, they succeed. |
This is a very interesting idea, but it feels finicky and potentially annoying for the user (many clicks for a single card). |
Thank you for the feedback @aplaice
Right, I meant CrowdAnki.
It is definitely a better solution as the option with dummy file is basically a hack and would require to either manually create the file with every release or to write a bash script to do so automatically, which is obviously more work and no benefit to overall CrowdAnki community.
Yes, they did. Although it is possible to make the map more detailed further (converting shape files to GeoJson and then SVG). Such map, assuming the current maximum zoom level is kept constant (20000), will create appearance of higher detail even on the smallest regions (i.e. Vatican will look like as if it has as many details as France). Of course, such improvement also increases map storage size, but certainly a balance can be found (+ only certain regions can be "detailized" in contrast to the whole map). Right now this item is low on the priority list.
There are 2 sides to the solution:
It depends. If aforementioned solution with universal zoom animation level is chosen then the red circle is essential for highlighting relatively small regions.
I meant configuration option to enable / disable zooming and moving on back card side map to gain more context (e.g. Zoom in closer on Vatican). But, actually, never mind - now that I look at it again it seems like a useless functionality (to be able to enable / disable zooming and moving, currently it is always enabled).
Actually you are right - there is no sense in changing current max zoom level in any way. Only manual setting of zoom animation max level is relevant (e.g. lower for France, higher for Vatican so that when choosing region map animates to appropriate zoom level, predefined for each region).
Agree, though as I mentioned - having universal zoom animation max level will not resolve the issue of relatively small regions, invisible from it. So either red circle or overridden zoom animation max level for such regions is required.
IMO this is the best option at the moment - write down center of circle for those regions that need it. @axelboc
Which one do you mean? (i.e. red circle, zoom animation max level, both) To summarize
|
Otherwise, if in the source CrowdAnki decks a file has only been edited, this won't be synced to other devices. By default, Anki only checks whether it should more expensively check for changes to individual media files if the mtime of the entire media directory has changed. (According to the docs: https://docs.ankiweb.net/syncing.html#media > It will notice when media has been added, removed or replaced in > your media folder, but will not notice if you have made edits to > existing files. However, the mechanism by which it checks for this is via the directory is (currently!) via the mtime of the dir: https://github.com/ankitects/anki/blob/b7cb0c0d0081202586fd2d88541db962819736b3/rslib/src/sync/media/database/client/changetracker.rs#L94 ) Note that this means that every time CrowdAnki imports a deck, with media, Anki will have to perform the more expensive check. The cost of this "second" check was deemed sufficiently high that the current behaviour (of two checks) was (re-)introduced here: ankitects/anki@35cbde6 However, given that importing CrowdAnki decks is not a frequent occurrence (probably less frequent than adding new media files oneself — which also triggers the "second" check), this is a worthwhile change. For background see here: anki-geo/ultimate-geography#638 (comment)
Otherwise, if in the source CrowdAnki decks a file has only been edited, this won't be synced to other devices. By default, Anki only checks whether it should more expensively check for changes to individual media files if the mtime of the entire media directory has changed. (According to the docs: https://docs.ankiweb.net/syncing.html#media > It will notice when media has been added, removed or replaced in > your media folder, but will not notice if you have made edits to > existing files. However, the mechanism by which it checks for this is via the directory is (currently!) via the mtime of the dir: https://github.com/ankitects/anki/blob/b7cb0c0d0081202586fd2d88541db962819736b3/rslib/src/sync/media/database/client/changetracker.rs#L94 ) Note that this means that every time CrowdAnki imports a deck, with media, Anki will have to perform the more expensive check. The cost of this "second" check was deemed sufficiently high that the current behaviour (of two checks) was (re-)introduced here: ankitects/anki@35cbde6 However, given that importing CrowdAnki decks is not a frequent occurrence (probably less frequent than adding new media files oneself — which also triggers the "second" check), this is a worthwhile change. For background see here: anki-geo/ultimate-geography#638 (comment)
Keeping you updated. Region separation (e.g., Corsica and France) turned out to be a burdensome task - needed to migrate to GeoJson map first and only then start isolating regions by their polygons (which is also slow due to it being mostly manual). Hoping to show the results soon. |
Hello everyone. Sorry for the late status update. Currently the change is on pause as I am on my way to graduation which involves a lot of research and overall work. Can't wait to get back to it and some other ideas in UG domain as soon as studying is over! |
First just wanted to say what a wonderful thing this repository is for people that want to raise awareness of the countries and their details in the world!
I have recently upgraded to extended deck version for the sole reason of presence of "Country - Map" note type. But, unfortunately opposite to what I expected, in this type of notes you can't really see the whole map and zoom in on the country as if you have "chosen" it. You only see a general globe.
This led me to looking for a solution and I found one! I edited note type to provide a link to the map with all names and other stuff removed - only land is visible. For example:
Here is the map link that I currently use: https://www.atlist.com/showcase/world-map-with-no-labels
And now I realize that it would be even better to embed this interactive map as iframe into this note type so that it would not even be necessary to open separate browser page for a map and switch to it.
Creating the issue to ask whether it is a good idea. If so I can try to create a PR with the change and we will see whether it is any good.
The text was updated successfully, but these errors were encountered: