(gd)
| 52 | } |
| 53 | |
| 54 | function checkParcatsModelView(gd) { |
| 55 | var fullLayout = gd._fullLayout; |
| 56 | var size = fullLayout._size; |
| 57 | |
| 58 | // Make sure we have a 512x512 area for traces |
| 59 | expect(size.h).toEqual(512); |
| 60 | expect(size.w).toEqual(512); |
| 61 | |
| 62 | /** @type {ParcatsViewModel} */ |
| 63 | var parcatsViewModel = d3Select('g.trace.parcats').datum(); |
| 64 | |
| 65 | // Check location/size of this trace inside overall traces area |
| 66 | expect(parcatsViewModel.x).toEqual(64 + margin.r); |
| 67 | expect(parcatsViewModel.y).toEqual(128 + margin.t); |
| 68 | expect(parcatsViewModel.width).toEqual(256); |
| 69 | expect(parcatsViewModel.height).toEqual(256); |
| 70 | |
| 71 | // Check location of dimensions |
| 72 | expect(parcatsViewModel.dimensions[0].x).toEqual(categoryLabelPad); |
| 73 | expect(parcatsViewModel.dimensions[0].y).toEqual(0); |
| 74 | |
| 75 | expect(parcatsViewModel.dimensions[1].x).toEqual(categoryLabelPad + dimDx); |
| 76 | expect(parcatsViewModel.dimensions[1].y).toEqual(0); |
| 77 | |
| 78 | expect(parcatsViewModel.dimensions[2].x).toEqual(categoryLabelPad + 2 * dimDx); |
| 79 | expect(parcatsViewModel.dimensions[2].y).toEqual(0); |
| 80 | |
| 81 | // Check location of categories |
| 82 | /** @param {Array.<CategoryViewModel>} categories */ |
| 83 | function checkCategoryPositions(categories) { |
| 84 | var nextY = (3 - categories.length) * catSpacing / 2; |
| 85 | for(var c = 0; c < categories.length; c++) { |
| 86 | expect(categories[c].y).toEqual(nextY); |
| 87 | nextY += categories[c].height + catSpacing; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | checkCategoryPositions(parcatsViewModel.dimensions[0].categories); |
| 92 | checkCategoryPositions(parcatsViewModel.dimensions[1].categories); |
| 93 | checkCategoryPositions(parcatsViewModel.dimensions[2].categories); |
| 94 | } |
| 95 | |
| 96 | function checkParcatsSvg(gd) { |
| 97 | var fullLayout = gd._fullLayout; |
no test coverage detected
searching dependent graphs…