Skip to content

Commit f39755a

Browse files
authored
Merge pull request #318 from Dessia-tech/dev
v0.19.0
2 parents 5b665aa + 50c4f69 commit f39755a

45 files changed

Lines changed: 3602 additions & 9564 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.19.0]
9+
### Fixes
10+
- Multiplot Drawing
11+
812
## [0.18.0]
913
### Add
1014
- Draw to replace PrimitiveGroups

cypress/e2e/histogram.cy.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseHTML } from '../support/parseHTML';
22
import histogramData from '../data_src/histogram.data.json';
33
import { Frame, Histogram } from '../../src/subplots';
4-
import { Vertex, newPoint2D } from '../../src/utils';
4+
import { Vertex } from '../../src/utils';
55

66
const FEATURE_NAME = "histogram"
77

@@ -13,18 +13,14 @@ function initRubberBand(frame: Frame) {
1313
frame.draw();
1414
}
1515

16-
before(() => {
17-
parseHTML(FEATURE_NAME, histogramData)
18-
})
16+
before(() => parseHTML(FEATURE_NAME, histogramData));
1917

2018
describe('HISTOGRAM CANVAS', function () {
21-
const describeTitle = this.title + ' -- '
22-
beforeEach(() => {
23-
cy.visit("cypress/html_files/" + FEATURE_NAME + ".html");
24-
})
19+
const describeTitle = this.title + ' -- ';
20+
beforeEach(() => cy.visit("cypress/html_files/" + FEATURE_NAME + ".html"));
2521

2622
it("should draw canvas", function () {
27-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
23+
cy.compareSnapshot(describeTitle + this.test.title, 0.06);
2824
})
2925

3026
it("should select with rubber band", function () {
@@ -43,7 +39,7 @@ describe('HISTOGRAM CANVAS', function () {
4339
it("should project mouse", function () {
4440
cy.window().then(win => {
4541
const histogram = win.eval('plot_data') as Histogram;
46-
[canvasMouse, frameMouse, mouseCoords] = histogram.projectMouse({"offsetX": 291, "offsetY": 601} as MouseEvent);
42+
[canvasMouse, frameMouse, mouseCoords] = histogram.projectMouse({"offsetX": 286, "offsetY": 622} as MouseEvent);
4743
expect(frameMouse.x).to.closeTo(3737, 10);
4844
})
4945
})
@@ -55,12 +51,12 @@ describe('HISTOGRAM CANVAS', function () {
5551

5652
histogram.mouseMove(canvasMouse, frameMouse, mouseCoords);
5753
[canvasDown, frameDown, clickedObject] = histogram.mouseDown(canvasMouse, frameMouse, mouseCoords);
58-
clickedObject.mouseMove(histogram.context_show, mouseCoords.add(new Vertex(200, 200)));
54+
clickedObject.mouseMove(histogram.context, mouseCoords.add(new Vertex(200, 200)));
5955
histogram.draw()
6056
const selectedBars = histogram.bars.reduce((sum, current) => sum + (current.isSelected ? 1 : 0), 0);
6157

62-
expect(histogram.axes[0].rubberBand.minValue).to.closeTo(4311, 10);
63-
expect(histogram.axes[0].rubberBand.maxValue).to.closeTo(10211, 10);
58+
expect(histogram.axes[0].rubberBand.minValue).to.closeTo(4291, 10);
59+
expect(histogram.axes[0].rubberBand.maxValue).to.closeTo(10191, 10);
6460
expect(selectedBars).to.equal(5);
6561
})
6662
})

cypress/e2e/multiplot.cy.ts

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { parseHTML } from '../support/parseHTML';
2-
import { MultiplePlots } from '../../src/multiplots';
32
import multiplotData from '../data_src/multiplot.data.json';
43
import primitiveGroupContainerData from '../data_src/primitivegroupcontainer.data.json';
54

@@ -24,62 +23,35 @@ describe('MULTIPLOT CANVAS', function () {
2423
it("should draw canvas", function () {
2524
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
2625
})
26+
//TODO: Removed because methods are removed because they don't seem useful to me but kept to remember they were tested
27+
// it("should remove primitive group from container in multiplot", function () {
28+
// cy.window().then((win) => {
29+
// win.eval('plot_data').remove_all_primitive_groups_from_container(6);
30+
// cy.compareSnapshot(describeTitle + this.test.title, 0.05);
31+
// })
32+
// })
2733

28-
it("should remove primitive group from container in multiplot", function () {
29-
cy.window().then((win) => {
30-
win.eval('plot_data').remove_all_primitive_groups_from_container(6);
31-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
32-
})
33-
})
34-
35-
it("should add primitive group container in multiplot", function () {
36-
cy.window().its('plot_data').then((plot_data) => {
37-
plot_data.add_primitive_group_container(primitiveGroupContainerData, [], null)
38-
cy.wrap('plot_data').as('plot_data')
39-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
40-
})
41-
})
34+
// it("should add primitive group container in multiplot", function () {
35+
// cy.window().its('plot_data').then((plot_data) => {
36+
// plot_data.add_primitive_group_container(primitiveGroupContainerData, [], null)
37+
// cy.wrap('plot_data').as('plot_data')
38+
// cy.compareSnapshot(describeTitle + this.test.title, 0.05);
39+
// })
40+
// })
4241

43-
it("should reorder all plots in canvas", function () {
44-
cy.window().then((win) => {
45-
let plot_data = win.eval('plot_data')
46-
plot_data.add_primitive_group_container(primitiveGroupContainerData, [], null)
47-
plot_data.click_on_view_action()
48-
plot_data.click_on_view_action()
49-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
50-
})
51-
})
42+
// it("should reorder all plots in canvas", function () {
43+
// cy.window().then((win) => {
44+
// let plot_data = win.eval('plot_data')
45+
// plot_data.add_primitive_group_container(primitiveGroupContainerData, [], null)
46+
// plot_data.click_on_view_action()
47+
// plot_data.click_on_view_action()
48+
// cy.compareSnapshot(describeTitle + this.test.title, 0.05);
49+
// })
50+
// })
5251

5352
it("should draw a canvas with text of empty data", function () {
5453
parseHTML("emptyMultiplot", {})
5554
cy.visit("cypress/html_files/emptyMultiplot.html");
5655
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
5756
})
58-
59-
// describe('MULTIPLOT FRONTEND INTERFACE', () => {
60-
// it("should return a list of 10 points", () => {
61-
// cy.window().then((win) => {
62-
// let plot_data = win.eval('plot_data')
63-
64-
// })
65-
// })
66-
// it("should return a list of 10 points", () => {
67-
// cy.window().then((win) => {
68-
// let plot_data = win.eval('plot_data')
69-
70-
// })
71-
// })
72-
// it("should return a list of 10 points", () => {
73-
// cy.window().then((win) => {
74-
// let plot_data = win.eval('plot_data')
75-
76-
// })
77-
// })
78-
// it("should return a list of 10 points", () => {
79-
// cy.window().then((win) => {
80-
// let plot_data = win.eval('plot_data')
81-
82-
// })
83-
// })
84-
// })
8557
})

cypress/e2e/plotscatter.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ describe('PLOT SCATTER CANVAS', function () {
1414
})
1515

1616
it("should draw canvas", function () {
17-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
17+
cy.compareSnapshot(describeTitle + this.test.title, 0.1);
1818
})
1919
})

cypress/e2e/scattermatrix.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ describe('PLOT SCATTER MATRIX CANVAS', function () {
1414
})
1515

1616
it("should draw canvas", function () {
17-
cy.compareSnapshot(describeTitle + this.test.title, 0.05);
17+
cy.compareSnapshot(describeTitle + this.test.title, 0.07);
1818
})
1919
})

cypress/e2e/simpleshapes.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ describe('SIMPLE SHAPES CANVAS', function () {
4040
})
4141
})
4242

43-
it("should be hovered near line", function () {
43+
it("should hover line even if mouse is not exactly on line", function () {
4444
cy.window().then((win) => {
4545
const draw = win.eval('plot_data');
46-
const [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 804, "offsetY": 204} as MouseEvent);
46+
let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 814, "offsetY": 196} as MouseEvent);
47+
draw.mouseMove(canvasMouse, frameMouse, mouseCoords);
48+
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;
49+
50+
[canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 822, "offsetY": 196} as MouseEvent);
4751
draw.mouseMove(canvasMouse, frameMouse, mouseCoords);
4852
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;
4953
})
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

0 commit comments

Comments
 (0)