javascript - Creating basic company hierarchy line tree graph using Angular and D3 with STRAIGHT line links -


i'm building angular directive service , controller shows common, everyday company hierarchy chain. code have same accepted answer stack overflow question:

organization chart - tree, online, dynamic, collapsible, pictures - in d3

i'm creating service , controller in angular example i'm not sure if there better way this, given d3 rendering happening in 'svg' in angular service. controller , service code have example:

http://codepen.io/glovelidge/pen/qbbypv/

i want use service handle of d3 logic , controller bind template.

my ultimate goal take links above , make selected picture on google images page, company chart using straight lines connecting nodes:

https://www.google.com/search?q=org+structure+tree&espv=2&biw=1920&bih=1019&source=lnms&tbm=isch&sa=x&ved=0ahukewj9we3x4kxlahwrlimkhabzaieq_auibigb#imgrc=5qum4cjpcv2y8m%3a

i new d3, questions are:

  • can take curving links above examples , make them straight image in link on google images.
  • anybody familiar angular , d3, example in codepen link best way set d3 in service? or there better way set service.
  • most of examples have seen have json children relationships showing (like json in first link, stack overflow question, above, there way connect nodes userid. i.e. if json 'flat' , looked this:

     nodes = [{ userid: 1, name: "bob" }, { userid: 2, name: "bill" }, {userid: 3, name: "jordan}]  //connect nodes these type of edges  edges = [{ from: 1, to: 2 }, { from: 1, to: 3}] 
  • can make these nodes draggable around screen?

  • when click around on example in codepen link, i've noticed rectangles behind text change shapes , text runs outside of rectangle. doesn't seem normal css because things changing dynamically. there efficient way make height , width same regardless of state of nodes (i.e. enter, transition, or exit)

thanks lot help.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -