Skip to content
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

Proposal: image-map select question #108

Closed
MartijnR opened this issue Apr 20, 2017 · 5 comments
Closed

Proposal: image-map select question #108

MartijnR opened this issue Apr 20, 2017 · 5 comments

Comments

@MartijnR
Copy link
Contributor

MartijnR commented Apr 20, 2017

This may or may not belong in this spec, depending on the outcome. Our (KoBo/Enketo) proposal is to spec-wise only add an appearance "image-map" to select_one and select_multiple questions with an svg image label.

The use case is to select a region from an image (e.g. a map, or the human body, or anything).

Since this proposal doesn't add any new syntax, it's easiest explained in XLSForm:

screen shot 2017-04-20 at 11 41 25 am

The fallback shows the select_one / select_multiple question with the map as a label.

The feature would:

  • not render the regular select control,
  • match values in the options with id attributes on <path> elements in the SVG image (edited)
  • make regions in the image with an id/value value match clickable and set/unset values upon click

Not easy to create an SVG image that supports the feature, so that would be a concern for form building tools or advanced users.

Alternative suggestions very welcome! SVG is of course XML, so we could add it as a secondary instance as well, but we haven't been able to figure out how to make this less complex than the above.

@lognaturel
Copy link
Member

lognaturel commented Apr 20, 2017

That's cool, I didn't consider that this could be done with SVG.

With this example, you'd specify a choice list with name nepal_state (instead of just using the id attributes in the SVG) so that you could, for example, provide translations when displaying the label of the picked element, support the fallback behavior and satisfy the requirements of the select_one. Am I getting that right?

And just to double check, when you say id attributes would be matched with "the values in the options", that's the values that are in the name column of the choices sheet?

That seems good to me! This is pretty simple from a user perspective and has a usable fallback so I like it.

Should we start documenting appearances in this spec? I know there's a link to the table from XLSForm but it seems odd not to have a record here of which are "part of the standard." Or perhaps none are, they're just considered client add-ons? W3C XForms documents them so I'd tend to be in favor of doing so as well.

@MartijnR
Copy link
Contributor Author

MartijnR commented Apr 20, 2017

Am I getting that right?

Yes, exactly. And this translated label could e.g. be used as a tooltip when hovering over the image as well.

that's the values that are in the name column of the choices sheet?

Yes, the regular choice list (<itemset> or <item>) describes the available options, and the option will become selectable if a match is found in the image (not the other way around).

Should we start documenting appearances in this spec?

Yes, I agree, we should do this though it's quite a large task and will show what a mess we made... :(.

@lognaturel
Copy link
Member

I'm on board with this and I think it's something we'd be interested in implementing in Collect pretty soon.

Also, eager to find out the magnitude of the appearance mess and to start clean up! Well, maybe "eager" is a bit strong but I think it would be very useful.

@MartijnR
Copy link
Contributor Author

In the XLSForm spec: XLSForm/xlsform.github.io#110

In the XForms spec we refer to XLSForms for anything to do with appearances. However, since this is a special case (involving a label) I think we should add something generic like: "An appearance may also work in conjunction with an image label to substantially alter the appearance and behavior of a form control as is e.g. the case with appearance 'image-map'"

@lognaturel
Copy link
Member

Sounds perfect to me, @MartijnR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants