/* eslint-disable no-unused-vars */
import EnigmaMocker from '..';

function Data() {
  const entries = [];

  return {
    // Get response for specified arguments
    get(...args) {
      const match = entries.find((entry) => JSON.stringify(entry.args) === JSON.stringify(args));
      return match ? match.response : undefined;
    },
    // Add a response for specified arguments
    add(args, response) {
      entries.push({ args, response });
      return this;
    },
  };
}

// Browser size: 1000 width, 400 height
const hyperCubeTreeData = new Data()
  .add(
    // Initial data set
    [
      '/qHyperCubeDef',
      {
        qTreeNodes: [
          {
            qArea: {
              qLeft: 0,
              qHeight: 4,
              qWidth: 1,
              qTop: 0,
            },
            qAllValues: false,
          },
          {
            qArea: {
              qLeft: 1,
              qHeight: 6,
              qWidth: 1,
              qTop: 0,
            },
            qAllValues: true,
          },
        ],
      },
    ],
    [
      {
        qValue: 0,
        qElemNo: -1,
        qGroupPos: 0,
        qGroupSize: 4,
        qRow: 0,
        qType: 'R',
        qValues: [],
        qNodes: [
          {
            qText: 'Central',
            qValue: 'NaN',
            qElemNo: 3,
            qGroupPos: 0,
            qGroupSize: 17,
            qRow: 0,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 0,
                qType: 'N',
                qValues: [
                  {
                    qText: '5901530.7',
                    qValue: 5901530.699999974,
                  },
                ],
                qNodes: [],
                qMaxPos: [5901530.699999974],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 1,
                qType: 'N',
                qValues: [
                  {
                    qText: '7649723.19',
                    qValue: 7649723.189999987,
                  },
                ],
                qNodes: [],
                qMaxPos: [7649723.189999987],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 2,
                qType: 'N',
                qValues: [
                  {
                    qText: '17708816',
                    qValue: 17708815.999999635,
                  },
                ],
                qNodes: [],
                qMaxPos: [17708815.999999635],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 3,
                qType: 'N',
                qValues: [
                  {
                    qText: '12700337.14',
                    qValue: 12700337.139999872,
                  },
                ],
                qNodes: [],
                qMaxPos: [12700337.139999872],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Breakfast Foods',
                qValue: 'NaN',
                qElemNo: 10,
                qGroupPos: 4,
                qGroupSize: 0,
                qRow: 4,
                qType: 'N',
                qValues: [
                  {
                    qText: '5023426.59',
                    qValue: 5023426.59000001,
                  },
                ],
                qNodes: [],
                qMaxPos: [5023426.59000001],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Canned Foods',
                qValue: 'NaN',
                qElemNo: 2,
                qGroupPos: 5,
                qGroupSize: 0,
                qRow: 5,
                qType: 'N',
                qValues: [
                  {
                    qText: '13754745.7',
                    qValue: 13754745.6999999,
                  },
                ],
                qNodes: [],
                qMaxPos: [13754745.6999999],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
            ],
            qMaxPos: [179940084.0499983],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Northeast',
            qValue: 'NaN',
            qElemNo: 2,
            qGroupPos: 1,
            qGroupSize: 17,
            qRow: 17,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 17,
                qType: 'N',
                qValues: [
                  {
                    qText: '3552140.8',
                    qValue: 3552140.8000000087,
                  },
                ],
                qNodes: [],
                qMaxPos: [3552140.8000000087],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 18,
                qType: 'N',
                qValues: [
                  {
                    qText: '3683383.75',
                    qValue: 3683383.750000015,
                  },
                ],
                qNodes: [],
                qMaxPos: [3683383.750000015],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 19,
                qType: 'N',
                qValues: [
                  {
                    qText: '4419972.58',
                    qValue: 4419972.580000028,
                  },
                ],
                qNodes: [],
                qMaxPos: [4419972.580000028],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 20,
                qType: 'N',
                qValues: [
                  {
                    qText: '4795309.75',
                    qValue: 4795309.750000039,
                  },
                ],
                qNodes: [],
                qMaxPos: [4795309.750000039],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Breakfast Foods',
                qValue: 'NaN',
                qElemNo: 10,
                qGroupPos: 4,
                qGroupSize: 0,
                qRow: 21,
                qType: 'N',
                qValues: [
                  {
                    qText: '2844831.41',
                    qValue: 2844831.410000015,
                  },
                ],
                qNodes: [],
                qMaxPos: [2844831.410000015],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Canned Foods',
                qValue: 'NaN',
                qElemNo: 2,
                qGroupPos: 5,
                qGroupSize: 0,
                qRow: 22,
                qType: 'N',
                qValues: [
                  {
                    qText: '5472342.63',
                    qValue: 5472342.630000012,
                  },
                ],
                qNodes: [],
                qMaxPos: [5472342.630000012],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
            ],
            qMaxPos: [67289558.44000022],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Southern',
            qValue: 'NaN',
            qElemNo: 1,
            qGroupPos: 2,
            qGroupSize: 17,
            qRow: 34,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 34,
                qType: 'N',
                qValues: [
                  {
                    qText: '4845822.23',
                    qValue: 4845822.229999975,
                  },
                ],
                qNodes: [],
                qMaxPos: [4845822.229999975],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 35,
                qType: 'N',
                qValues: [
                  {
                    qText: '4891342.52',
                    qValue: 4891342.520000013,
                  },
                ],
                qNodes: [],
                qMaxPos: [4891342.520000013],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 36,
                qType: 'N',
                qValues: [
                  {
                    qText: '8317136.05',
                    qValue: 8317136.049999981,
                  },
                ],
                qNodes: [],
                qMaxPos: [8317136.049999981],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 37,
                qType: 'N',
                qValues: [
                  {
                    qText: '6734701.98',
                    qValue: 6734701.979999986,
                  },
                ],
                qNodes: [],
                qMaxPos: [6734701.979999986],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Breakfast Foods',
                qValue: 'NaN',
                qElemNo: 10,
                qGroupPos: 4,
                qGroupSize: 0,
                qRow: 38,
                qType: 'N',
                qValues: [
                  {
                    qText: '2738020.03',
                    qValue: 2738020.0299999984,
                  },
                ],
                qNodes: [],
                qMaxPos: [2738020.0299999984],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Canned Foods',
                qValue: 'NaN',
                qElemNo: 2,
                qGroupPos: 5,
                qGroupSize: 0,
                qRow: 39,
                qType: 'N',
                qValues: [
                  {
                    qText: '9222227.82',
                    qValue: 9222227.820000036,
                  },
                ],
                qNodes: [],
                qMaxPos: [9222227.820000036],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
            ],
            qMaxPos: [108564205.80000006],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Western',
            qValue: 'NaN',
            qElemNo: 0,
            qGroupPos: 3,
            qGroupSize: 17,
            qRow: 51,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 51,
                qType: 'N',
                qValues: [
                  {
                    qText: '12208458.88',
                    qValue: 12208458.879999902,
                  },
                ],
                qNodes: [],
                qMaxPos: [12208458.879999902],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 52,
                qType: 'N',
                qValues: [
                  {
                    qText: '9860525.6599999',
                    qValue: 9860525.659999896,
                  },
                ],
                qNodes: [],
                qMaxPos: [9860525.659999896],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 53,
                qType: 'N',
                qValues: [
                  {
                    qText: '14107801.51',
                    qValue: 14107801.50999981,
                  },
                ],
                qNodes: [],
                qMaxPos: [14107801.50999981],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 54,
                qType: 'N',
                qValues: [
                  {
                    qText: '11420451.46',
                    qValue: 11420451.459999878,
                  },
                ],
                qNodes: [],
                qMaxPos: [11420451.459999878],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Breakfast Foods',
                qValue: 'NaN',
                qElemNo: 10,
                qGroupPos: 4,
                qGroupSize: 0,
                qRow: 55,
                qType: 'N',
                qValues: [
                  {
                    qText: '7172757.17',
                    qValue: 7172757.169999969,
                  },
                ],
                qNodes: [],
                qMaxPos: [7172757.169999969],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Canned Foods',
                qValue: 'NaN',
                qElemNo: 2,
                qGroupPos: 5,
                qGroupSize: 0,
                qRow: 56,
                qType: 'N',
                qValues: [
                  {
                    qText: '14747407.4',
                    qValue: 14747407.399999714,
                  },
                ],
                qNodes: [],
                qMaxPos: [14747407.399999714],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
            ],
            qMaxPos: [185459779.4199978],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
        ],
        qMaxPos: [],
        qMinNeg: [],
        qState: 'L',
        qTreePath: [],
      },
    ]
  )
  .add(
    // After calibrating size
    [
      '/qHyperCubeDef',
      {
        qTreeNodes: [
          {
            qArea: {
              qLeft: 0,
              qHeight: 4,
              qWidth: 1,
              qTop: 0,
            },
            qAllValues: false,
          },
          {
            qArea: {
              qLeft: 1,
              qHeight: 4,
              qWidth: 1,
              qTop: 0,
            },
            qAllValues: true,
          },
        ],
      },
    ],
    [
      {
        qValue: 0,
        qElemNo: -1,
        qGroupPos: 0,
        qGroupSize: 4,
        qRow: 0,
        qType: 'R',
        qValues: [],
        qNodes: [
          {
            qText: 'Central',
            qValue: 'NaN',
            qElemNo: 3,
            qGroupPos: 0,
            qGroupSize: 17,
            qRow: 0,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 0,
                qType: 'N',
                qValues: [
                  {
                    qText: '5901530.7',
                    qValue: 5901530.699999974,
                  },
                ],
                qNodes: [],
                qMaxPos: [5901530.699999974],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 1,
                qType: 'N',
                qValues: [
                  {
                    qText: '7649723.19',
                    qValue: 7649723.189999987,
                  },
                ],
                qNodes: [],
                qMaxPos: [7649723.189999987],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 2,
                qType: 'N',
                qValues: [
                  {
                    qText: '17708816',
                    qValue: 17708815.999999635,
                  },
                ],
                qNodes: [],
                qMaxPos: [17708815.999999635],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 3,
                qType: 'N',
                qValues: [
                  {
                    qText: '12700337.14',
                    qValue: 12700337.139999872,
                  },
                ],
                qNodes: [],
                qMaxPos: [12700337.139999872],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
            ],
            qMaxPos: [179940084.0499983],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Northeast',
            qValue: 'NaN',
            qElemNo: 2,
            qGroupPos: 1,
            qGroupSize: 17,
            qRow: 17,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 17,
                qType: 'N',
                qValues: [
                  {
                    qText: '3552140.8',
                    qValue: 3552140.8000000087,
                  },
                ],
                qNodes: [],
                qMaxPos: [3552140.8000000087],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 18,
                qType: 'N',
                qValues: [
                  {
                    qText: '3683383.75',
                    qValue: 3683383.750000015,
                  },
                ],
                qNodes: [],
                qMaxPos: [3683383.750000015],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 19,
                qType: 'N',
                qValues: [
                  {
                    qText: '4419972.58',
                    qValue: 4419972.580000028,
                  },
                ],
                qNodes: [],
                qMaxPos: [4419972.580000028],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 20,
                qType: 'N',
                qValues: [
                  {
                    qText: '4795309.75',
                    qValue: 4795309.750000039,
                  },
                ],
                qNodes: [],
                qMaxPos: [4795309.750000039],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
            ],
            qMaxPos: [67289558.44000022],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Southern',
            qValue: 'NaN',
            qElemNo: 1,
            qGroupPos: 2,
            qGroupSize: 17,
            qRow: 34,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 34,
                qType: 'N',
                qValues: [
                  {
                    qText: '4845822.23',
                    qValue: 4845822.229999975,
                  },
                ],
                qNodes: [],
                qMaxPos: [4845822.229999975],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 35,
                qType: 'N',
                qValues: [
                  {
                    qText: '4891342.52',
                    qValue: 4891342.520000013,
                  },
                ],
                qNodes: [],
                qMaxPos: [4891342.520000013],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 36,
                qType: 'N',
                qValues: [
                  {
                    qText: '8317136.05',
                    qValue: 8317136.049999981,
                  },
                ],
                qNodes: [],
                qMaxPos: [8317136.049999981],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 37,
                qType: 'N',
                qValues: [
                  {
                    qText: '6734701.98',
                    qValue: 6734701.979999986,
                  },
                ],
                qNodes: [],
                qMaxPos: [6734701.979999986],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
            ],
            qMaxPos: [108564205.80000006],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Western',
            qValue: 'NaN',
            qElemNo: 0,
            qGroupPos: 3,
            qGroupSize: 17,
            qRow: 51,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Alcoholic Beverages',
                qValue: 'NaN',
                qElemNo: 11,
                qGroupPos: 0,
                qGroupSize: 0,
                qRow: 51,
                qType: 'N',
                qValues: [
                  {
                    qText: '12208458.88',
                    qValue: 12208458.879999902,
                  },
                ],
                qNodes: [],
                qMaxPos: [12208458.879999902],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Baked Goods',
                qValue: 'NaN',
                qElemNo: 13,
                qGroupPos: 1,
                qGroupSize: 0,
                qRow: 52,
                qType: 'N',
                qValues: [
                  {
                    qText: '9860525.6599999',
                    qValue: 9860525.659999896,
                  },
                ],
                qNodes: [],
                qMaxPos: [9860525.659999896],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Baking Goods',
                qValue: 'NaN',
                qElemNo: 8,
                qGroupPos: 2,
                qGroupSize: 0,
                qRow: 53,
                qType: 'N',
                qValues: [
                  {
                    qText: '14107801.51',
                    qValue: 14107801.50999981,
                  },
                ],
                qNodes: [],
                qMaxPos: [14107801.50999981],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Beverages',
                qValue: 'NaN',
                qElemNo: 7,
                qGroupPos: 3,
                qGroupSize: 0,
                qRow: 54,
                qType: 'N',
                qValues: [
                  {
                    qText: '11420451.46',
                    qValue: 11420451.459999878,
                  },
                ],
                qNodes: [],
                qMaxPos: [11420451.459999878],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
            ],
            qMaxPos: [185459779.4199978],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
        ],
        qMaxPos: [],
        qMinNeg: [],
        qState: 'L',
        qTreePath: [],
      },
    ]
  )
  .add(
    // When scrolling down
    [
      '/qHyperCubeDef',
      {
        qTreeNodes: [
          {
            qArea: {
              qLeft: 0,
              qHeight: 4,
              qWidth: 1,
              qTop: 0,
            },
            qAllValues: false,
          },
          {
            qArea: {
              qLeft: 1,
              qHeight: 4,
              qWidth: 1,
              qTop: 9,
            },
            qAllValues: true,
          },
        ],
      },
    ],
    [
      {
        qValue: 0,
        qElemNo: -1,
        qGroupPos: 0,
        qGroupSize: 4,
        qRow: 0,
        qType: 'R',
        qValues: [],
        qNodes: [
          {
            qText: 'Central',
            qValue: 'NaN',
            qElemNo: 3,
            qGroupPos: 0,
            qGroupSize: 17,
            qRow: 0,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Eggs',
                qValue: 'NaN',
                qElemNo: 9,
                qGroupPos: 9,
                qGroupSize: 0,
                qRow: 9,
                qType: 'N',
                qValues: [
                  {
                    qText: '4812790.48',
                    qValue: 4812790.479999992,
                  },
                ],
                qNodes: [],
                qMaxPos: [4812790.479999992],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Frozen Foods',
                qValue: 'NaN',
                qElemNo: 0,
                qGroupPos: 10,
                qGroupSize: 0,
                qRow: 10,
                qType: 'N',
                qValues: [
                  {
                    qText: '19199469.02',
                    qValue: 19199469.01999971,
                  },
                ],
                qNodes: [],
                qMaxPos: [19199469.01999971],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Meat',
                qValue: 'NaN',
                qElemNo: 15,
                qGroupPos: 11,
                qGroupSize: 0,
                qRow: 11,
                qType: 'N',
                qValues: [
                  {
                    qText: '1600274.02',
                    qValue: 1600274.0199999993,
                  },
                ],
                qNodes: [],
                qMaxPos: [1600274.0199999993],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
              {
                qText: 'Produce',
                qValue: 'NaN',
                qElemNo: 1,
                qGroupPos: 12,
                qGroupSize: 0,
                qRow: 12,
                qType: 'N',
                qValues: [
                  {
                    qText: '24827670.76',
                    qValue: 24827670.759999745,
                  },
                ],
                qNodes: [],
                qMaxPos: [24827670.759999745],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [0],
              },
            ],
            qMaxPos: [179940084.0499983],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Northeast',
            qValue: 'NaN',
            qElemNo: 2,
            qGroupPos: 1,
            qGroupSize: 17,
            qRow: 17,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Eggs',
                qValue: 'NaN',
                qElemNo: 9,
                qGroupPos: 9,
                qGroupSize: 0,
                qRow: 26,
                qType: 'N',
                qValues: [
                  {
                    qText: '3186934.77',
                    qValue: 3186934.7700000107,
                  },
                ],
                qNodes: [],
                qMaxPos: [3186934.7700000107],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Frozen Foods',
                qValue: 'NaN',
                qElemNo: 0,
                qGroupPos: 10,
                qGroupSize: 0,
                qRow: 27,
                qType: 'N',
                qValues: [
                  {
                    qText: '5564383.38',
                    qValue: 5564383.380000005,
                  },
                ],
                qNodes: [],
                qMaxPos: [5564383.380000005],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Meat',
                qValue: 'NaN',
                qElemNo: 15,
                qGroupPos: 11,
                qGroupSize: 0,
                qRow: 28,
                qType: 'N',
                qValues: [
                  {
                    qText: '199383.46',
                    qValue: 199383.4600000002,
                  },
                ],
                qNodes: [],
                qMaxPos: [199383.4600000002],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
              {
                qText: 'Produce',
                qValue: 'NaN',
                qElemNo: 1,
                qGroupPos: 12,
                qGroupSize: 0,
                qRow: 29,
                qType: 'N',
                qValues: [
                  {
                    qText: '5951368.03',
                    qValue: 5951368.030000001,
                  },
                ],
                qNodes: [],
                qMaxPos: [5951368.030000001],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [1],
              },
            ],
            qMaxPos: [67289558.44000022],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Southern',
            qValue: 'NaN',
            qElemNo: 1,
            qGroupPos: 2,
            qGroupSize: 17,
            qRow: 34,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Eggs',
                qValue: 'NaN',
                qElemNo: 9,
                qGroupPos: 9,
                qGroupSize: 0,
                qRow: 43,
                qType: 'N',
                qValues: [
                  {
                    qText: '3617829.75',
                    qValue: 3617829.7500000047,
                  },
                ],
                qNodes: [],
                qMaxPos: [3617829.7500000047],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Frozen Foods',
                qValue: 'NaN',
                qElemNo: 0,
                qGroupPos: 10,
                qGroupSize: 0,
                qRow: 44,
                qType: 'N',
                qValues: [
                  {
                    qText: '9682650.46',
                    qValue: 9682650.460000003,
                  },
                ],
                qNodes: [],
                qMaxPos: [9682650.460000003],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Meat',
                qValue: 'NaN',
                qElemNo: 15,
                qGroupPos: 11,
                qGroupSize: 0,
                qRow: 45,
                qType: 'N',
                qValues: [
                  {
                    qText: '463779.23',
                    qValue: 463779.23,
                  },
                ],
                qNodes: [],
                qMaxPos: [463779.23],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
              {
                qText: 'Produce',
                qValue: 'NaN',
                qElemNo: 1,
                qGroupPos: 12,
                qGroupSize: 0,
                qRow: 46,
                qType: 'N',
                qValues: [
                  {
                    qText: '11644080.42',
                    qValue: 11644080.419999998,
                  },
                ],
                qNodes: [],
                qMaxPos: [11644080.419999998],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [2],
              },
            ],
            qMaxPos: [108564205.80000006],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
          {
            qText: 'Western',
            qValue: 'NaN',
            qElemNo: 0,
            qGroupPos: 3,
            qGroupSize: 17,
            qRow: 51,
            qType: 'N',
            qValues: [],
            qNodes: [
              {
                qText: 'Eggs',
                qValue: 'NaN',
                qElemNo: 9,
                qGroupPos: 9,
                qGroupSize: 0,
                qRow: 60,
                qType: 'N',
                qValues: [
                  {
                    qText: '7365290.73',
                    qValue: 7365290.729999959,
                  },
                ],
                qNodes: [],
                qMaxPos: [7365290.729999959],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Frozen Foods',
                qValue: 'NaN',
                qElemNo: 0,
                qGroupPos: 10,
                qGroupSize: 0,
                qRow: 61,
                qType: 'N',
                qValues: [
                  {
                    qText: '16762841.91',
                    qValue: 16762841.909999693,
                  },
                ],
                qNodes: [],
                qMaxPos: [16762841.909999693],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Meat',
                qValue: 'NaN',
                qElemNo: 15,
                qGroupPos: 11,
                qGroupSize: 0,
                qRow: 62,
                qType: 'N',
                qValues: [
                  {
                    qText: '617811.54',
                    qValue: 617811.5400000002,
                  },
                ],
                qNodes: [],
                qMaxPos: [617811.5400000002],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
              {
                qText: 'Produce',
                qValue: 'NaN',
                qElemNo: 1,
                qGroupPos: 12,
                qGroupSize: 0,
                qRow: 63,
                qType: 'N',
                qValues: [
                  {
                    qText: '18841175.73',
                    qValue: 18841175.729999833,
                  },
                ],
                qNodes: [],
                qMaxPos: [18841175.729999833],
                qMinNeg: [0],
                qState: 'O',
                qTreePath: [3],
              },
            ],
            qMaxPos: [185459779.4199978],
            qMinNeg: [0],
            qCanExpand: true,
            qState: 'O',
            qTreePath: [],
          },
        ],
        qMaxPos: [],
        qMinNeg: [],
        qState: 'L',
        qTreePath: [],
      },
    ]
  );

