473,772 Members | 3,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SVG: attributes relativ to other elements / special anchors ??

Hello,

I want to place two lines relative to another. The problem is, that
these two lines are in different groups.

Is there an possibility to set the x and y values of the second line
with the values of the first line + an offset.

Something like that for example:

<line id="line1" x1="100" y1="100" x2="200" y2="100"/>
<line id="line2" x1="100" y1=line1.x1+100 x2="200" y2=line1.x2+100/>

How can I resvole my problem? Do I have to use javascript, which sets
up the values for the second line??
Another question: Can I set some "certain anchors" in svg? I think
about this problem. There are two lines specified. Each line has an
"anchor". Now I want to set a line between these two anchors. The
advantage of that is, that i can mave the two lines without any
problem. The third line, which connects the two first lines will be
there everytime.

Any tips for that problem??
Thanks,
Pet

Jul 20 '05 #1
1 1288
Hi,

Tempore 15:58:44, die Friday 01 July 2005 AD, hinc in foro {comp.text.xml} scripsit Peter Jakobi <Pe****@yahoo.c om>:
Is there an possibility to set the x and y values of the second line
with the values of the first line + an offset.

<line id="line1" x1="100" y1="100" x2="200" y2="100"/>
<line id="line2" x1="100" y1=line1.x1+100 x2="200" y2=line1.x2+100/>
why not use the 'use' element for this purpose?
e.g. <use xlink:href="#li ne1" x="100" y="100"/>
Do I have to use javascript, which sets up the values for the second line?? You could do that. In Javascript you have control over the complete DOM of your svg file.
Another question: Can I set some "certain anchors" in svg?

I do not think anchor points are (yet) defined in svg.
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Ceterum censeo XML omnibus esse utendum
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6202
by: VladimirVV | last post by:
Hello, Please, help to understand the problem: Let's create in Notepad simplest SVG 1.1 document: <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version = "1.1" width="300" height="250"> <title>Example SVG code</title> <path d="M 10,10 l0,100 100,0 0,-100z"/>
27
3916
by: Mark | last post by:
I'm curious to get feedback regarding the potential SVG has in performing the same functionality as PDF for fixing documents. Thanks. Mark
2
7497
by: MiW | last post by:
Hi I'm making a kind of JavaScript-based library for creating SVG objects/elements. And I hit the wall... Every element (rect, circle etc.) can be created using *.createElement, then *.setAttribute and *.appendChild. Except "image" element. When 'image' element is created like this, it doesn't display anything. When I create that element with the same attributes in SVG code itself, it works perfectly. It works even if I create it with
3
5583
by: Roman Gordin | last post by:
Hi, I use SVG for web-GUI, but found some serious restrictions 8-( When I use HTML (dynamically generated from .php), I may use HTTPRequest object to provide dynamically regeneration some part of my HTML (from JavaScript). But can`t dynamically refresh SVG, becouse SVG support only ECMAScript This old ECMAScript specification do not support HTTPRequest object and I can`t refresh data in my object dynamically (data for my objects...
61
4755
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the important part ... also work with backgrounds in other tags. I fail to see any wisdom in making SVG different than say PNG (of course the implementation of the rendering code would obvious be different). --
3
6360
by: SMH | last post by:
Normally an SVG document is loaded/parsed/interpreted inside an HTML document using an 'object' (or 'embed') element, although there are supposedly other ways too. The problem is, the SVG document must be static this way. I want to use the DOM interface to build SVG dynamically inside an HTML document. I am guessing I can build it inside HTML within an 'object' (or maybe 'iframe'?) element. My intentions/goals:
7
3073
by: C.W.Holeman II | last post by:
For info on the context of my question see the end of this posting. From http://www.w3.org/TR/XHTMLplusMathMLplusSVG/: How can I validate the result of client-side XSLT transform which has the following? <xsl:output method="xml"
0
1655
by: Holger Jeromin | last post by:
Hello, Note: this is a IE 6,7 and 8b1 only html example, my problem does not appear in other browsers with native svg support. For them i have a working valid "XHTML 1.1 plus MathML 2.0 plus SVG 1.1" Version :-) I have an svg element embedded into a html. Sadly the global definition in <svg:style type="text/css"is not overwritten by the special style attributes of the circle and polyline elements:
2
4975
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, I've a xml svg file and I would like to update it with Python. First, I would like to fetch one dom node with getElementByID. I've one issue about this method. This is my example : My SVG file :
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.