Re: Flexible SVG ID Strategy

2018-06-11 Thread John J Foster via 4D_Tech
Hi Tom,

I have looked at a few but thought it might be work. But now I am not so sure. 
It is something I will building on for years so…

Which JS SVG library do you recommend?

I assume I’ll be able to:

Create template objects that can be reused and dynamically updated based upon 
the record they are associated wth?

Thus able to save and restore.

Able to click on any property and dynamically change it using some sort of 
property palette?

Speedy redraw?

Still lots to do so building a strong and flexible foundation paramount.

Thanks for the idea,
John…


> 
> From: Tom DeMeo  <mailto:tde...@walthamsoftware.com>>
> Subject: Re: Flexible SVG ID Strategy
> Date: June 6, 2018 at 1:14:39 PM PDT
> To: 4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>
> 
> 
> Hi John,
> 
> 
> I understand there are cases where you might build an SVG interface using 4D 
> commands instead of using javascript in a web area. But when you want to do 
> drag and drop, that is probably the use case that will most benefit from 
> using javascript. You can use a parent/child technique that works so well in 
> js. Your IDs can just be auto assigned and can relate to the IDs of your 
> associated 4D data.
> 
> 
> 
> Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Flexible SVG ID Strategy

2018-06-06 Thread Tom DeMeo via 4D_Tech
Hi John,


I understand there are cases where you might build an SVG interface using 4D 
commands instead of using javascript in a web area. But when you want to do 
drag and drop, that is probably the use case that will most benefit from using 
javascript. You can use a parent/child technique that works so well in js. Your 
IDs can just be auto assigned and can relate to the IDs of your associated 4D 
data.



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Flexible SVG ID Strategy

2018-06-05 Thread Keisuke Miyako via 4D_Tech
SVG is XML, so you can have as many namespaces as you like.

in all of my SVG editors I define a private namespace,
which contains extended information such as group ID.

it also helps to store transform values (rotate, scale, translate)
as individual attributes in said namespace,
so much easier than to extract via regex or whatever each time.

https://github.com/miyako/4d-widget-svg-area-v3

https://github.com/miyako/4d-widget-svg-area-v2

> 2018/06/06 5:22、John J Foster via 4D_Tech <4d_tech@lists.4d.com> のメール:
> So wondering if anyone has decided on a strategy for managing SVG OD’s and 
> how to best handle moving things around?




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Flexible SVG ID Strategy

2018-06-05 Thread Keith Culotta via 4D_Tech
The easiest way I've found to move the objects in a group is to 
SVG_SET_TRANSFORM_TRANSLATE the group when the mouse is moving.  
Later if you UNGROUP, the translation needs to be spread out over the group's 
children so they don't jump to new locations.

You can use SVG_Get_root_reference in a loop to find the topmost group of the 
clicked object (the last one whose TYPE is not "svg").

Unless an ID needs to be meaningful, I've been letting the 4D SVG Engine set 
the ID (SVG_SET_OPTIONS), or setting the ID to GENERATE UUID.

Keith - CDI

> On Jun 5, 2018, at 3:22 PM, John J Foster via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> {I sent this yesterday & and again earlier today and it never made it 
> through?}
> 
> I am trying to create an interface built using SVG. The svg image will 
> include many different kinds of complex objects. Bu complex I mean that each 
> object is itself a complex object built by SVG and added into the main SVG 
> image.
> 
> I want to be able to identify any part of an image I click on even if it’s 
> part of a group. But I also want to be able to move the object around to 
> different coords in the image.
> 
> I am using SVG_SET_ID (domSvg;”id_name...”) set each part of the objects ID. 
> when I click on them I see the ID and this works great. BUT...
> 
> But when I move an object I want the entire object to move not just the part 
> of it.
> 
> So wondering if anyone has decided on a strategy for managing SVG OD’s and 
> how to best handle moving things around?
> 
> If this doesn’t make sense please ask questions.
> 
> BTW I am running in 4D v16 r6 and will be moving to v17.
> 
> Appreciate,
> John…

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Flexible SVG ID Strategy

2018-06-05 Thread John J Foster via 4D_Tech
Hi All,

{I sent this yesterday & and again earlier today and it never made it through?}

I am trying to create an interface built using SVG. The sag image will include 
many different kinds of complex objects. Bu complex I mean that each object is 
itself a complex object built by SVG and added into the main SVG image.

I want to be able to identify any part of an image I click on even if it’s part 
of a group. But I also want to be able to move the object around to different 
coords in the image.

I am using SVG_SET_ID (domSvg;”id_name...”) set each part of the objects ID. 
when I click on them I see the ID and this works great. BUT...

But when I move an object I want the entire object to move not just the part of 
it.

So wondering if anyone has decided on a strategy for managing SVG OD’s and how 
to best handle moving things around?

If this doesn’t make sense please ask questions.

BTW I am running in 4D v16 r6 and will be moving to v17.

Appreciate,
John…
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**