drawNodes(output) {
      const grid = document.createElement("g");
      grid.setAttribute("class", "graph-svg-group graph-node-group");
      const label = this.getXLabels();
      this.getValues().forEach((val, index) => {
        const group = document.createElement("g");
        group.setAttribute("class", "node-group");

        const vLine = document.createElement("line");
        vLine.setAttribute("x1", `${this.xCoords[index]}px`);
        vLine.setAttribute("y1", `${0}px`);
        vLine.setAttribute("x2", `${this.xCoords[index]}px`);
        vLine.setAttribute("y2", `${this.height}px`);
        vLine.setAttribute("stroke", `${this.nodeStroke}`);
        vLine.setAttribute("stroke-width", "0.8");
        vLine.setAttribute("class", "node-grid-v");
        if (output) group.appendChild(vLine);

        const hLine = document.createElement("line");
        hLine.setAttribute("x1", `${0}px`);
        hLine.setAttribute("y1", `${this.yCoords[index]}px`);
        hLine.setAttribute("x2", `${this.width}px`);
        hLine.setAttribute("y2", `${this.yCoords[index]}px`);
        hLine.setAttribute("stroke", `${this.nodeStroke}`);
        hLine.setAttribute("stroke-width", "0.8");
        hLine.setAttribute("class", "node-grid-h");
        if (output) group.appendChild(hLine);

        if (this.showInlineLabel) {
          const text = document.createElement("text");
          text.setAttribute("x", `${this.xCoords[index]}px`);
          text.setAttribute("y", `${this.yCoords[index] - 15}px`);
          text.setAttribute("fill", `${this.inlineLabelColor}`);
          if (index === 0) {
            text.setAttribute("text-anchor", "start");
          } else if (index === label.length - 1) {
            text.setAttribute("text-anchor", "end");
          } else {
            text.setAttribute("text-anchor", "middle");
          }
          text.setAttribute("class", "graph-inline-label");
          text.innerHTML = `${this.showInlineLabelValueOnly ? "" : `${label[index]}:`} ${this.formatValue(val)}`;
          group.appendChild(text);
        }

        const node = document.createElement("circle");
        node.setAttribute("cx", this.xCoords[index]);
        node.setAttribute("cy", this.yCoords[index]);
        node.setAttribute("r", this.node.radius);
        node.setAttribute("stroke", this.nodeStroke);
        node.setAttribute("fill", this.nodeColor);
        node.setAttribute("stroke-width", this.node.stroke);
        node.setAttribute("class", "circle-node");
        node.setAttribute("data-label", label[index]);
        node.setAttribute("data-value", this.formatValue(val));
        group.appendChild(node);

        grid.appendChild(group);
      });

      return grid;
    }
/**
     * Generate the node element for the graph, indicating every plotted point on the graph.
     * @param {Boolean} output 
     * @returns {SVGGElement}
     */
Generate the node element for the graph, indicating every plotted point on the graph.
@param {Boolean} output
@returns {SVGGElement}
Generate the node element for the graph indicating every plotted point on the graph . @param { Boolean } output @returns { SVGGElement }
drawNodes(output) {
      const grid = document.createElement("g");
      grid.setAttribute("class", "graph-svg-group graph-node-group");
      const label = this.getXLabels();
      this.getValues().forEach((val, index) => {
        const group = document.createElement("g");
        group.setAttribute("class", "node-group");
        const vLine = document.createElement("line");
        vLine.setAttribute("x1", `${this.xCoords[index]}px`);
        vLine.setAttribute("y1", `${0}px`);
        vLine.setAttribute("x2", `${this.xCoords[index]}px`);
        vLine.setAttribute("y2", `${this.height}px`);
        vLine.setAttribute("stroke", `${this.nodeStroke}`);
        vLine.setAttribute("stroke-width", "0.8");
        vLine.setAttribute("class", "node-grid-v");
        if (output) group.appendChild(vLine);
        const hLine = document.createElement("line");
        hLine.setAttribute("x1", `${0}px`);
        hLine.setAttribute("y1", `${this.yCoords[index]}px`);
        hLine.setAttribute("x2", `${this.width}px`);
        hLine.setAttribute("y2", `${this.yCoords[index]}px`);
        hLine.setAttribute("stroke", `${this.nodeStroke}`);
        hLine.setAttribute("stroke-width", "0.8");
        hLine.setAttribute("class", "node-grid-h");
        if (output) group.appendChild(hLine);
        if (this.showInlineLabel) {
          const text = document.createElement("text");
          text.setAttribute("x", `${this.xCoords[index]}px`);
          text.setAttribute("y", `${this.yCoords[index] - 15}px`);
          text.setAttribute("fill", `${this.inlineLabelColor}`);
          if (index === 0) {
            text.setAttribute("text-anchor", "start");
          } else if (index === label.length - 1) {
            text.setAttribute("text-anchor", "end");
          } else {
            text.setAttribute("text-anchor", "middle");
          }
          text.setAttribute("class", "graph-inline-label");
          text.innerHTML = `${this.showInlineLabelValueOnly ? "" : `${label[index]}:`} ${this.formatValue(val)}`;
          group.appendChild(text);
        }
        const node = document.createElement("circle");
        node.setAttribute("cx", this.xCoords[index]);
        node.setAttribute("cy", this.yCoords[index]);
        node.setAttribute("r", this.node.radius);
        node.setAttribute("stroke", this.nodeStroke);
        node.setAttribute("fill", this.nodeColor);
        node.setAttribute("stroke-width", this.node.stroke);
        node.setAttribute("class", "circle-node");
        node.setAttribute("data-label", label[index]);
        node.setAttribute("data-value", this.formatValue(val));
        group.appendChild(node);
        grid.appendChild(group);
      });
      return grid;
    }