const genericObject = {
  getLayout() {
    return {
      qInfo: { qId: 'emSB', qType: 'sn-grid-chart' },
      qMeta: { privileges: ['read', 'update', 'delete', 'exportdata'] },
      qSelectionInfo: {},
      qHyperCube: {
        qSize: { qcx: 1, qcy: 68 },
        qDimensionInfo: [
          {
            qFallbackTitle: 'Region Name',
            qApprMaxGlyphCount: 9,
            qCardinal: 4,
            qSortIndicator: 'A',
            qGroupFallbackTitles: ['Region Name'],
            qGroupPos: 0,
            qStateCounts: {
              qLocked: 0,
              qSelected: 0,
              qOption: 4,
              qDeselected: 0,
              qAlternative: 0,
              qExcluded: 0,
              qSelectedExcluded: 0,
              qLockedExcluded: 0,
            },
            qTags: ['$ascii', '$text'],
            qDimensionType: 'D',
            qGrouping: 'N',
            qNumFormat: { qType: 'U', qnDec: 0, qUseThou: 0 },
            qIsAutoFormat: true,
            qGroupFieldDefs: ['Region Name'],
            qMin: 'NaN',
            qMax: 'NaN',
            qAttrExprInfo: [],
            qAttrDimInfo: [],
            qCardinalities: {
              qCardinal: 4,
              qHypercubeCardinal: 4,
              qAllValuesCardinal: 4,
            },
            qLibraryId: '561fae5e-7cea-42a7-a742-b0bb7fe63d0b',
            title: 'Region Name',
            autoSort: true,
            cId: 'sfAF',
            othersLabel: 'Others',
          },
          {
            qFallbackTitle: 'Basket Product Group Desc',
            qApprMaxGlyphCount: 19,
            qCardinal: 17,
            qSortIndicator: 'A',
            qGroupFallbackTitles: ['Basket Product Group Desc'],
            qGroupPos: 0,
            qStateCounts: {
              qLocked: 0,
              qSelected: 0,
              qOption: 17,
              qDeselected: 0,
              qAlternative: 0,
              qExcluded: 0,
              qSelectedExcluded: 0,
              qLockedExcluded: 0,
            },
            qTags: ['$ascii', '$text'],
            qDimensionType: 'D',
            qGrouping: 'N',
            qNumFormat: { qType: 'U', qnDec: 0, qUseThou: 0 },
            qIsAutoFormat: true,
            qGroupFieldDefs: ['Basket Product Group Desc'],
            qMin: 'NaN',
            qMax: 'NaN',
            qAttrExprInfo: [],
            qAttrDimInfo: [],
            qCardinalities: {
              qCardinal: 17,
              qHypercubeCardinal: 17,
              qAllValuesCardinal: 17,
            },
            qLibraryId: '3b8d4270-9fc9-47dc-b6a5-09887644b996',
            title: 'Basket Product Group Desc',
            autoSort: true,
            cId: 'YRGZKd',
            othersLabel: 'Others',
          },
        ],
        qMeasureInfo: [
          {
            qFallbackTitle: 'Sales $',
            qApprMaxGlyphCount: 11,
            qCardinal: 0,
            qSortIndicator: 'D',
            qNumFormat: {
              qType: 'R',
              qnDec: 0,
              qUseThou: 1,
              qFmt: '##############',
              qDec: '.',
              qThou: ',',
            },
            qMin: 199383.4600000002,
            qMax: 24827670.759999745,
            qIsAutoFormat: true,
            qAttrExprInfo: [],
            qAttrDimInfo: [],
            qLibraryId: 'epqAX',
            qTrendLines: [],
            autoSort: true,
            cId: 'NrxVV',
            numFormatFromTemplate: true,
          },
        ],
        qEffectiveInterColumnSortOrder: [0, 1],
        qGrandTotalRow: [],
        qDataPages: [],
        qPivotDataPages: [],
        qStackedDataPages: [],
        qMode: 'T',
        qNoOfLeftDims: 2,
        qTreeNodesOnDim: [4, 68],
        qColumnOrder: [],
      },
      showTitles: true,
      title: '',
      subtitle: '',
      footnote: '',
      disableNavMenu: false,
      showDetails: false,
      dataPoint: {
        rangeBubbleSizes: [0.1, 1],
        symbol: 'circle',
        showLabels: 'off',
      },
      color: {
        auto: true,
        mode: 'primary',
        formatting: { numFormatFromTemplate: true },
        useBaseColors: 'off',
        paletteColor: { index: 6 },
        useDimColVal: true,
        useMeasureGradient: true,
        expressionIsColor: true,
        expressionLabel: '',
        measureScheme: 'sg',
        reverseScheme: false,
        dimensionScheme: '12',
        autoMinMax: true,
        measureMin: 0,
        measureMax: 10,
      },
      legend: { show: true, dock: 'auto', showTitle: true },
      xAxis: {
        show: 'all',
        label: 'auto',
        dock: 'near',
        axisDisplayMode: 'auto',
        maxVisibleItems: 10,
        gridLines: false,
      },
      yAxis: {
        show: 'all',
        dock: 'near',
        axisDisplayMode: 'auto',
        maxVisibleItems: 10,
        gridLines: false,
      },
      visualization: 'sn-grid-chart',
      version: '1.3.2',
      extensionMeta: {
        translationKey: '',
        icon: 'grid-chart',
        iconChar: 'puzzle',
        isLibraryItem: true,
        visible: true,
        name: 'Grid chart',
        description: 'A grid from two dimensions with symbols of varying size based on a measure.',
        template: 'sn-grid-chart',
        iconPath:
          'M14.5,9 L13,9 L13,3.3 C13,3.1 12.9,3 12.7,3 L8,3 L8,1.5 C8,0.7 7.3,0 6.5,0 C5.7,0 5,0.7 5,1.5 L5,3 L0.3,3 C0.1,3 0,3.1 0,3.3 L0,9 L1.5,9 C2.3,9 3,9.7 3,10.5 C3,11.3 2.3,12 1.5,12 L0,12 L0,15.7 C0,15.9 0.1,16 0.3,16 L5,16 L5,14.5 C5,13.7 5.7,13 6.5,13 C7.3,13 8,13.7 8,14.5 L8,16 L12.7,16 C12.9,16 13,15.9 13,15.7 L13,12 L14.5,12 C15.3,12 16,11.3 16,10.5 C16,9.7 15.3,9 14.5,9 Z',
        isThirdParty: true,
        version: '1.3.2',
        author: 'QlikTech International AB',
        preview: 'assets/grid-preview.png',
        type: 'visualization',
        supernova: true,
        previewIconURL: 'http://localhost:8080/extensions/sn-grid-chart/assets/grid-preview.png',
      },
    };
  },
  getHyperCubeTreeData(...args) {
    return hyperCubeTreeData.get(...args);
  },
};

(async () => {
  const app = await EnigmaMocker.fromGenericObjects([genericObject]);
  // const nebbie = embed(app, { ... config });
})();
