- From: Rick <graham.rick@gmail.com>
- Date: Tue, 20 Jan 2015 21:41:06 -0500
- To: www-svg@w3.org
---------- Forwarded message ---------- From: Rick <graham.rick@gmail.com> Date: Tue, 20 Jan 2015 21:40:22 -0500 Subject: Re: Alternate ways of referencing To: "Tab Atkins Jr." <jackalmage@gmail.com> I've fooled with dynamically creating dimension objects in script to good effect. If the string functionality is successfully addressed, c:printf() type float formatting could be considered, either inline or alternatively as a higher level CSS property. <text style="format:0.2;"> <tspan>Diameter: </tspan> <tspan content="calc(var(--radius)*2)"/> </text> I don't know if this is addressed in your spec, but I could see very functional declarations becoming quite complex. if it were possible to somehow declare and/or modify --variables on the fly much complexity could be reduced. Nothing elegant comes to mind. On 1/20/15, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > 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 > -- Education is what you get when you read the fine print Experience is what you get when you don't. -- Education is what you get when you read the fine print Experience is what you get when you don't.
Received on Wednesday, 21 January 2015 02:41:42 UTC