R – Flex + Drawing dynamically

apache-flexdrawingxml

I want to try display a relationship diagram.

I have the xml

<School>
     <Class>
          <Name>1st Grade</Name>
          <StudentName>A</StudentName>
          <StudentName>B</StudentName>
          <StudentName>C</StudentName>
          <StudentName>D</StudentName>
     </Class>
     <Class>
          <Name>2nd Grade</Name>
          <StudentName>E</StudentName>
          <StudentName>F</StudentName>
          <StudentName>G</StudentName>
          <StudentName>H</StudentName>
     <Class>
     <TeacherDetails>
          <Teacher>
               <Name>AAAA</Name>
               <Teaches>1st Grade</Teaches>
          <Teacher>
          <Teacher>
               <Name>BBBB</Name>
               <Teaches>1st Grade</Teaches>
               <Teaches>2nd Grade</Teaches>
          </Teacher>
     </TeacherDetails>
<School>
  1. How can I draw it, also, since there is a dependency for the teacher, there needs to be a connectivity between the Class & Teacher also.
  2. Is it possible to display them as icons and provide a tool tip which gives description, like the teacher icon would have teacher name and the grade she/he teaches?

Any help!!

Best Answer

Mark Shepherd's SpringGraph is a nice utility for drawing graphs. You'll have to write the layer between your XML representation and the nodes in the graph, but that is easy.

You can overload the itemRenderer for the nodes and show your custom images and hover tips on the appropriate Mouse event.

Related Topic