visualization makes file too slow.

Started by kiler40, August 02, 2013, 11:51:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

Hello Again.

For some time i`m making one complex shape that can handle all my needs.
but when i multiply this shape, it makes the file pretty heavy to work with.
Are there any optimization tricks that you can share :)
I have only one picture in the shape, and it is compressed.
But i have many shapes and several links and formulas.

Shape is approximately 50 kb by size...

Thanks,
Andrei

JohnGoldsmith

When you say heavy to work with, are you referring to the performance when working with the open drawing or file size?

Have you created a master or are you duplicating single instances?

Is there a good reason to use an image?

Can you share the shape / image in this thread?

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Hello,
I`m talking about performance of the file.

Yes i have created a master that i use again and again.
I`ll attach it.

This is a file that have in total 36 identical shapes /positions/ side by side.
From number 28 to 45, the shape have option (shape data) "Empty" set to 1.
In this case there is white square with line inside. This square is the picture.

If i try to resize all of them in the same time, it becomes slow. And this is even not the biggest configuration of positions i have.

And i have many many sets like this... in one page.... it becomes really really hard to work with.
And one other thing.
If i want to make the group even smaller, i can`t shrink too much, because the text loses its order.
So i have to copy all shapes and paste them as Picture with enhanced metafile, so i can shrink them with the size i need... and this gives additional heaviness...

JohnGoldsmith

#3
Thanks for attaching the file - it makes it much easier to see what's going on.

Looking at the structure of the master, I would say the key problem is groups within groups, where the top level group shape (Sheet.5) contains other grouped shapes.  Each new group shape creates its own coordinate space that must be transformed as its parent is resized and that creates a lot of work. 

For example, if you use the Event Monitor in the SDK you'll see that there are more than 300 hundred CellChanged events for a single resize operation.  If you multiply that across a number of shape instances on the page you can see the work involved.

The answer is to try and flatten your master shape so that it has as few groups (as sub-shapes) as possible and certainly no groups as sub-shapes of sub-shapes.  Currently there are places the the structure is four levels deep.

Other observations are:

       
  • try to keep all shape data in the top level group shape and reference it directly from sub-shapes
  • avoid heavy use to string comparison where possible (STRSAME function)
  • give all Shape Data rows meaningful names as once you start to reference them from other shapes they have no meaning if they're just 'Prop.Row_1'
  • try and create your own shapes as opposed to using builtin shape (such as data graphics and callouts) unless you need to use the specific functionality in those shapes
Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Hello John,
Thank you for your reply, unfortunately, I cannot say that I fully understand everything.
The reason is that i`m really basic user of Visio, and because I do what i do in the free time at work, this cost me too much time to figure out.
For example (please don`t laugh  :) ) i`m creating and "debugging" this single shape from last September... too much damn time...
And really i don`t understand where i can replace for example STRSAME for choosing color (because "R" and "r" means "red" ) and if nt using data graphics, how to choose from different colors for values

And i don`t know how to display text in a shape without using text callout

Other thing is... how to make this (the attachment)
can i make this in 2 levels only ?
is it possible, and everything to work as it is requested - changing colors and numbers..

Sorry for so much questions... but i`m really beginner user, and this is really important for me and my work

Wish you all the best,
Andrei

JohnGoldsmith

Hello Andrei,

That's fine and if you're just a beginner then you're doing very well!

Can you explain a little more about the shape you're developing, in terms of what it represents, what data you're supplying it with and how you expect to change in reaction to that data?

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Hello John,
Thanks for the words :)

This shape generally represents position in a connector with wires.

In the main field you have position number (1,2,3...), witch can be only with number or with a prefix (A1,B1,S1... etc.)
This position number is a text callout that is linked to the field that combine number and prefix (if one)
(But i have problems with this callout field - when i shrink the whole shape, the text distorts and become in 2 rows..)

More of the connectors are with straight shape, so i added a auto-number option, to copy and repeat with "F4" to fill all position.

Other part is 2 color square - one main color and one secondary represented with line
Because the way we identify the color is like: R/W (Red + White), B/G (Black + Green)... firs used to separate them in excel and have 2 data rows to fill, but because this is additional work for me and it is not good I figure out a way to find the "/" symbol and by this to divide the color in 2


Main color: IFERROR(LEFT(Prop.testColor,FIND("/",Prop.testColor)-1),Prop.testColor)
Second Color: IFERROR(REPLACE(Prop.testColor,1,FIND("/",Prop.testColor),""),"")