drawNodes ( output ) { const grid = document . createElement ( "g" ) ; grid . setAttribute ( "class" , "graph-svg-group graph-node-group" ) ; const label = this . getXLabels ( ) ; this . getValues ( ) . forEach ( ( val , index ) => { const group = document . createElement ( "g" ) ; group . setAttribute ( "class" , "node-group" ) ; const vLine = document . createElement ( "line" ) ; vLine . setAttribute ( "x1" , ` ${ this . xCoords [ index ] } ` ) ; vLine . setAttribute ( "y1" , ` ${ 0 } ` ) ; vLine . setAttribute ( "x2" , ` ${ this . xCoords [ index ] } ` ) ; vLine . setAttribute ( "y2" , ` ${ this . height } ` ) ; vLine . setAttribute ( "stroke" , ` ${ this . nodeStroke } ` ) ; vLine . setAttribute ( "stroke-width" , "0.8" ) ; vLine . setAttribute ( "class" , "node-grid-v" ) ; if ( output ) group . appendChild ( vLine ) ; const hLine = document . createElement ( "line" ) ; hLine . setAttribute ( "x1" , ` ${ 0 } ` ) ; hLine . setAttribute ( "y1" , ` ${ this . yCoords [ index ] } ` ) ; hLine . setAttribute ( "x2" , ` ${ this . width } ` ) ; hLine . setAttribute ( "y2" , ` ${ this . yCoords [ index ] } ` ) ; hLine . setAttribute ( "stroke" , ` ${ this . nodeStroke } ` ) ; hLine . setAttribute ( "stroke-width" , "0.8" ) ; hLine . setAttribute ( "class" , "node-grid-h" ) ; if ( output ) group . appendChild ( hLine ) ; if ( this . showInlineLabel ) { const text = document . createElement ( "text" ) ; text . setAttribute ( "x" , ` ${ this . xCoords [ index ] } ` ) ; text . setAttribute ( "y" , ` ${ this . yCoords [ index ] - 15 } ` ) ; text . setAttribute ( "fill" , ` ${ this . inlineLabelColor } ` ) ; if ( index === 0 ) { text . setAttribute ( "text-anchor" , "start" ) ; } else if ( index === label . length - 1 ) { text . setAttribute ( "text-anchor" , "end" ) ; } else { text . setAttribute ( "text-anchor" , "middle" ) ; } text . setAttribute ( "class" , "graph-inline-label" ) ; text . innerHTML = ` ${ this . showInlineLabelValueOnly ? "" : ` ${ label [ index ] } ` } ${ this . formatValue ( val ) } ` ; group . appendChild ( text ) ; } const node = document . createElement ( "circle" ) ; node . setAttribute ( "cx" , this . xCoords [ index ] ) ; node . setAttribute ( "cy" , this . yCoords [ index ] ) ; node . setAttribute ( "r" , this . node . radius ) ; node . setAttribute ( "stroke" , this . nodeStroke ) ; node . setAttribute ( "fill" , this . nodeColor ) ; node . setAttribute ( "stroke-width" , this . node . stroke ) ; node . setAttribute ( "class" , "circle-node" ) ; node . setAttribute ( "data-label" , label [ index ] ) ; node . setAttribute ( "data-value" , this . formatValue ( val ) ) ; group . appendChild ( node ) ; grid . appendChild ( group ) ; } ) ; return grid ; }
Generate the node element for the graph, indicating every plotted point on the graph.
Generate the node element for the graph indicating every plotted point on the graph .