Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

How to find the width , height and positions for first shape in the SmartArt?

$
0
0

Hi All,

I am analyzing about layout algorithms in Smart Art. I have one big doubts with layout algorithm. That is how do you fine or define width , height and positions for first shape of the SmartArt. Because MS dont provide any kind of default values for width and height for first shape. Only provide the constraints for width and height for next shape for first shape.

Here i have shared the simple layout algorithm for Smart Art. Can any one please define step by step how this layout algorithm works.

Layout Algorithm:

 <dgm:layoutNode name="diagram">
    <dgm:varLst>
      <dgm:dir />
      <dgm:resizeHandles val="exact" />
    </dgm:varLst>
    <dgm:choose name="Name0">
      <dgm:if name="Name1" func="var" arg="dir" op="equ" val="norm">
        <dgm:alg type="snake">
          <dgm:param type="grDir" val="tL" />
          <dgm:param type="flowDir" val="row" />
          <dgm:param type="contDir" val="sameDir" />
          <dgm:param type="off" val="ctr" />
        </dgm:alg>
      </dgm:if>
      <dgm:else name="Name2">
        <dgm:alg type="snake">
          <dgm:param type="grDir" val="tR" />
          <dgm:param type="flowDir" val="row" />
          <dgm:param type="contDir" val="sameDir" />
          <dgm:param type="off" val="ctr" />
        </dgm:alg>
      </dgm:else>
    </dgm:choose>
    <dgm:shape xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:blip="">
      <dgm:adjLst />
    </dgm:shape>
    <dgm:presOf />
    <dgm:constrLst>
      <dgm:constr type="w" for="ch" forName="node" refType="w" />
      <dgm:constr type="h" for="ch" forName="node" refType="w" refFor="ch" refForName="node" fact="0.6" />
      <dgm:constr type="w" for="ch" forName="sibTrans" refType="w" refFor="ch" refForName="node" fact="0.1" />
      <dgm:constr type="sp" refType="w" refFor="ch" refForName="sibTrans" />
      <dgm:constr type="primFontSz" for="ch" forName="node" op="equ" val="65" />
    </dgm:constrLst>
    <dgm:ruleLst />
    <dgm:forEach name="Name3" axis="ch" ptType="node">
      <dgm:layoutNode name="node">
        <dgm:varLst>
          <dgm:bulletEnabled val="1" />
        </dgm:varLst>
        <dgm:alg type="tx" />
        <dgm:shape type="rect" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:blip="">
          <dgm:adjLst />
        </dgm:shape>
        <dgm:presOf axis="desOrSelf" ptType="node" />
        <dgm:constrLst>
          <dgm:constr type="lMarg" refType="primFontSz" fact="0.3" />
          <dgm:constr type="rMarg" refType="primFontSz" fact="0.3" />
          <dgm:constr type="tMarg" refType="primFontSz" fact="0.3" />
          <dgm:constr type="bMarg" refType="primFontSz" fact="0.3" />
        </dgm:constrLst>
        <dgm:ruleLst>
          <dgm:rule type="primFontSz" val="5" fact="NaN" max="NaN" />
        </dgm:ruleLst>
      </dgm:layoutNode>
      <dgm:forEach name="Name4" axis="followSib" ptType="sibTrans" cnt="1">
        <dgm:layoutNode name="sibTrans">
          <dgm:alg type="sp" />
          <dgm:shape xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:blip="">
            <dgm:adjLst />
          </dgm:shape>
          <dgm:presOf />
          <dgm:constrLst />
          <dgm:ruleLst />
        </dgm:layoutNode>
      </dgm:forEach>
    </dgm:forEach>
  </dgm:layoutNode>

2nd Doubt: For example, here i have used Basic block list for analyzing. Now i have create Basic Block List with one small rectangle shape. And then i have try to add another shape or node to the  smart art,then the second shape is more large than first node. But based on the algorithm the second node gets size from first shape. So the second node has small size than first node or same size. but it has too large size. So this case the algorithm failed. So for this case how do we calculate the width, height and positions for node?.

 

Regards,

Lakshmi Narayanan Asokan



Viewing all articles
Browse latest Browse all 2257


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>