W3C home > Mailing lists > Public > www-svg@w3.org > July 2015

Re: New methods to support interactivity

From: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
Date: Wed, 22 Jul 2015 15:35:50 -0600
Message-ID: <CAFDDJ7wYq7U+7V=8uAfyrXiqsV7YAe5e5Pfjx97GXtKRWYnmkw@mail.gmail.com>
To: Paul LeBeau <paul.lebeau@gmail.com>, www-svg <www-svg@w3.org>
Perhaps we need a reply from the Firefox team explaining why the existing
methods to do this (enclosure/intersection)[1][2] were never implemented?

Can the spec be made more clear? Are there simpler solutions which would
address the problem without performance issues or implementation
difficulties?

I think the other browsers all have implementations, but I've never used
the methods enough (because of the lack of Firefox support) to know whether
they are buggy or not.

~ABR

[1]: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement
[2]: https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSVGElement


On 22 July 2015 at 14:28, Paul LeBeau <paul.lebeau@gmail.com> wrote:

> Sorry. Forget I said anything. I forgot about the enclosure and
> intersection calls on SVGSVGElement.
>
> Paul
>
>
> On 22 July 2015 at 22:40, Paul LeBeau <paul.lebeau@gmail.com> wrote:
>
>> As SVG takes off more and more, I believe there is a need for better ways
>> to interact with documents.  At the moment interaction is pretty limited.
>> We only have mouse in/out events, CSS hover and Document.elementFromPoint().
>>
>> Several times in recent weeks people have asked on StackOverflow for ways
>> to detect which elements are under the pointer.  At the moment, the only
>> way to do that is with elementFromPoint().  But that has limitations.
>>
>> At the moment some simple interactivity tasks are impossible, or require
>> ugly hacks.
>>
>> Another common task is to select lines/edges in a chart.  The best
>> solution we have at the moment is to add invisible fat lines over the top
>> of the real ones.
>>
>> I think it would be nice to add some more methods to enable better
>> interactivity. For example:
>>
>> elementsFromPoint
>>     Get all elements under a point
>>
>> elementsWithinBox
>>     Get all elements that intersect with the given BBox.
>>
>> pointInPath / pointInShape
>>     Return true if a point is within the fill (or stroke?) of a shape
>>
>> etc.
>>
>> Paul
>>
>>
>>
>>
>>
>
Received on Wednesday, 22 July 2015 21:36:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:55:02 UTC