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

const genericObject = {
  getLayout: {
    qInfo: {
      qId: '454d4be2-603e-487e-98ae-2ada9f851694',
      qType: 'sn-grid-chart',
    },
    qMeta: {
      privileges: ['read', 'update', 'delete', 'exportdata'],
    },
    qSelectionInfo: {},
    qHyperCube: {
      qSize: {
        qcx: 1,
        qcy: 8,
      },
      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,
          },
          autoSort: true,
          cId: 'TuJeyHR',
          othersLabel: 'Others',
        },
        {
          qFallbackTitle: 'Year',
          qApprMaxGlyphCount: 4,
          qCardinal: 2,
          qSortIndicator: 'A',
          qGroupFallbackTitles: ['Year'],
          qGroupPos: 0,
          qStateCounts: {
            qLocked: 0,
            qSelected: 0,
            qOption: 2,
            qDeselected: 0,
            qAlternative: 0,
            qExcluded: 0,
            qSelectedExcluded: 0,
            qLockedExcluded: 0,
          },
          qTags: ['$numeric', '$integer'],
          qDimensionType: 'N',
          qGrouping: 'N',
          qNumFormat: {
            qType: 'I',
            qnDec: 0,
            qUseThou: 0,
            qFmt: '###0',
            qDec: '.',
            qThou: ',',
          },
          qIsAutoFormat: true,
          qGroupFieldDefs: ['Year'],
          qMin: 2006,
          qMax: 2007,
          qContinuousAxes: true,
          qAttrExprInfo: [
            {
              qMin: 3264199.3800000213,
              qMax: 25219232.68999985,
              qFallbackTitle: 'Sum([Sales Amount])',
              qMinText: '3264199.38',
              qMaxText: '25219232.69',
              qNumFormat: {
                qType: 'U',
                qnDec: 0,
                qUseThou: 0,
              },
              qIsAutoFormat: true,
              id: 'colorByAlternative',
              label: 'Sum([Sales Amount])',
            },
          ],
          qAttrDimInfo: [],
          qCardinalities: {
            qCardinal: 2,
            qHypercubeCardinal: 2,
            qAllValuesCardinal: 2,
          },
          autoSort: true,
          cId: 'rLUq',
          othersLabel: 'Others',
        },
      ],
      qMeasureInfo: [
        {
          qFallbackTitle: 'Sum([Sales Amount])',
          qApprMaxGlyphCount: 11,
          qCardinal: 0,
          qSortIndicator: 'D',
          qNumFormat: {
            qType: 'U',
            qnDec: 0,
            qUseThou: 0,
          },
          qMin: 3264199.3800000213,
          qMax: 25219232.68999985,
          qIsAutoFormat: true,
          qAttrExprInfo: [],
          qAttrDimInfo: [],
          qTrendLines: [],
          autoSort: true,
          cId: 'ZPyHqLs',
          numFormatFromTemplate: true,
        },
      ],
      qEffectiveInterColumnSortOrder: [0, 1],
      qGrandTotalRow: [],
      qTreeDataPages: [],
      qDataPages: [],
      qPivotDataPages: [],
      qStackedDataPages: [],
      qMode: 'T',
      qNoOfLeftDims: 2,
      qTreeNodesOnDim: [4, 8],
      qColumnOrder: [],
    },
    showTitles: true,
    title: '',
    subtitle: '',
    footnote: '',
    disableNavMenu: false,
    showDetails: false,
    dataPoint: {
      rangeBubbleSizes: [0.15, 1],
    },
    color: {
      auto: false,
      mode: 'byMeasure',
      formatting: {
        numFormatFromTemplate: true,
      },
      useBaseColors: 'off',
      paletteColor: {
        index: 6,
      },
      useDimColVal: true,
      useMeasureGradient: true,
      expressionIsColor: true,
      expressionLabel: '',
      measureScheme: 'sc',
      reverseScheme: true,
      dimensionScheme: '12',
      autoMinMax: true,
      measureMin: 0,
      measureMax: 10,
      altLabel: 'Sum([Sales Amount])',
      byMeasureDef: {
        label: 'Sum([Sales Amount])',
        key: 'Sum([Sales Amount])',
        type: 'expression',
      },
    },
    legend: {
      show: true,
      dock: 'top',
      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: '0.1.0',
    extensionMeta: {
      translationKey: '',
      icon: 'GridChart',
      iconChar: 'puzzle',
      isLibraryItem: true,
      visible: true,
      name: 'Grid chart',
      description: 'A grid from two dimensions with markers 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,
      author: 'QlikTech International AB',
      preview: 'assets/grid-preview.png',
      supernova: true,
      type: 'visualization',
      version: '0.1.0',
      previewIconURL: 'https://rd-pnr-mast5881.rdlund.qliktech.com/extensions/sn-grid-chart/assets/grid-preview.png',
    },
  },
  getHyperCubeTreeData: [
    {
      qValue: 0,
      qElemNo: -1,
      qGroupPos: 0,
      qGroupSize: 4,
      qRow: 0,
      qType: 'R',
      qValues: [],
      qNodes: [
        {
          qText: 'Central',
          qValue: 'NaN',
          qElemNo: 3,
          qGroupPos: 0,
          qGroupSize: 2,
          qRow: 0,
          qType: 'N',
          qValues: [],
          qNodes: [
            {
              qText: '2006',
              qValue: 2006,
              qElemNo: 1,
              qGroupPos: 0,
              qGroupSize: 0,
              qRow: 0,
              qType: 'N',
              qValues: [
                {
                  qText: '25219232.69',
                  qValue: 25219232.68999985,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '25219232.69',
                    qNum: 25219232.68999985,
                  },
                ],
              },
              qMaxPos: [25219232.68999985],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [0],
            },
            {
              qText: '2007',
              qValue: 2007,
              qElemNo: 0,
              qGroupPos: 1,
              qGroupSize: 0,
              qRow: 1,
              qType: 'N',
              qValues: [
                {
                  qText: '21592023.92',
                  qValue: 21592023.91999996,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '21592023.92',
                    qNum: 21592023.91999996,
                  },
                ],
              },
              qMaxPos: [21592023.91999996],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [0],
            },
          ],
          qMaxPos: [46811256.609999806],
          qMinNeg: [0],
          qCanExpand: true,
          qState: 'O',
          qTreePath: [],
        },
        {
          qText: 'Northeast',
          qValue: 'NaN',
          qElemNo: 2,
          qGroupPos: 1,
          qGroupSize: 2,
          qRow: 2,
          qType: 'N',
          qValues: [],
          qNodes: [
            {
              qText: '2006',
              qValue: 2006,
              qElemNo: 1,
              qGroupPos: 0,
              qGroupSize: 0,
              qRow: 2,
              qType: 'N',
              qValues: [
                {
                  qText: '3264199.38',
                  qValue: 3264199.3800000213,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '3264199.38',
                    qNum: 3264199.3800000213,
                  },
                ],
              },
              qMaxPos: [3264199.3800000213],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [1],
            },
            {
              qText: '2007',
              qValue: 2007,
              qElemNo: 0,
              qGroupPos: 1,
              qGroupSize: 0,
              qRow: 3,
              qType: 'N',
              qValues: [
                {
                  qText: '3961020.43',
                  qValue: 3961020.429999986,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '3961020.43',
                    qNum: 3961020.429999986,
                  },
                ],
              },
              qMaxPos: [3961020.429999986],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [1],
            },
          ],
          qMaxPos: [7225219.810000008],
          qMinNeg: [0],
          qCanExpand: true,
          qState: 'O',
          qTreePath: [],
        },
        {
          qText: 'Southern',
          qValue: 'NaN',
          qElemNo: 1,
          qGroupPos: 2,
          qGroupSize: 2,
          qRow: 4,
          qType: 'N',
          qValues: [],
          qNodes: [
            {
              qText: '2006',
              qValue: 2006,
              qElemNo: 1,
              qGroupPos: 0,
              qGroupSize: 0,
              qRow: 4,
              qType: 'N',
              qValues: [
                {
                  qText: '11512061.4',
                  qValue: 11512061.400000045,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '11512061.4',
                    qNum: 11512061.400000045,
                  },
                ],
              },
              qMaxPos: [11512061.400000045],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [2],
            },
            {
              qText: '2007',
              qValue: 2007,
              qElemNo: 0,
              qGroupPos: 1,
              qGroupSize: 0,
              qRow: 5,
              qType: 'N',
              qValues: [
                {
                  qText: '9234765.18',
                  qValue: 9234765.179999989,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '9234765.18',
                    qNum: 9234765.179999989,
                  },
                ],
              },
              qMaxPos: [9234765.179999989],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [2],
            },
          ],
          qMaxPos: [20746826.580000035],
          qMinNeg: [0],
          qCanExpand: true,
          qState: 'O',
          qTreePath: [],
        },
        {
          qText: 'Western',
          qValue: 'NaN',
          qElemNo: 0,
          qGroupPos: 3,
          qGroupSize: 2,
          qRow: 6,
          qType: 'N',
          qValues: [],
          qNodes: [
            {
              qText: '2006',
              qValue: 2006,
              qElemNo: 1,
              qGroupPos: 0,
              qGroupSize: 0,
              qRow: 6,
              qType: 'N',
              qValues: [
                {
                  qText: '12552547.3',
                  qValue: 12552547.30000001,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '12552547.3',
                    qNum: 12552547.30000001,
                  },
                ],
              },
              qMaxPos: [12552547.30000001],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [3],
            },
            {
              qText: '2007',
              qValue: 2007,
              qElemNo: 0,
              qGroupPos: 1,
              qGroupSize: 0,
              qRow: 7,
              qType: 'N',
              qValues: [
                {
                  qText: '11336751.17',
                  qValue: 11336751.170000054,
                },
              ],
              qNodes: [],
              qAttrExps: {
                qValues: [
                  {
                    qText: '11336751.17',
                    qNum: 11336751.170000054,
                  },
                ],
              },
              qMaxPos: [11336751.170000054],
              qMinNeg: [0],
              qState: 'O',
              qTreePath: [3],
            },
          ],
          qMaxPos: [23889298.470000066],
          qMinNeg: [0],
          qCanExpand: true,
          qState: 'O',
          qTreePath: [],
        },
      ],
      qMaxPos: [],
      qMinNeg: [],
      qState: 'L',
      qTreePath: [],
    },
  ],
};

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