Skip to content

Commit 90c0cb7

Browse files
committed
fix(axis_on): fix tests
1 parent e4a7726 commit 90c0cb7

8 files changed

Lines changed: 23 additions & 18 deletions

cypress/e2e/figures.cy.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ describe("Figure", function() {
3535
{ "name": "", "cx": 3, "cy": 3, "type_": "point" },
3636
{ "name": "", "cx": 8, "cy": 3, "type_": "point" },
3737
{ "name": "", "data": [66, 11.5, 73, 11.5], "point1": [66, 11.5], "point2": [73, 11.5], "type_": "linesegment2d" }
38-
]
38+
],
39+
"axis_on": true
3940
};
4041

4142
it('should create a new instance of Figure from multiplot data with valid arguments', function() {
@@ -209,7 +210,8 @@ describe("Histogram", function() {
209210
{ "name": "", "values": { "x": 3, "y": 2 }, "x": 3, "y": 2 },
210211
{ "name": "", "values": { "x": 4, "y": 3 }, "x": 4, "y": 3 }
211212
],
212-
"type_": "histogram"
213+
"type_": "histogram",
214+
"axis_on": true
213215
};
214216
const histogram = new Histogram(data, canvas.width, canvas.height, 0, 0, canvasID, false);
215217
histogram.setCanvas(canvas.id);
@@ -270,7 +272,8 @@ describe("Scatter", function() {
270272
{ "name": "", "values": { "x": 3, "y": 2 }, "x": 3, "y": 2 },
271273
{ "name": "", "values": { "x": 4, "y": 3 }, "x": 4, "y": 3 }
272274
],
273-
"type_": "scatterplot"
275+
"type_": "scatterplot",
276+
"axis_on": true
274277
}
275278
const scatter = new Scatter(data, canvas.width, canvas.height, 0, 0, canvasID, false);
276279
const frameMatrix = new DOMMatrix([
@@ -334,7 +337,8 @@ describe("Graph2D", function() {
334337
]
335338
},
336339
],
337-
"type_": "graph2d"
340+
"type_": "graph2d",
341+
"axis_on": true
338342
}
339343
const graph = new Graph2D(data, canvas.width, canvas.height, 0, 0, canvasID, false);
340344

@@ -366,7 +370,8 @@ describe("ParallelPlot", function() {
366370
{ "name": "", "values": { "x": 3, "y": 2, "z": 2 }, "x": 3, "y": 2, "z": 2 },
367371
{ "name": "", "values": { "x": 4, "y": 3, "z": 5 }, "x": 4, "y": 3, "z": 5 }
368372
],
369-
"type_": "parallelplot"
373+
"type_": "parallelplot",
374+
"axis_on": true
370375
}
371376
const parallelplot = new ParallelPlot(data, canvas.width, canvas.height, 0, 0, canvasID, false);
372377
parallelplot.setCanvas(canvas.id);
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

src/remoteFigure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class RemoteFigure extends Rect {
118118

119119
protected unpackData(data: any): Map<string, any[]> { return RemoteFigure.deserializeData(data) }
120120

121-
protected setAxisVisibility(data: DataInterface): void { if (!data.axis_on) this.toggleAxesVisibility() }
121+
protected setAxisVisibility(data: DataInterface): void { this.axes.forEach(axis => axis.visible = data.axis_on) }
122122

123123
public serializeFeatures(): any {
124124
const elements = [];

0 commit comments

Comments
 (0)