You are here

README.txt in Organigrams 7

Same filename in this branch
  1. 7 README.txt
  2. 7 libraries/orgchart/README.txt
README
======

The OrgChart library provides the ability to draw complex organization charts
with HTML5 canvas.

Interface
=========

         +----------
         |  root   |
         +---------+
              |
 +---------+  |  +---------+
 | 'l' box |--+--| 'r' box |
 +---------+  |  +---------+
              |
         +----------
         | 'u' box |
         +----------


Example use
===========

// Set up a new orgchart.
var o = new orgChart();

// Set the colors for all nodes below this function.
o.setColor(
  border_color,
  border_color_hover,
  background_color,
  background_color_hover,
  font_color,
  font_color_hover,
  line_color
);

// Set font settings for all nodes below this function.
o.setFont(
  font_name,
  font_size,
  line_height,
  font_color,
  vertical_alignment
);

// Set dimensions and spacing for all nodes below this function.
o.setSize(
  node_width,
  node_height,
  horizontal_space,
  vertical_space,
  horizontal_offset
);

// Set radius and shadow for all nodes below this function.
o.setNodeStyle(
  top_radius,
  bottom_radius,
  shadow_offset
);

// Add a node to the chart. Call this function multiple times to add more
// nodes to your chart. You can use the functions mentioned above before
// every addNode() function if you'd like to change node styles.
o.addNode(
  id,
  parent,
  position,
  text,
  bold_border,
  url,
  border_color,
  border_color_hover,
  background_color,
  background_color_hover,
  font_color,
  font_color_hover,
  image_url.length > 0 ? image_url : '',
  image_alignment
);

// Draw the chart to your canvas, make sure you have one in your HTML.
o.drawChart(
  canvas_id
  width,
  height,
  position
);

File

libraries/orgchart/README.txt
View source
  1. README
  2. ======
  3. The OrgChart library provides the ability to draw complex organization charts
  4. with HTML5 canvas.
  5. Interface
  6. =========
  7. +----------
  8. | root |
  9. +---------+
  10. |
  11. +---------+ | +---------+
  12. | 'l' box |--+--| 'r' box |
  13. +---------+ | +---------+
  14. |
  15. +----------
  16. | 'u' box |
  17. +----------
  18. Example use
  19. ===========
  20. // Set up a new orgchart.
  21. var o = new orgChart();
  22. // Set the colors for all nodes below this function.
  23. o.setColor(
  24. border_color,
  25. border_color_hover,
  26. background_color,
  27. background_color_hover,
  28. font_color,
  29. font_color_hover,
  30. line_color
  31. );
  32. // Set font settings for all nodes below this function.
  33. o.setFont(
  34. font_name,
  35. font_size,
  36. line_height,
  37. font_color,
  38. vertical_alignment
  39. );
  40. // Set dimensions and spacing for all nodes below this function.
  41. o.setSize(
  42. node_width,
  43. node_height,
  44. horizontal_space,
  45. vertical_space,
  46. horizontal_offset
  47. );
  48. // Set radius and shadow for all nodes below this function.
  49. o.setNodeStyle(
  50. top_radius,
  51. bottom_radius,
  52. shadow_offset
  53. );
  54. // Add a node to the chart. Call this function multiple times to add more
  55. // nodes to your chart. You can use the functions mentioned above before
  56. // every addNode() function if you'd like to change node styles.
  57. o.addNode(
  58. id,
  59. parent,
  60. position,
  61. text,
  62. bold_border,
  63. url,
  64. border_color,
  65. border_color_hover,
  66. background_color,
  67. background_color_hover,
  68. font_color,
  69. font_color_hover,
  70. image_url.length > 0 ? image_url : '',
  71. image_alignment
  72. );
  73. // Draw the chart to your canvas, make sure you have one in your HTML.
  74. o.drawChart(
  75. canvas_id
  76. width,
  77. height,
  78. position
  79. );