@@ -3,7 +3,7 @@ import * as d3 from 'd3';
33/**
44 * Class representing a Cumulative Flow Diagram (CFD) Graph Data
55 */
6- class CFDGraph {
6+ export class CFDGraph {
77 /**
88 * Creates a new CFDGraph instance.
99 * @constructor
@@ -83,7 +83,7 @@ class CFDGraph {
8383 date : currentDate ,
8484 } ;
8585 this . states . forEach ( ( state , index ) => {
86- dataEntry [ state ] = this . # getNoOfTicketsInState( this . states [ index ] , currentTimestamp ) ;
86+ dataEntry [ state ] = this . getNoOfTicketsInState ( this . states [ index ] , currentTimestamp ) ;
8787 } ) ;
8888 dataSet . push ( dataEntry ) ;
8989 }
@@ -100,14 +100,14 @@ class CFDGraph {
100100 * @param {number } timestamp - The timestamp at which to check the ticket state.
101101 * @returns {number } noOfTickets - The count of tickets in the specified state for the given timestamp.
102102 */
103- # getNoOfTicketsInState( state , timestamp ) {
103+ getNoOfTicketsInState ( state , timestamp ) {
104104 return this . data . filter ( ( d ) => {
105105 if ( ! d [ state ] ) {
106106 return false ;
107107 }
108- let nextState = this . # getNextState( state ) ;
108+ let nextState = this . getNextState ( state ) ;
109109 while ( nextState !== null && ! d [ nextState ] ) {
110- nextState = this . # getNextState( nextState ) ;
110+ nextState = this . getNextState ( nextState ) ;
111111 }
112112 if ( ! d [ nextState ] ) {
113113 return d [ state ] <= timestamp ;
@@ -123,10 +123,8 @@ class CFDGraph {
123123 * @param {string } state - The current state of the ticket.
124124 * @returns {string|null } nextState - The next state in the ticket lifecycle, or null if there is no next state.
125125 */
126- # getNextState( state ) {
126+ getNextState ( state ) {
127127 const index = this . states . indexOf ( state ) ;
128128 return index >= 0 && index < this . states . length - 1 ? this . states [ index + 1 ] : null ;
129129 }
130130}
131-
132- export default CFDGraph ;
0 commit comments