@see http://cgit.drupalcode.org/webform/tree/FEATURE_REQUEST_TEMPLATE.html
Problem/Motivation
To allow users to select a part of a SVG image as a choice/option like states of a country map.
Proposed resolution
I understand there are jQuery /.js options out there for HTML forms.
It would be really useful and efficient to condense form interface for the end users with image based selection and parts of image selection rather text with the almighty webform.
I tried slicing the images in to grid and used the available image selection element with no spaces between them using minor css tweaks it does good job of that for a simple image based form.
However if the image not suitable to be sliced in to a simple grid pattern (e.g. different parts of a body, organ or bone joints) it is not possible with this frontend approach.
Please advise the best way to go forward or kindly direct us in right direction for custom / commercial support etc.
Thanks for the excellent work with this more than a module which opened up the world of possibilities for frontend users like us.
Best regards
Comments
Comment #2
jrockowitz commentedIs this page a good example of how you potentially want to use SVG?
Comment #3
mksamy commentedThanks for the interest to help. Much appreciated.
It seems that extending the image selection element capability will open world of potentials for webform.
Considering that no real form product like your creation has the drupal power and flexibility, we are hoping to use the webform in a more visual way.
If it can be implemented with just css or js injection it will be perfect.
Demos here
shows how multiple radios/dropdown and checkbox elements in layers can be presented in a visual way( especially in vegetable tray and the skeleton joint example when a joint is selected sub options shown to select) and offers click to select and click again to unselect also multi-select.
Inspiration for this feature request is your image select element which works perfectly as it was intended.
The project we are hoping to use this is for survey focused on collecting data at a clinic or street survey setting where a tablet/phone/ desk top screen with the image will be given to old patient passenger on the move or children who would be comfortable selecting parts of an image rather conventional checkboxes and drop downs.
We don’t want to be too specific on this however your guidance will help many of us in huge way.
Best regards
Comment #4
jrockowitz commentedI think the ImageMapster library is outdated and if someone was to re-approach this task today they would use SVG.
I think it would be possible to create an SVG element that works like a select menu by just adding custom attributes to the SVG markup.
The below example adds data-option-* attributes to the SVG element. These attributes could then be parsed via a JavaScript library.
This solution depends on how easy it is to add and manage custom attributes in an SVG graphic. It is also possible that there are SVG authoring tools that generate dynamic SVG graphic with rollover and selection behaviors.
Comment #5
jrockowitz commentedThis needs to handled in separate contrib module.
Comment #6
jrockowitz commentedI am reopening this ticket because I was able to prototype a selectable SVG element.
https://jsfiddle.net/jrockowitz/btakmqed/
Comment #7
jrockowitz commentedEven though I like the demo, I still feel that this should be handled via a separate contrib module.
Comment #8
jrockowitz commentedPeople keep ask me about this features so I am going to reopen this ticket and hope someone sponsors it.
Comment #9
jrockowitz commentedComment #10
Mile3 commentedCreating a Feature Request to sponsor development.
Comment #11
Mile3 commentedhttps://www.drupal.org/project/webform/issues/3081795
Comment #12
jrockowitz commented