Other part is "cross" wich is "cross section" and it is a text callout. This text need to change color because black text on black background.... you know :)

Next is Mark - because some positions are equal in color and cross sestion, so I need to make additional color to know witch one is witch...

And the last is Step - witch position is after the previous. again with a text callout.


I have and pre-configured output excel file, that uses data from my work files and transform it to what i need to fill the shape fields.
I use "Automatically Link" with 2 representing data fields - connector and kontakt. Because i have more than one Connector  in a page.

Basically i have 4 states of the shape

Empty - when the "empty" data field equals "1" - this is that picture a have said i use that covers everything

In use - when "empty" is different from "1"

In use but dual circuit - when "DC" field equals "1" - in this case a second color field appears in the shape. And additional shape data rows become visible. The first copy color and cross section from the main, and second is a new one again with 2 colors and text.

and last is Used in this case the "DC" field needs to be empty and "used" field equals "1". Here the color square become with a circle shape and cross section text is not visible. This field is not mentioned it the Excel file, because it is rarely used and i enter the data manually.

ALL this is represented up to 200 connectors, with variation of positions between 2 and 80 :) So you can imagine how much this single shape is repeated  :D

Hope this explains what i have trying to do for the past lots of months...

Best regards !
Andrei


JohnGoldsmith

Thanks for that.  That helps.

Will have a proper read through and come back to you.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Thank You !
That will be really helpful
:)


Wish You All The Best

Andrei

JohnGoldsmith

 Hello Andrei, 
Well attached is an example of how to flatten the shape and you're welcome to use it (or not) as you like.
I've got it down to ten sub-shapes so have a look through and see if a) the logic in the group shape user cells is correct and b) if that improves the sizing performance on your system.

There's a few things to point out:
Color logic - In your original, you're using Data Graphics shapes to control the color logic and selection.  In this example I've opted for a single array of RGB values and this 'lookup' list is used by the 'Mark' circle, the main color blocks and the stripe overlays.  The RGB list (User.ColorValues) maps to User.ColorNames.  If your language uses a different RGB parameter delimiter you may need replace it before using it.  In English the separator is a comma (',') so that's what I've used for now.
The advantage of the ColorNames is that you can change them as you like and as long as they have a corresponding index in the ColorValues everything should work ok.
Font size - I saw your setf's via the context menu and that's a nice idea to allow you to change the font sizing.  In this example the main 'Label' font size can be set through the UI as normal (as this is now in the group shape) and there's a User cell (User.CrossToLabelFontRatio) that allows the 'cross' display text to track this as a percentage (currently 60%).  This means that you can make a selection of multiple instances and still change the font size in one go.
z-order - The stacking order within the shapes is significant in this shape (see attached image).  The circle shape for 'Used' is created by using a mask shape over the top of the square Block1 and Stripe1.  This saves creating another shape as the colour logic is already resident in Block/Stripe1.  You could attack this in a number of way, for example, by using another geometry section in Block1.  Of course you'd then need to deal with keeping the ends of the stripe circular as well.  In the end I went for the mask.

What's not in here:
I haven't included you auto-numbering system, or the floating yellow circle (I wasn't quite clear what that was tied to (data-wise).
Anyway I hope that helps.  I'm off on holiday this weekend so if you have any difficulties maybe post another question and others here will help out, otherwise I'll check back on this thread in a week or so.
Best regards
John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Dear John,
Thanks for the reply. You give me some great clues.
My issue is with the color.
It seems that it is not working at me. (I`m using visio 2010 if this matter)
Index function returns the value of the color, but the shape stays balck

JohnGoldsmith

Hi,

What language are you using?

If you write and RGB formula into a cell what character is the argument separator?

For example, in English you use a comma. So 'RGB(200,25,50)'

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Hi,
Im using the file you have attached. And i`m using English.
and i have created a shape just to display the result of the formula when i type "y" returns RGB(255,255,0).
But if i link shape background color to the cell with the result, the shape turns black.
If i manually type RGB(255,255,0) the shape is yellow.

I have tried other thing
To make a user.cell and to link shape background to the user.cell
If i type 1 in the user.cell shape is white, 2 is red and so one.
But if i type RGB(anything) the shape becomes again black....

Don`t know what is the problem...

JohnGoldsmith

Do you want to share the file and I'll have a look?
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

Outsource :)
Here you are !
if i link User.row_5 with user.search shape becomes black