Improved SVG behaviour

What high-level problem are you trying to solve?
This is a long one, sorry!

Documenting various inconsistent & unexpected behaviours that are preventing full use of SVG benefits. Some issues may be due to SVG XML that I'm unaware of.

  • The selected ID(s) in Enketo are not shown on screen vs Collect which has a comma delimited list of selection(s) at the bottom. ID will show above SVG when mouseovered in Enketo. Unsure of plan for webforms. If using to highlight items with read only would need to include a note as well.
  • SVG selected ID(s) colour in Collect (orange) is different to Enketo (light blue) and unsure of plan for webforms. Consistent colour across platforms would be good to allow using contrasting colours so choice is clear
  • Line segments select/fill strangely (SVG type related?)
    • Select the right angle line - closed polygon of vertices highlights
      • non optimised SVG selects the line only in Enketo but not Collect, once selected the polygon region can be used to deselect even if not filled
    • If there is any fill, even transparent, for the item in the SVG, anywhere in the polygon of vertices can be used to select
    • If there is no fill, only the stroke outline can be used to select, but the polygon of vertices will still all fill on select, then once selected anywhere in the stroke and fill can be used to deselect.
  • Deselecting items in Collect leaves them as pure black, not prior colour, Enketo returns to original colour. Changing screens and returning removes the black fill
    • documented elsewhere
    • Example SVGs were created in Inkscape, can be resolved by saving as optimised SVG, options at bottom of post
  • Objects can't be selected in Enketo but Paths can. Both can be selected in Collect. Unsure of plan for webforms
    • documented elsewhere
    • Can convert objects to paths if needed for Enketo.
    • Try to select the red rectangles or the green rectangle in Enketo - cannot
  • In Collect, portrait and landscape SVGs displayed via appearance image-map have different display areas depending on device screen size and orientation.
    • Enketo
      • Both take up full width of form area on screen. No ability to zoom SVG within this. Zooming screen (ctrl/cmd +) beyond 150% stops increasing size of SVG. Zooming screen with trackpad pinch will zoom much further.
    • Collect - 6" handset
      • portrait SVG, portait device: takes up most of width, inside a portrait rectangle
      • portrait SVG, landscape device: takes up ~3/4 width, inside an extremely wide rectangle, can only see 1/4 of image at once, less when zoomed to full width
      • landscape SVG, portrait device: takes up full width, inside a portrait rectangle so some area is unused until zoomed
      • landscape SVG, landscape device: takes up full width, inside an extremely wide rectangle, can only see 1/3 of image at once
    • Collect - 12" tablet
      • portrait SVG, portait device: takes all width, inside a ~square
      • portrait SVG, landscape device: takes up ~2/3 width, inside a very wide rectangle, can only see 1/2 of image at once, less when zoomed to full width
      • landscape SVG, portrait device: takes up full width, inside a ~square so area is unused until zoomed
      • landscape SVG, landscape device: takes up most of width inside a wide rectangle, can only see about 2/3 of image at once
  • A read only SVG select with image-map and no selections will not show the SVG in Collect (will show in Enketo)
  • Where IDs on an SVG are pre-selected to show for information, with read_only set, the SVG cannot be zoomed for detail or panned, combined with the display issues above parts of the SVG are unable to be seen at all.
    • Large device screens will make this worse - 12": portrait image on portait device cuts off bottom 1/3, landscape image on landscape device cuts off bottom 1/2, portrait image on landscape device cuts off bottom 2/3, landscape image on portrait device can see all of image.
  • An SVG with no background fill will be drawn on a white canvas as image-map even in dark mode but in dark mode as an image for a note it will be drawn on a black canvas, obscuring black elements
    • minor issue that can be solved with a background in the SVG
  • An SVG displayed as an image against a note or other question type cannot be zoomed or panned. It would be beneficial to be able to zoom/pan these
    • Option is to have an image-map select that has no valid IDs
  • Using an SVG as a big-image will only work if there is an app that can open them, these apps will likely not open rasters.
    • No need for this if a basic method of zoom-pan available
    • Enketo will enlarge but as before, cmd-ctrl +/- does nothing to change SVG size, pinch to zoom does zoom in
  • SVGZ support - Some of my SVGs are multiple megabytes in size. if they are SVGZ they can go down to ~150kb. Putting filename.svgz as the image does validate, Central asks for the svgz file, but Enketo says 'SVG image could not be found' and Collect 'SVG file does not exist'
    • If SVGZ support was added SVG storage volume would decrease by 10-20x
  • SVGs cannot be loaded to image widgets (not really an issue, just here for completeness)

Any ideas on how ODK could help you solve it?

Biggest issue is likely read-only preselects not being able to zoom on a small screen or even see the whole image on a large screen.
Having consistent selected colours for Collect and webforms would allow highest contrast between selectable and selected. Currently the two colours are complementary so maximising contrast in one minimises it in the other.
Nice to haves are being able to select a snaking line without it causing the strange fill effects and saving file size for sync.

These are the optimise settings that fixed deselect going black in Collect, haven't identified the exact option that fixes it, but filesize went down by 50% in the process.

Upload any helpful links, sketches, and videos.

SVG_issues.xlsx (580.3 KB)

SVG.zip (7.3 KB)

3 Likes

This one has a recent issue filed by @Xiphware

2 Likes

Some other behaviour quirks - I've never seen the outline in Enketo before for group selection, or been able to mouseover/select an object in Enketo.

My ideal fix here would be if you could select a group in Collect and see the change on the SVG, not just the text at bottom. The use case is where there are multiple instances of the same item/string/ID on my drawing in different areas that can't be wrapped in a single path/object, so being able to highlight or select any of them and have all toggle / visually change.

The ability to select items inside groups as well as the group is potentially useful but a difficult UI without leveraging a separate non SVG choice list with linked triggers to keep selections in sync so I think less useful.


Varying behaviour seen for objects/paths, stroke/nostroke, elements/groups, Enketo/Collect (behaviour may change with how SVG is authored/optimised);

  • If you group path elements with no outline together and use the group ID in your choice list
    • these are selectable in Enketo and a blue border appears around each element and the fill doesn't change like it does for selecting single paths.
      • reference to paths and groups being selectable in Enketo feature announcement: As far as we know, any SVG image could be used to make certain “paths” (<path>) or “groups” (<g>) clickable, but there may very well be surprises for some complex images.
    • these are selectable in Collect but there is no visual indication, only the 'Selected' text at the bottom.
  • If you group object elements with no outline together and use the group ID in your choice list
  • If you include the ID of an object element that is in a group in your choice list as well
    • It is selectable in Enketo (again, objects not usually able to be selected) but with no visible change
    • It is selectable in Collect, and will select the object and change fill colour, as well as selecting the group, with no visible indication for the group
  • If you include the ID of an path element that is in a group in your choice list as well
    • It is selectable in Enketo and the fill changes, but doesn't select the group. Selecting a different element in the group selects the entire group and an outline appears on all (so selecting the group and the group sub item will indicate with fill and outline change)
    • It is selectable in Collect, and will select the object and change colour, as well as selecting the group, with no visible indication, as above for object
  • If you add stroke styling (all previous were fill only) to path elements and group these
    • In Enketo the ID appears on mouseover / can be selected, but the blue outline does not appear anymore.
    • In Collect, they can be selected, but the fill doesn't change

Also noticed in Collect - if there is a select (columns) linked (each has a triggered calculation to the other) to a select (image-map), changing the select-columns question will reset the zoom/pan of the SVG in the select-image-map - like it's redrawing it with the selected item(s), but selecting on the SVG in a zoomed/panned state doesn't cause a reset of the drawing.

Thank you for documenting all of your observations. I’ve been thinking about how we might improve the user experience for Collect, as we think about implementing it for Web Forms. I’m not sure when this will happen in the priorities of things, but know that it’s on our radar!

1 Like

I think I’m running into some of the path element issues in Enketo. I think I’m nearly done creating a python script that does this effectively for all regional data from this post, but I’m not sure what the actual “proper” XML formatting is to achieve the behavior where subregions on a map get highlighted and the name displayed as you hover over them?

I saw on your other post

Here is my sample data where only the paths (which are VERY THIN) activate a highlight. Delete the other rows in the survey except row 26

svg_example data only row 26.zip (77.6 KB)

I have an SVG that works and this is one of the elements

