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.

JohnGoldsmith

Hi,

This seems to work for me (see DualColor.png below).  To display two colors in the shape you need a different fill pattern.  Once that's set you can use both FillForegnd and FillBkgnd.

The color formulae (User.Search/2) have a default error value of '0', which is black. 

Re-reading your question it occurs to me that you're trying to use a number as the index in Prop.Color (or via User.Row_5 (stop using those default row names!  :) )) - is that right?

If that's the case then you would expect to get black as it should produce an error.

Let me explain about the index functions, just in case they're not clear.  These functions are trying to find the location of a string in an array of strings.  In our case this is a letter.

For example, given the following two list cells:

   User.value = "R|G|B"
   User.present = "RGB(255,0,0)|RGB(0,255,0)|RGB(0,0,255)"


If you look at IndexFunction.png below and set Prop.Color to 'G' then the formula would be evaluated as follows:

       
  • Inner (green) Index function = "G" (as that's the first (zero) index of that string).
  • The (purple) Lookup function uses "G" to lookup its position in the User.value color names list and would = 1 (as "G" is in position 1).
  • The final outer (blue) Index function would use the 1 value to find the correct RGB list item and return 'RGB(0,255,0)'
Now let's look at what happens if you set Prop.Color to '1':

       
  • Inner (green) Index function = "1" (as that's the first (zero) index of that string).
  • The (purple) Lookup function uses "1" to lookup its position in the User.value color names list and would = -1 (as "1" cannot be found in the color names list).
  • The final outer (blue) Index function would use the -1 value to find the correct RGB list item but, as -1 index position does not exist, it would return the default error value '0' (which is equivilent to black).
You could break up the nested Index/Lookup formula to make it a little easier to see the intermediate values.  Have a look at how the 'Mark' color indexing works in my earlier file.

Also, you might want to have a look at the reference docs for Lookup and Index so you're clear on how they work.

Hope that helps.

Best regards

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

kiler40

Hello again,

Mayby i`m not explayning it correct.
From the file you have made some post ago, with the tuned shape, when i change the color in the shape it turns black (the one shape you have made)

Then i have started try understaing why is not working.
And i have made this simple shape.

Made some thing so i can see what is happening.
first (in simple_color.png)

I`m linking the last user row -  user.color (ok with the default names :) ) with shape background. If you put 2 as shape background it will become red.
At the same time i have put text field to display the result from the 2 INDEX formulas.
The index formula works fine according what it should do.

y/r = RGB(255,255,0)/RGB(255,0,0)

Till this point i understand everything.

Next (yellow_color.png)  i want to change color of the shape to yello. At this point i will put RGB value -  RGB(255,255,0) The one user.search is returning.

The shape turns yellow. Great :)

Finally (end_result.png), i will link user.color to user.search...
In this case i have put the text to be white so it can be seen in the ... black box...

I really cant understand where is the problem.


I see that you use visio 2013.... is this where the difference comes from ...






kiler40

i can put only 2 attachments....

Here is the end result.

JohnGoldsmith

Well that is odd.  At the moment I just can't reproduce what you're seeing.

It is possible that this is 2013 related.  I opened your original file in 2013 and saved it in compatibility mode and then opened it in 2010.  In 2013 the shapes get the THEMEVAL formulae from the 2013 themes model and this is lost (obviously) when opened in 2010.  In fact the cells that contained the THEMEVAL functions get their formulae wiped and just the value remains (you can see this persisted in the document if you save as xml (vdx).

I would try and reproduce your shape in 2010 from a brand new document and see if that fixes the problem.

Let me know how you get on.

Best regards

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

kiler40

I have no idea.... to be honest :)
I have tried to transform the result somehow... but nothing happens

JohnGoldsmith

Have you tried creating a new shape in a new document (not copy and paste)?
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40

This was one of the first thing to try...

JohnGoldsmith

ok, well can you share a new file when it's in the 'black' state?
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

kiler40


JohnGoldsmith

Thanks for that.

Yes, I can confirm that I'm seeing the same problem when i open the document.  Inspecting the ShapeSheet when opening the file you can see that the formulae are all correct (see FormulaView.png), but in ValuesView.png the FillForegnd cell has a value of 0.

I'm afraid I've run out of time on this for the moment.  My guess is that for some reason, on the first go the yellow RGB color has not been added to the document's colors collection and so it's failing to be interpreted correctly.  If you edit the cell (with no changes) and hit enter the yellow color is added to the colors collection and the cell value (and visual fill) updates accordingly.

For the time being, I would iterate through the color values in Prop.color so that each one has been used once and I believe that should deal with the problem.  I haven't had time to test this thoroughly, but that would be my approach.

Hope that helps.

Best regards

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

JohnGoldsmith

As an alternative approach you might want to try push the RGB value into the FillForegnd cell as per the attached image.

Best regards

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

kiler40

This looks unteresting, but for now I cant try it... because at my home i have visio 2013, and in work we are with 2010...
So on monday, I`ll share my experience with this matter :)
Thank you :)

Wish you all the best,
Andrei

kiler40

Its strange... in visio 2013 at home, still cant make it work..

kiler40

Dear John,

OK! I have found the solution... :)

When i put the color in RGB value by hand, i use RGB(r,g,b) syntax
But it seems that when color is linked to an active in some way field, (formula, shape data field.. etc) the value comes with  this  "  symbol "RGB(r,g,b)"

and in this case the field turns black.
The solution was to change with "RGB(r;g;b)"

"RGB(255;255;255)|RGB(255;0;0)|RGB(255;255;0)|RGB(64;191;96)|RGB(0;0;255)|RGB(0;0;0)
|RGB(112;48;160)|RGB(255;153;255)|RGB(145;70;9)|RGB(143;143;143)|RGB(255;204;153)|RGB(249;196;153)"


I know you mentioned something about different symbols for input in the beginning of the topic and i don`t know if this is what you were trying to explain... but you still have problems with the colors like me :)

It was a interesting and good lesson to me.

Thank you too for the support :)



Jumpy

Had a similar problem once and it was language related, as I use a german Visio2007 Version. That was, what John was hinting at, in his first explanations. Some versions of Visio use "," others ";" as separators inside ShapeSheet functions (or at least the RGB-function).
And Visio uses black as default color, when it can't interpret the formula in cell (or there's an error in the formula and that get's interpreted as 1 and 1 is color black???), so it turned everything black for you.