Align Shapes by Field

Started by tor, December 13, 2017, 05:24:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tor

Hi friends! I want to align my data-linked shapes in a column based on a data field. Specifically, I have a date for each task I have and I want to vertically align all shapes associated with a date. Is this possible? What are some other options? Can I force them into a certain swimlane?

Thanks!

Thomas Winkel

Hi,

possible, but need to be done with code.
Maybe this topic helps you to get startet:
http://visguy.com/vgforum/index.php?topic=4927.0

Best regards,
Thomas

Yacine

Can't you use the provided time line shapes?
Yacine

vojo

so could try this
Basically use an origin point  and calculate a distance by the difference between this shape data data and some origin date
(you may need to put in some SETFs in the event doublclk cell to update the origin from from page or page legend shape)

prop.starttime = <some sort of start time....a fixed static value...maybe pick up from the page shape>
prop.nowtime = <time for this shape
user.timedelta = prop.nowtime-prop.starttime   // find the delta to global start point
user.delta = user.timedelta * <some sort of increment...maybe 10mm>

pinx = guard (origin + user.delta)   // origin may be from page shape
piny = <same sort of approach as X dimension>

so if shape in stencil
1:  drag on to page
2: double click to get origin updated
     (maybe use on drop event in shape sheet cell for setf(getref(prop.starttime), page!user.starttime))
3: edit properties to
     A) confirm orgin (start date)
     B) set the date for this shape
4: save
5: Shape should move to desired location on page.

Start with a single shape, make sure algorithm works...then can broaden out to other shapes
Also, need to make width and height of shape are know to be less than some max...otherwise shapes could lay on top of each other if too wide

good luck


tor

#4
Thank you! Sorry I didn't respond sooner - I didn't think anyone responded since I didn't get an email. This is great - exactly what I am looking for! Another questions for you...

Can I force a shape to a container or swimlane through coding? Instead of offsetting from another object, just place it at a defined location that is linked to a swimlane?

I am looking through this resource and haven't had much luck. Basically if I name a swimlane a certain date, and that matches the feild value in my shape, then can I constrain that shape to a specific swimlane (or phase)?


Thank you thank you!


Quote from: vojo on December 13, 2017, 08:02:15 PM
so could try this
Basically use an origin point  and calculate a distance by the difference between this shape data data and some origin date
(you may need to put in some SETFs in the event doublclk cell to update the origin from from page or page legend shape)

prop.starttime = <some sort of start time....a fixed static value...maybe pick up from the page shape>
prop.nowtime = <time for this shape
user.timedelta = prop.nowtime-prop.starttime   // find the delta to global start point
user.delta = user.timedelta * <some sort of increment...maybe 10mm>

pinx = guard (origin + user.delta)   // origin may be from page shape
piny = <same sort of approach as X dimension>

so if shape in stencil
1:  drag on to page
2: double click to get origin updated
     (maybe use on drop event in shape sheet cell for setf(getref(prop.starttime), page!user.starttime))
3: edit properties to
     A) confirm orgin (start date)
     B) set the date for this shape
4: save
5: Shape should move to desired location on page.

Start with a single shape, make sure algorithm works...then can broaden out to other shapes
Also, need to make width and height of shape are know to be less than some max...otherwise shapes could lay on top of each other if too wide

good luck