JSFiddle - React, Tailwind, and code Playground

by ashishsingh

JavaScript

if (!window.cccProbe) window.cccProbe = {}
//var probeVariables = {}
csdlUpLinkCodingScheme = {
  0: 'CS_1',
  1: 'CS_2',
  2: 'CS_3',
  3: 'CS_4',
  4: 'MCS_1',
  5: 'MCS_2',
  6: 'MCS_3',
  7: 'MCS_4',
  8: 'MCS_5',
  9: 'MCS_6',
  10: 'MCS_7',
  11: 'MCS_8',
  12: 'MCS_9',
  13: 'MCS_5_7',
  14: 'MCS_6_9'
};
cellNeighbourColor = {
  955: '#ed6e76',
  956: '#979595',
  957: '#8bc874',
  958: '#4b087a',
  959: '#f21a28',
  960: '#1bc80b',
  961: '#1112eb',
  962: '#eb1184',
  963: '#52a19a',
  964: '#8178e7',
  965: '#23b4c6',
  966: '#f5a84d',
  967: '#3f51b5',
  968: '#9f2d04',
  969: '#778205',
  970: '#740587',
  971: '#1b6c1e',
  972: '#03685e',
  973: '#8d38b4',
  974: '#f29aec'
}
// jsonVariableId = {} 
cccProbe = function(graphContainer, dataGrp) {
  var limit = 60,
    duration = 750,
    // ~ x minutes
    graphTimeWindow = 1 * limit * duration,
    metricDataPointLimit = 2 * Math.round(graphTimeWindow / duration),
    now = Date.now();

  var aMetricData = d3.range(limit).map(function(i) {
    return {
      x: now - (limit - i) * duration,
      value: 0,
      gap: duration
    };
  });

  window['keytime'] = now;

  function next() {
    return {
      time: Date.now(),
      value: -110
    };
  }


  var checkHost = document.location.hostname;
  var secondlastTransform = 0;
  var secondlastTransformX4 = 0;
  var colorScale = function(d, i){
    return cellNeighbourColor[d.value] || 'white'; //white is default color for missing values
  };
  // set returnVariablesToJS ajax function path for lucee, we are loading all available variables here
  if (checkHost == 'lucee.playground') {
    getUserName = location.href;
    getUserName = getUserName.split("/");
    callUrl = 'http://lucee.playground/' + getUserName[3] + '/cccsuitedataprobe/httpdocs/index.cfm/variables/returnVariablesToJS';
  } else {
    // This is the path for live url
    callUrl = 'http://dataprobe.clearcincom.com/variables/returnVariablesToJS'
  }
  //set all variable for the graphs
...