Hi Robert,
I did not mean to recalculate the stroke-width. Such procedure can be 
useful only if you have the same scaling for x and for y.

If you have lines and you want to scale the x values by a number A 
and the y values by another number B, by scripting you can just 
multiply the x1 and x2 attributes by A, and the y1 and y2 by B, 
without doing the explicit scaling transformation. This will do the 
required scaling, without affecting the stroke-width.

I hope that this time I am clearer. Cheers, Samy

--- In svg-developers@yahoogroups.com, "robert_muetzelfeldt" 
<[EMAIL PROTECTED]> wrote:
>
> Thanks, Phi and Samy, for your suggestions.
> 
> I'm not sure, Phi, how using a <path> element would help: I'm 
drawing 
> each part of the graph plot with a short <line> element, so already 
> have a lot of control over things.   Yes, Samy, I could use 
scripting 
> to calculate the require stroke-width value for each <line> 
element, 
> but:
> 
> 1. This is a very clunky way to handle something (constant width of 
> rendered line) that really should be possible to specify directly 
in 
> SVG;
> 
> and (even more serious)
> 
> 2. It still doesn't help the case where the user (in my interactive 
> app) comes along subsequently and draws in the same box another 
plot 
> that has (for example) a different maximum Y value.   Shrinking the 
> first plot (with its calculated stroke-width for every line 
segment) 
> then has to be done by using transform="scale(1,0.5)" for example, 
> which again means that all the lines drawn in the first plot will 
> have different thicknesses!   The only alternative is to loop over 
> every single <line> element in the first plot, and re-calculate its 
> stroke-width, which is clearly highly undesirable (to put it 
mildly).
> 
> Is it possible for someone who is familiar with the SVG standard to 
> step in here?   Is it really the case that it is simply not 
possible 
> to specify directly in SVG that each line plotted in the context of 
> different X and Y scaling should be rendered with the same 
> thickness?   When I posted my initial request for help, I could not 
> believe that this was so - I was sure I'd just missed how to do it -
 
> but the work-arounds suggested make it look like this really is the 
> case. 
> 
> Thanks,
> Robert
> 
> --- In svg-developers@yahoogroups.com, "Samuel Dagan" <dagan@> 
> wrote:
> >
> > Hi Robert,
> >    If you use scripting to make the scaling instead of the  
> > transformation, just by changing the values of the coordinates, 
> > according to your request for the scaling, then you have solved 
the 
> > problem.
> >    Cheers, Samy
> > 
> > --- In svg-developers@yahoogroups.com, Phi Tran <ephitran@> wrote:
> > >
> > > I have found the same in many other cases such as the border of 
> the 
> > ellipse
> > > where they are to different in the thickness. "Even it is 1 
pixel 
> > width
> > > border"; The 45 degree are a little thicker/thiner than the 90 
> > degree etc. .
> > > .
> > > 
> > > The way we work-around that problem by not using border at all 
> > (except for
> > > the case of 1 pixel). The rest we make the path element to draw 
> the 
> > border.
> > > In that case we have a "very much"- well controlling over how 
> > the "border"
> > > look a like.
> > > 
> > > Hope it help.
> > > 
> > > Phi
> > > 
> > > On 2/14/06, robert_muetzelfeldt <R.Muetzelfeldt@> wrote:
> > > >
> > > > If you set ....transform="scale(1.0,0.5)"... or any other 
case 
> > where
> > > > the two values for scale() are not the same, then lines with 
> the 
> > same
> > > > stroke-width attribute have different actual widths, 
depending 
> on 
> > the
> > > > angle of the line.   This is the case even if you specify a 
> unit 
> > for
> > > > the stroke-width value (e.g. px, mm, em).  This seems to be an
> > > > accepted 'feature' of SVG (e.g. Kurt Cagle's 'SVG 
Programming', 
> > page
> > > > 187), but if this is really the case then it's quite 
horrendous.
> > > >
> > > > For example: I want to use SVG to draw a graph (in the sense 
of 
> a
> > > > plot of one variable against another: say temperature against
> > > > time).   Naturally, I want to scale the x and y axes into my 
> units
> > > > (degrees and days) using scale(TempScale,TimeScale), so that 
> the x
> > > > and y values for the <line> element are in my units.  This is 
> > fine -
> > > > but (as above) the thickness of the line between two points 
> > depends
> > > > on its angle! - totally unacceptable.
> > > >
> > > > Is there any solution to this problem which allows me to do 
the
> > > > scaling into my own units?
> > > >
> > > > I should point out that even keeping the same units (e.g. px) 
> is 
> > not
> > > > really a solution, since I'm making an interactive 
application, 
> > and
> > > > the user might want to add a second graph in the same box with
> > > > different min or max for the x or y variables, once again 
> > introducing
> > > > differences between the x and y scaling.
> > > >
> > > > Sorry if this is a well-worn issue, but I've not found any 
> > solution,
> > > > and would greatly appreciate one.
>






-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to