Is this putting a path inside a group the current best way SVGs should be used to get the expected behavior of highlighting the entire polygon?

Use the SVG in the Zip below to see that only the paths get highlighted even though Enketo displays the name of the region as you hover over inside the polygon it doesn’t highlight the polygon.

SVG Highlights outer boundary paths, not inside.zip (24.9 KB)

Wow…so I’m definitely coming up with some very unexpected behavior and none of it is what I would assume would be fully “normal”

@Aly_Blenkin @ahblake check out these different questions on Enketo and the associated Google Sheet

Enketo Form on Central

Google Sheet XLSForm

File attachments

With regards to this testing form, question 8 would be closest to what I would expect, BUT, it would also fill the region when the mouse drags over like question 3 and 5 do. Is it possible for Enketo to do that? Has this been looked at in Web Forms as all? If not, feel free to download the XLSForm and File Attachments.

I was trying to find examples online of the behavior that I would expect…this is as close as I got
but the color of the region should stay changed once selected, preferably a different shade of the color that it uses when mouse hovers over.

We need an SVG working group :smiley:
I'm about to run into some scaling issues where dynamic SVGs against a select and compatibility with SVGZ will become a necessity for me.

Try the attached form and svg - it has a bunch of examples. You'll see that this one goes black on deselect in Collect, replace the SVG with the _opt.svg version to fix.

Also in Collect, where you are able to select group plus group contents, for select multiple, tapping different order on group items allows you to select the inner item and outer group, then modify that to just inners or different combos of outer and inner. This one is really wild but I think it's logical as each tap on a group item toggles both the item and its group, but you wouldn't want to let this loose in a form!
eg

  • tap path1 - result: [path1, grp2] (makes sense as both the path1 and group2 were tapped),
  • then tap path2 - result [path1, path2] (makes sense as both path2 (select) and group2 (deselect) were tapped),
  • then tap path 3 - result [path1, path2, path3, grp2] (makes sense as path3 has been selected and group2 reselected)

For select_one, the group takes precedence over the path/object so you can only select the entire group.

mouseover/click/Collect select change intensity depends on your fill opacity and alpha values. colour itself is hardcoded into Collect (orange) and Enketo (blue) but could possibly use the 'highlight' colour as specified in the SVG in future.

