RE: Alternate ways of referencing

As you are doing this, keep in mind the ways that <replicate> and declarative randomness handle these things. Though only randomness has gained traction in the SVG WG in the past, neither has encountered <b>any substantive</b> argument (though Cyril once said that <replicate> seemed a bit too powerful). This stuff is likely to happen in some future version of SVG, so it makes sense to plan for a future in which something like <replicate> (e.g. <superuse>) and <random> are a part of declarative solutions. (as a use case, please remember than <img src=".."> does not allow scripting and that social media, where humans can actually see SVG -- rather than merely reading about it as an abstraction -- are a rather big source of humanity's access to graphics and animation). Accessibility is good!

Cheers
D

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Tuesday, January 20, 2015 6:53 PM
To: Rick
Cc: www-svg@w3.org
Subject: Re: Alternate ways of referencing

On Tue, Jan 20, 2015 at 3:33 PM, Rick <graham.rick@gmail.com> wrote:
> Functionally this appears to address my example, and many other 
> examples I could conjure.
>
> Particularly interesting is the calc() function.
>
> Would it be possible to use calc() in the same manner as var() or is 
> it restricted to a style?
>
> i.e.
>
> <g style="--width: 6;">
>   <rect width="var(--width)" height="6" />
>   <rect x="var(--width)" width="var(--width)" height="12" />
>   <rect x="calc(var(--width)*2)" width="var(--width)" height="7" /> 
> </g>

Assuming that we properly reference CSS Values & Units for the definition of <length>/etc, then yes, calc() comes for free in places that use <length>, as it's a type of <length>.  ^_^

> Lastly, would it be possible to have the result of a calc() return a 
> displayable text string?  I have no idea how that might be declared.
> (tref?  ;])

The closest we have so far is the 'content' property, though it's unclear how or if that applies to SVG content.  This is a topic that'll be addressed when Doug Shepers and I flesh out the SVG Parameters spec (which'll specify a way to "pass in" variables from a referencing URL, so you can reuse a single SVG and alter the, for example, colors dynamically), as we want the ability to specify text in the same way you'll be able to specify colors/etc.

~TJ

Received on Wednesday, 21 January 2015 01:55:19 UTC