Visio Page ShapeSheet reference in shape shapesheet formula - visio

I'm trying to set the text field of a shape to the name of the layer it is on (Visio 2010). I should be able to set the formula to this:
=ThePage!Layers.Name[LayerMember]
but that doesn't work because LayerMember is a string and a shape can be on multiple layers, i.e., LayerMember = "3" if it is only on the 3rd layer but can be "3;2;5" if it is on three different layers. So, using LEFT(LayerMember, 1) gets the first value in the list but putting that in the index field of the above formula doesn't work either. Putting a static value in the index field works just fine but I want to be able to change the layer of a shape and have the text on the shape change to the layer name.
Using LEFT(LayerMember,1) returns a string. I can't find a way to convert the string value to a number to get the layer name value from the page's shapesheet.
I'm new at Visio but for some reason I can't figure this one out.

Layer is a property of shape, so try shpObj.Layer(1).Name this will give you the name of the first layer the shape is on. You will need to check shjObj.LayerCount to make sure that the shape actually is on a layer.

Related

AEM6.4: Meaning of values in image map properties

AEM offers a plugin to create image maps for its internal inplace editor. After configuration the given values are stored into follow forrmat:
[rect(89,92,356,368)"/content/sites/we-retail/us"|"_blank"|"fdfdfdfdf"|(0.2,0.2004,0.8,0.8017)]
The first paratheses are defines the coordinates of choosen shape.
The content within the first quotaion signs defines the target site, within the second how to open it the browser. In the third pair of quotations sign contains an alternative Text for non images display.
What I don't know are the values in second paratheses. Does someone know for what these values stands for?
From the WCM core components Image model, they are called relative coordinates.
They are not standard HTML attributes and are instead populated as data attributes of the area tag within the image component.
See code below:
<area shape="${area.shape}" coords="${area.coordinates}" href="${area.href}"
target="${area.target}" alt="${area.alt}" data-cmp-hook-image="area"
data-cmp-relcoords="${area.relativeCoordinates}">
Since the map coordinates are fixed coordinates and do not change when the image scales in or not based on screen sizes, the image component’s JavaScript uses this relative coordinates data to adjust the coordinates of the map area whenever the image size is adjusted. This is handled by the resizeAreas() function within the component’s clientlib.

Dynamically reading point coordinates from Spreadsheet in GeoGebra

I was using GeoGebra and I wanted to create a point whose co-ordinates are dynamically read off of a spreadsheet. The spreadsheet would have two columns for the values of x and y co-ordinates of this point, and this point would have to dynamically move from the first (x,y) value all the way through to the last one.
I tried using a slider to refer to the elements of the spreadsheet but am unable to do so. If this could be done, all I would have to do was create an animate button for the slider and that would be it. But I cannot figure out how to name the elements of the spreadsheet while incorporating the slider name as well.
If this idea cannot be implemented, is there another way of creating moving points in GeoGebra based on coordinate values created in an external file(which I was planning to copy to the spreadsheet)?
Thanks!
Yeah , there are two methods to do that one of them is using Object[] commend as you indicate in the comment ; the seconde method is creating a list follow these steps :
select a column for exemple A by clicking in the top of column
Right Click
create
list
then you can access to any element of the list in commend line by type for creating a point : (element(list1,n),element(list2,n))
n is the slider
hope i help you

Matlab clustergram: add color markers by column label

I'm using clustergram in the Matlab bioinformatics toolbox. I want to add color markers to certain columns, similarly to this, but I want to mark specific ColumnLabels (IDs) rather than specific clusters.
Anyone know of a way to do that?
Found it. Based on Kevin's excellent suggestion, I passed a structure with colors for ColumnLabelsColor, then set LabelsWithMarkers as true:
clustergram(mat,'Colormap', redbluecmap,'ColumnLabelsColor',s,'LabelsWithMarkers',true)
mat is my DataMatrix. s is a structure of 2 cell arrays, each with length of the number of columns: first array is ColumnLabels, second array is my defined colors.
By default, setting ColumnLabelsColor changes the color of the text of the labels. Setting LabelsWithMarkers to true adds a color marker between the label and the clustergram:
Thank you for the suggestion. I have just figured out this problem.
First step: construct a structure with 'Labels' and 'Colors'. These two cell array should in the same length.
Second step: set the clustergram object, parameter 'ColumnLabelsColor' with this structure.
Also, set 'LabelsWithMarkers' as true.
[This is my original code for your reference ]
https://i.stack.imgur.com/ZTQ1h.png

Determine/Save the position of text in matlab

I plotted few points using scatter and then label them using text. The position of these labels are same as the position of the points + some offset. Some of these text label overlap with each other and hence I moved them interactively (using mouse). I can check the new position of each of these text individually using property editor. However this is very time-consuming. Is there a better way to get the coordinates of all these text-label?
You can use findobj to get handles to text objects that are children of the current axes (or another handle... your choice):
text_handles = findobj('parent',gca,'type','text');
Then you can get the positions of these text objects:
positions = get(text_handles,'position');
You may need to do a bit more work to associate each text object with its data point - I suggest taking advantage of the property system, perhaps via the UserData field, for this, though there are many options.
If you want to do it easily later do this in your plots, for example:
h=text(2.9,7.5,'MyText');
This will put "MyText" at position 2.9, and 7.5.
Then to change the position use:
set(h,'Position',[2.5 7]);
This will change the position to 2.5 and 7.
Later if you need to see tthe position of text again use:
get(h);
Hope this helps.

why do getOffsetWidth() and getElement().getClientWidth() return 0 for a Widget in GWT?

I'm using RaphaelGWT to draw shapes with the underlying RaphaelJS library. Both projects are wonderful. However I was stuck for awhile on the issue of Text objects in Raphael being displayed as centered by default.
I've tried to create one Text object and let it be centered by default, then measure its width in order to adjust the position for a 2nd text object and then remove the first. But I can't get the width of the original Text object.
FYI, in RaphaelGWT, the Shape objects used extend Widget. So I've tried getAbsoluteLeft(), getElement().getAbsoluteRight(), getOffsetWidth(), getElement().getClientWidth(). getAbsoluteLeft() is the only one that returns what I would expect. getAbsoluteRight()returns the same value as getAbsoluteLeft(), and both getOffsetWidth() and getElement().getClientWidth() return 0.
Why?
FYI, I calculated the width from the original x value used to create the Text Shape (x then became the center) and getAbsoluteLeft(), which actually returned the expected value.
The element has to be visible for getOffsetWidth() to return correct values.