I realised what makes Enketo show outlines on select for grouped paths/objects - you have to leave the stroke paint as undefined. Any stroke paint, including 'none' will prevent the outline appearing on select.

  • a path OR object with undefined stroke paint inside a group will show a blue outline in enketo when the group is selected via a path inside it (i.e. you can mouseover highlight but can't select a group via an object inside it).
    • eg obj6/path14 in grp7 (1mm stroke style width, undefined stroke paint) or path11/12/13 in grp6 (0.6mm stroke style width, undefined stroke paint) will show outlines after clicking on a path.
  • the stroke style width is respected by Enketo, compare undefined stroke paint in grp 7 (which has 1mm outlines) to grp8 (5mm outlines)

Enketo object behaviour:

  • A standalone object cannot be mouseovered or selected,
  • a group comprised of only objects can be mouseovered but cannot be selected,
  • a group comprised of objects and paths can be mouseovered on either but only selected on the path,
  • a group comprised of objects / paths / objects & paths where the id of the group and of the objects & paths are in the choice list will
    • show the group id on object mouseover
    • show the path id on path mouseover
    • select the object on object click, no change to fill or outline appearance
    • select the path on path click, fill and outline changes appearance

So to have selectable non-contiguous areas that change appearance, I think the answer is:

  • you need a group of paths, and
  • they need fill with non zero opacity/alpha to change colour in Collect, and
  • they need an undefined stroke paint with a non zero stroke style width to show outline in Enketo, and
  • the select name value = the group id, and
  • the path ids are not in the select list or you will get unexpected values with select-multiple

objectpathgroup.xlsx (582.9 KB)
SVGs.zip (4.4 KB)

1 Like

Does this deselection turning groups black in Collect have a solution or no? Ideally they’d go back to their original color… Unfortunately, this is what’s currently happening with my SVGs but I did get the other issues figured out.

I don't know the root cause, but do know that generally an 'inkscape' SVG will do it and an 'optimised' SVG export from Inkscape won't. You can see an example of both files in the post above and compare the XML.

@ahblake, I found the culprit in the XML… Check out line 2 in this attached file which is correct. Can you look at your XML and see if this is where yours go wrong?

GIN_adm0.svg.zip (17.5 KB)

BAD (IE TURNS BLACK ON REMOVE RESPONSE IN COLLECT)

<g id="Guinea" style="fill:#9bbefc;stroke:#000000;stroke-width:0.5;stroke-linejoin:bevel">

Good - Goes back to original Color on Remove Response in Collect

<g id="Guinea" fill="#9bbefc" stroke="#000000" stroke-linejoin="bevel" stroke-width=".5">
<g id="Guinea" fill="#9bbefc" stroke="#000000" stroke-width=".5">

Note that both of these display fine in file previews, using Enketo and Collect, but for some reason the unselect/selecting a different area turns the selection black in Collect. Maybe this specific formatting issue needs to be mentioned in the Docs? Or fixed so they both work?

@Aly_Blenkin I think having a note in the docs with another XML code block from a simple SVG with an example .SVG would be helpful for folks to troubleshoot/see more details of the XML code that is good vs whatever users are currently working with. In troubleshooting the SVG, I was starting with about half a dozen issues to deal with before figuring out what the primary problem was/wasn’t. Ultimately, the thing that is quite unclear from the documentation is for something like a state/department map of a country, you have to make the state name the group name and then the path ID strings are irrelevant, but MUST all be nested under that group with the id string that’s in the choice list. This was confusing for me because I thought the issue may have been multiple paths in the same group, IE coastal areas where there will be a lot of islands, vs an interior state that is just a single path, but STILL needs to be contained/nested within a group with an id from the choice list. Here is an excerpt from one of my SVGs that shows this:

<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="746">
<g id="GIN_adm1_boke" fill="#9bbefc" stroke="#000000" stroke-width=".5">
  <path id="GIN_adm1_boke-path1" d="M 181,382 L 175,387 L 173,391 L 172,391 L 172,390 L 172,391 L 170,391 L 170,389 L 171,389 L 170,388 L 181,382 Z"/>
  <path id="GIN_adm1_boke-path2" d="M 185,374 L 186,377 L 184,378 L 184,376 L 185,374 Z"/>
  <path id="GIN_adm1_boke-path3" d="M 151,364 L 151,364 L 151,365 L 151,364 Z"/>
  <path id="GIN_adm1_boke-path4" d="M 153,362 L 153,362 L 152,362 L 153,362 Z"/>
<g id="GIN_adm1_faranah" fill="#9bbefc" stroke="#000000" stroke-width=".5">
  <path id="GIN_adm1_faranah-path1" d="M 634,65 L 638,65 L 640,69 L 642,66 L 644,66 L 646,65 L 647,67 L 653,67 L 655,69 L 660,71 L 668,70 L 664,74 L 654,79 L 650,84 L 654,91 L 656,99 L 658,104 L 657,105 L 654,107 L 655,113 L 651,116 L 652,119 L 647,125 L 647,127 L 650,128 L 650,129 L 649,131 L 649,134 L 645,137 L 644,150 L 647,152 L 650,157 L 657,158 L 660,159 L 662,162 L 666,162 L 676,165 L 678,167 L 679,174 L 677,173 L 673,176 L 674,179 L 670,182 L 669,182 L 671,179 L 671,176 L 669,179 L 664,177 L 662,180 L 663,183 L 659,183 L 658,182 L 659,177 L 655,179 L 654,174 L 653,175 L 650,175 L 650,174 L 647,172 L 645,173 L 647,175 L 644,176 L 641,174 L 639,178 L 640,179 L 637,180 L 635,179 L 638,175 L 637,171 L 635,176 L 634,174 L 633,175 L 632,179 L 634,180 L 629,187 L 616,190 L 617,193 L 621,196 L 611,204 L 608,205 L 601,205 L 594,203 L 595,206 L 591,205 L 591,209 L 586,209 L 584,211 L 583,212 L 584,217 L 584,222 L 581,223 L 579,227 L 576,228 L 573,231 L 573,236 L 570,239 L 571,240 L 563,243 L 562,245 L 559,245 L 558,247 L 559,249 L 565,250 L 569,254 L 569,254 L 574,256 L 580,257 L 583,259 L 585,259 L 590,266 L 600,265 L 601,266 L 606,263 L 612,262 L 615,273 L 618,279 L 621,289 L 617,292 L 617,294 L 624,296 L 627,292 L 628,294 L 630,292 L 633,294 L 632,296 L 635,296 L 636,294 L 639,293 L 640,291 L 641,295 L 643,295 L 648,295 L 651,294 L 652,295 L 649,296 L 648,300 L 652,300 L 655,305 L 656,305 L 654,303 L 656,302 L 656,299 L 658,300 L 660,299 L 661,293 L 662,293 L 663,296 L 662,298 L 666,299 L 664,300 L 664,303 L 663,304 L 660,303 L 660,304 L 661,308 L 663,309 L 662,311 L 660,311 L 660,312 L 659,315 L 660,318 L 658,318 L 658,320 L 654,322 L 651,320 L 648,320 L 650,324 L 648,327 L 650,326 L 650,327 L 648,331 L 653,338 L 651,341 L 648,342 L 650,345 L 646,345 L 646,347 L 645,349 L 643,349 L 641,352 L 640,353 L 637,352 L 637,360 L 632,366 L 634,370 L 637,380 L 633,384 L 631,384 L 630,386 L 631,395 L 629,396 L 628,398 L 626,398 L 625,402 L 625,406 L 626,406 L 626,415 L 623,420 L 625,425 L 627,424 L 630,427 L 634,428 L 637,427 L 643,428 L 651,420 L 651,419 L 656,413 L 659,406 L 663,407 L 667,411 L 667,415 L 672,419 L 680,412 L 684,411 L 690,412 L 698,418 L 696,421 L 704,430 L 728,438 L 735,453 L 728,460 L 728,467 L 727,468 L 724,468 L 719,469 L 716,471 L 715,474 L 719,479 L 719,483 L 727,485 L 727,487 L 719,491 L 719,493 L 722,497 L 728,498 L 731,502 L 731,508 L 728,510 L 733,518 L 728,516 L 723,516 L 721,518 L 716,518 L 713,516 L 708,519 L 707,522 L 699,523 L 697,522 L 695,522 L 693,525 L 690,526 L 689,526 L 687,527 L 687,526 L 685,527 L 683,526 L 681,516 L 682,509 L 681,508 L 679,509 L 679,513 L 677,516 L 673,517 L 671,519 L 667,517 L 667,511 L 664,511 L 659,517 L 656,517 L 656,513 L 653,512 L 651,508 L 644,507 L 643,505 L 642,505 L 643,503 L 643,497 L 639,492 L 636,493 L 635,498 L 630,502 L 618,504 L 618,502 L 618,500 L 623,495 L 623,493 L 620,489 L 620,486 L 617,492 L 606,492 L 603,494 L 602,493 L 600,494 L 592,490 L 582,491 L 583,484 L 584,482 L 583,476 L 584,475 L 587,475 L 591,473 L 590,467 L 591,461 L 585,456 L 585,454 L 582,450 L 581,451 L 580,449 L 577,450 L 573,448 L 571,450 L 571,449 L 573,445 L 566,440 L 567,437 L 566,434 L 569,431 L 563,428 L 565,426 L 558,420 L 556,413 L 551,411 L 549,405 L 541,393 L 533,386 L 525,382 L 522,369 L 518,366 L 482,366 L 483,358 L 487,354 L 488,350 L 491,346 L 492,341 L 493,333 L 495,331 L 495,320 L 492,304 L 486,303 L 477,299 L 475,299 L 477,290 L 476,288 L 477,288 L 477,283 L 480,283 L 481,279 L 481,275 L 485,270 L 485,267 L 484,266 L 486,262 L 485,257 L 487,253 L 479,246 L 476,247 L 475,243 L 477,237 L 485,231 L 494,234 L 499,234 L 509,232 L 515,228 L 525,223 L 528,220 L 518,217 L 515,214 L 512,210 L 509,211 L 504,206 L 500,194 L 500,188 L 510,175 L 516,173 L 521,173 L 529,165 L 528,162 L 530,162 L 529,160 L 523,157 L 520,158 L 517,152 L 518,150 L 524,148 L 527,145 L 526,143 L 524,142 L 527,137 L 532,136 L 534,134 L 536,129 L 536,114 L 540,110 L 535,109 L 532,105 L 528,105 L 525,102 L 525,93 L 524,90 L 527,86 L 527,82 L 532,81 L 532,78 L 536,76 L 540,65 L 544,67 L 548,66 L 550,65 L 555,64 L 558,66 L 559,67 L 561,67 L 562,73 L 567,77 L 574,80 L 575,86 L 573,89 L 578,95 L 580,100 L 579,102 L 582,106 L 584,106 L 587,109 L 590,109 L 594,106 L 594,104 L 598,98 L 599,98 L 604,95 L 602,92 L 608,90 L 610,89 L 610,84 L 612,83 L 610,79 L 612,78 L 619,78 L 624,75 L 625,71 L 627,71 L 630,72 L 631,71 L 632,68 L 635,69 L 635,67 L 634,65 Z"/>
</g>
<g id="GIN_adm1_kankan" fill="#9bbefc" stroke="#000000" stroke-width=".5">
  <path id="GIN_adm1_kankan-path1" d="M 776,27 L 792,28 L 801,34 L 807,36 L 809,38 L 812,42 L 817,46 L 818,50 L 815,56 L 814,64 L 816,65 L 816,69 L 821,68 L 821,67 L 823,67 L 823,68 L 824,69 L 827,73 L 826,80 L 824,81 L 824,86 L 825,88 L 827,88 L 830,90 L 832,88 L 835,88 L 839,93 L 838,97 L 840,104 L 833,144 L 837,144 L 840,146 L 842,145 L 845,147 L 849,144 L 855,143 L 856,144 L 855,151 L 857,152 L 860,161 L 865,168 L 868,167 L 870,169 L 876,164 L 878,169 L 877,170 L 879,172 L 880,175 L 886,177 L 894,177 L 897,179 L 892,180 L 891,183 L 894,185 L 899,185 L 897,191 L 891,192 L 883,190 L 881,193 L 882,199 L 872,201 L 871,204 L 872,208 L 871,210 L 870,212 L 866,212 L 864,213 L 865,217 L 861,220 L 861,224 L 857,228 L 857,235 L 859,236 L 865,234 L 869,236 L 876,232 L 879,233 L 880,225 L 884,220 L 891,219 L 894,220 L 897,218 L 901,219 L 905,222 L 909,229 L 909,233 L 911,239 L 911,249 L 910,251 L 907,253 L 904,261 L 909,262 L 907,267 L 909,271 L 908,278 L 910,284 L 912,286 L 911,294 L 913,296 L 913,300 L 916,301 L 918,309 L 925,310 L 930,307 L 932,307 L 933,311 L 936,315 L 949,318 L 953,321 L 956,331 L 955,335 L 952,340 L 947,351 L 943,354 L 935,358 L 931,363 L 931,365 L 929,366 L 931,368 L 933,367 L 933,370 L 927,371 L 929,373 L 927,374 L 928,376 L 931,375 L 933,378 L 932,380 L 930,380 L 930,382 L 934,382 L 934,386 L 936,387 L 935,390 L 933,390 L 935,391 L 933,392 L 934,396 L 932,397 L 933,404 L 931,406 L 932,409 L 931,409 L 932,411 L 932,413 L 929,415 L 930,417 L 929,420 L 930,420 L 903,422 L 898,423 L 892,428 L 885,427 L 884,427 L 885,431 L 884,434 L 881,433 L 879,436 L 878,435 L 876,435 L 876,440 L 872,441 L 871,439 L 869,438 L 868,434 L 867,432 L 867,433 L 865,438 L 867,459 L 864,461 L 864,467 L 861,471 L 861,475 L 855,482 L 853,491 L 853,495 L 857,502 L 857,505 L 854,508 L 844,512 L 841,516 L 839,521 L 823,532 L 815,528 L 808,528 L 794,533 L 790,533 L 782,530 L 773,521 L 762,515 L 758,515 L 744,519 L 733,518 L 728,510 L 731,508 L 731,502 L 728,498 L 722,497 L 719,493 L 719,491 L 727,487 L 727,485 L 719,483 L 719,479 L 715,474 L 716,471 L 719,469 L 724,468 L 727,468 L 728,467 L 728,460 L 735,453 L 728,438 L 704,430 L 696,421 L 698,418 L 690,412 L 684,411 L 680,412 L 672,419 L 667,415 L 667,411 L 663,407 L 659,406 L 656,413 L 651,419 L 651,420 L 643,428 L 637,427 L 634,428 L 630,427 L 627,424 L 625,425 L 623,420 L 626,415 L 626,406 L 625,406 L 625,402 L 626,398 L 628,398 L 629,396 L 631,395 L 630,386 L 631,384 L 633,384 L 637,380 L 634,370 L 632,366 L 637,360 L 637,352 L 640,353 L 641,352 L 643,349 L 645,349 L 646,347 L 646,345 L 650,345 L 648,342 L 651,341 L 653,338 L 648,331 L 650,327 L 650,326 L 648,327 L 650,324 L 648,320 L 651,320 L 654,322 L 658,320 L 658,318 L 660,318 L 659,315 L 660,312 L 660,311 L 662,311 L 663,309 L 661,308 L 660,304 L 660,303 L 663,304 L 664,303 L 664,300 L 666,299 L 662,298 L 663,296 L 662,293 L 661,293 L 660,299 L 658,300 L 656,299 L 656,302 L 654,303 L 656,305 L 655,305 L 652,300 L 648,300 L 649,296 L 652,295 L 651,294 L 648,295 L 643,295 L 641,295 L 640,291 L 639,293 L 636,294 L 635,296 L 632,296 L 633,294 L 630,292 L 628,294 L 627,292 L 624,296 L 617,294 L 617,292 L 621,289 L 618,279 L 615,273 L 612,262 L 606,263 L 601,266 L 600,265 L 590,266 L 585,259 L 583,259 L 580,257 L 574,256 L 569,254 L 569,254 L 565,250 L 559,249 L 558,247 L 559,245 L 562,245 L 563,243 L 571,240 L 570,239 L 573,236 L 573,231 L 576,228 L 579,227 L 581,223 L 584,222 L 584,217 L 583,212 L 584,211 L 586,209 L 591,209 L 591,205 L 595,206 L 594,203 L 601,205 L 608,205 L 611,204 L 621,196 L 617,193 L 616,190 L 629,187 L 634,180 L 632,179 L 633,175 L 634,174 L 635,176 L 637,171 L 638,175 L 635,179 L 637,180 L 640,179 L 639,178 L 641,174 L 644,176 L 647,175 L 645,173 L 647,172 L 650,174 L 650,175 L 653,175 L 654,174 L 655,179 L 659,177 L 658,182 L 659,183 L 663,183 L 662,180 L 664,177 L 669,179 L 671,176 L 671,179 L 669,182 L 670,182 L 674,179 L 673,176 L 677,173 L 679,174 L 678,167 L 676,165 L 666,162 L 662,162 L 660,159 L 657,158 L 650,157 L 647,152 L 644,150 L 645,137 L 649,134 L 649,131 L 650,129 L 650,128 L 647,127 L 647,125 L 652,119 L 651,116 L 655,113 L 654,107 L 657,105 L 658,104 L 656,99 L 654,91 L 650,84 L 652,81 L 657,77 L 664,74 L 668,70 L 670,76 L 672,74 L 676,77 L 679,77 L 683,81 L 686,80 L 687,81 L 691,81 L 695,87 L 705,87 L 710,90 L 720,91 L 720,86 L 723,84 L 722,77 L 729,71 L 741,68 L 749,61 L 757,59 L 759,60 L 761,59 L 767,61 L 767,58 L 770,57 L 770,51 L 772,50 L 772,47 L 773,45 L 768,43 L 767,40 L 765,39 L 765,37 L 763,37 L 761,33 L 759,34 L 759,31 L 763,30 L 764,27 L 767,27 L 768,29 L 770,26 L 775,29 L 776,27 Z"/>
</g>

My assumption is that different software export things differently under the hood and without looking at the raw XML of the SVG file that you’ve exported, it’s hard to say what will (not) work.

Here are some example map SVGs that are admin levels of Guinea

Archive.zip (69.8 KB)

Below you can copy and paste into your XLSForm

Column 1 Column 2 Column 3 D E F G
type name label::English(en) appearance image::English (en) image::Français (fr) image::Konyanka (mku)
select_one_from_file GIN_adm0.csv s_from_file_adm0.csv s_from_file_adm0.csv - select_one_from_file GIN_adm0.csv - image-map image-map GIN_adm0.svg GIN_adm0.svg GIN_adm0.svg
note n_s_from_file_adm0.csv Note: ${s_from_file_adm0.csv} has been selected
select_multiple_from_file GIN_adm1.csv s_from_file_adm1.csv s_from_file_adm1.csv - select_multiple_from_file GIN_adm1.csv - image-map image-map GIN_adm1.svg GIN_adm1.svg GIN_adm1.svg
note n_s_from_file_adm1.csv Note: ${s_from_file_adm1.csv} has been selected
select_multiple_from_file GIN_adm2.csv s_from_file_adm2.csv s_from_file_adm2.csv - select_multiple_from_file GIN_adm2.csv - image-map image-map GIN_adm2.svg GIN_adm2.svg GIN_adm2.svg
note n_s_from_file_adm2.csv Note: ${s_from_file_adm2.csv} has been selected
select_multiple_from_file GIN_adm3.csv s_from_file_adm3.csv s_from_file_adm3.csv - select_multiple_from_file GIN_adm3.csv - image-map image-map GIN_adm3.svg GIN_adm3.svg GIN_adm3.svg
note n_s_from_file_adm3.csv Note: ${s_from_file_adm3.csv} has been selected

That agrees with mine by the looks.

Here's path4 from the demo above, it does have the ; delimited string.

<path
       id="path4"
       style="fill:#50b452;stroke:#fe33fe;stroke-width:0.5;stroke-linejoin:bevel"
       d="M 107.5672,224.04493 A 15.325908,14.529757 0 0 1 92.241297,238.57468 15.325908,14.529757 0 0 1 76.915389,224.04493 15.325908,14.529757 0 0 1 92.241297,209.51517 15.325908,14.529757 0 0 1 107.5672,224.04493 Z" />

and path4 optimised (inkscape grouped it with a similarly coloured obj4, but the group doesn't have the ; delimited style)

<g fill="#50b452" stroke="#fe33fe" stroke-linejoin="bevel">
   <ellipse id="obj4" cx="33.76" cy="223.2" rx="15.326" ry="14.53" stroke-width=".5"/>
   <path id="path4" d="m107.57 224.04a15.326 14.53 0 0 1-15.326 14.53 15.326 14.53 0 0 1-15.326-14.53 15.326 14.53 0 0 1 15.326-14.53 15.326 14.53 0 0 1 15.326 14.53z" stroke-width=".5"/>
   <text id="text3744" x="94.741974" y="229.68956" font-family="sans-serif" font-size="9.8778px" stroke-width=".5" xml:space="preserve"><tspan id="tspan3742" stroke-width=".5"/></text>
  </g>

It's a bit different for grouped items, but the same holds, here's obj1 from my demo above

<g
       id="grp1"
       style="stroke-width:0.5;stroke-dasharray:none"
       transform="matrix(0.63860118,0,0,0.62492747,7.4821668,-12.529511)">
      <rect
         style="fill:#ffff00;stroke:#fe33fe;stroke-width:0.5;stroke-linejoin:bevel;stroke-dasharray:none"
         id="obj1"
         width="47.708073"
         height="41.925274"
         x="20.962637"
         y="29.636833" />
    <SNIP obj2 & obj3>
    </g>

And here's obj1 optimised

<g id="grp1" transform="matrix(.6386 0 0 .62493 7.4822 -12.53)" fill="#ff0" stroke="#fe33fe" stroke-linejoin="bevel" stroke-width=".5">
   <rect id="obj1" x="20.963" y="29.637" width="47.708" height="41.925"/>
   <rect id="obj2" x="82.405" y="29.637" width="43.371" height="41.202"/>
   <rect id="obj3" x="138.06" y="28.914" width="41.925" height="41.202"/>
  </g>
1 Like