Source

modules/d3/others/d3.utils.js

  1. /**
  2. * @module D3Module.d3Utils
  3. * @namespace
  4. */
  5. const d3 = require('d3/index');
  6. /**
  7. * @name D3Module.d3Utils.appendChart
  8. * @function
  9. * @desc it add chart in htmlContainer with name idElement
  10. * @param {SVGElement} svg - element chart
  11. * @param {string} idElement - name of chart
  12. * @param {HTMLElement} htmlElementContainer - container element of chart
  13. */
  14. const appendChart = (svg, idElement, htmlElementContainer) => {
  15. const chart = svg.node();
  16. chart.id = idElement;
  17. htmlElementContainer.append(chart);
  18. }
  19. module.exports = {
  20. appendChart,
  21. d3
  22. };