Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Create a node with a square and rhombus/diamond inside

+1 vote

Howdy :-)

I'm looking for some help to create a node in a palette to be a square with a rhombus inside (like the one attached below).

Currently, I'm only able to show either the square or the rhombus, but not both at the same time within a node. Would you please be able to help with the below?

Thanks for any help with this.

The code I have is as follows.

    <node id="n3">
      <data key="d3"><![CDATA[erd.palette.AssociativeEntity]]></data>
      <data key="d4"><![CDATA[Associative Entity]]></data>
      <data key="d6"/>
      <data key="d7">
        <y:GenericNode configuration="com.yworks.entityRelationship.small_entity">
          <y:Geometry height="30.0" width="30.0" x="330.0" y="47.0"/>
          <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.5"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.701171875" modelName="custom" textColor="#000000" visible="true" width="34.01171875" x="22.994140625" y="10.6494140625">
            <y:LabelModel>
              <y:SmartNodeLabelModel distance="1.0"/>
            </y:LabelModel>
            <y:ModelParameter>
              <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
            </y:ModelParameter>
          </y:NodeLabel>
          <y:StyleProperties>
            <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="true"/>
          </y:StyleProperties>
        </y:GenericNode>    
        <y:GenericNode configuration="com.yworks.entityRelationship.relationship">
          <y:Geometry height="30.0" width="30.0" x="330.0" y="47.0"/>
          <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.5"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="18.701171875" modelName="custom" textColor="#000000" visible="true" width="70.041015625" x="9.9794921875" y="18.6494140625"><y:LabelModel>
              <y:SmartNodeLabelModel distance="4.0"/>
            </y:LabelModel>
            <y:ModelParameter>
              <y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
            </y:ModelParameter>
          </y:NodeLabel>
          <y:StyleProperties>
            <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="true"/>
          </y:StyleProperties>
        </y:GenericNode>
      </data>      
    </node>

 

 

in Help by

1 Answer

0 votes
 
Best answer

Try the following approach:

  1. Create a rectangle node as usual.
  2. Create a diamond node as usual.
  3. Move the diamond node over the rectangle node.
  4. Right-click the diamond node to open its context menu.
  5. Choose "Convert to Label".
  6. Create a user-defined palette section (see "Edit" -> "Manage Palette").
  7. Right-click the combined node to open its context menu.
  8. Choose "Add to Palette" and select the name of the desired palette section.

Alternatively, create an SVG document depicting the desired symbol, then import said SVG document in a user-defined palette section.

by [yWorks] (160k points)
edited by
Hi Thomas,

Thanks for your answer.

If I'm not mistaken, these steps are to construct such node having a separate square and a separate rhombus in the palette.

What I actually would like to have is a specific icon in the palette with the node already constructed in such way, so I don't have to perform such steps.

Hope I actually clarified my question.

Thanks again
See (the new) steps 6 to 8 above.
Brilliant!! Worked fantastically!

Thanks so much Thomas!
I try to achieve exactly the same but have the following resizing problem:

http://yed.yworks.com/support/qa/10944/there-possibility-to-scale-the-label-symbol-with-the-element
Legal Disclosure | Privacy Policy
...