Skip to content

Commit 5dd2b86

Browse files
authored
Merge pull request #365 from Dessia-tech/dev
v0.24.0
2 parents f10c6d9 + 17a95d9 commit 5dd2b86

Some content is hidden

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

41 files changed

+898
-406
lines changed

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ 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.23.0]
8+
## [0.24.0]
9+
### Add
10+
- Allow to directly specify if axes are on or off in Python
911

12+
### Fix
13+
- LineSegment2D : If it is overloaded, MPL Plot now show the right edge_style instead of generating of random one
14+
- Arc2D: mpl_plot
15+
16+
## [0.23.0]
1017
### Feat
1118
- Add events (Subject) to emit shape hovering and clicking
1219
- Highlight shapes when corresponding function is called from wrapper software
@@ -16,6 +23,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1623

1724
### Refactor
1825
- Implements InteractiveObject for handling all mouse objects in one class
26+
## [0.22.5]
27+
### Fix
28+
- Fix global bug on RemoteFigure.resize methods, fixing a browser crasher bug
29+
30+
## [0.22.4]
31+
### Fix
32+
- Fix bug on tooltip origin when mouse leaving while hovering a shape
33+
- Remove unused code
34+
- Fix html for prettier to work
35+
- Remove name from add plot feature
36+
37+
## [0.22.2]
38+
### Fix
39+
- Local import
40+
- Add tooltip on any shape with Python with Shape object
1941

2042
## [0.22.0]
2143
### Add

code_pylint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'trailing-whitespace': 11,
3636
'empty-docstring': 7,
3737
'missing-module-docstring': 4,
38-
'too-many-arguments': 20,
38+
'too-many-arguments': 24,
3939
'too-few-public-methods': 5,
4040
'unnecessary-comprehension': 5,
4141
'no-value-for-parameter': 2,

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);

cypress/e2e/remoteFigure.cy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ describe("RemoteFigure.resizeUpdate", function() {
147147
});
148148
});
149149

150+
describe("RemoteFigure.resizeWindow", function() {
151+
it("should resize figure with new window size", function() {
152+
const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id);
153+
figure.setCanvas(canvas.id);
154+
figure.resizeWindow(700, 500);
155+
expect(figure.size.x, "size.x").to.be.equal(700);
156+
expect(figure.size.y, "size.y").to.be.equal(500);
157+
});
158+
});
159+
150160
describe("RemoteFigure.reset", function() {
151161
it("should reset scales and selectors", function() {
152162
const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id);

cypress/e2e/visualRegressions.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const FIGURES_DATA = [
1515
{ name: "parallelplot", data: parallelPlotData, threshold: 0.05 },
1616
{ name: "plotscatter", data: plotScatterData, threshold: 0.05 },
1717
{ name: "primitivegroupcontainer", data: primitiveGroupContainerData, threshold: 0.05 },
18-
{ name: "scattermatrix", data: scattermatrixData, threshold: 0.07 },
18+
{ name: "scattermatrix", data: scattermatrixData, threshold: 0.08 },
1919
{ name: "simpleshapes", data: simpleshapesData, threshold: 0.05 },
2020
{ name: "textscaling", data: textscalingData, threshold: 0.05 },
2121
{ name: "multiplot", data: multiplotData, threshold: 0.05 }
@@ -77,11 +77,11 @@ FIGURES_DATA.forEach(figureData => {
7777
it("should hover line even if mouse is not exactly on line", function () {
7878
cy.window().then((win) => {
7979
const draw = win.eval('plot_data');
80-
let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 814, "offsetY": 196} as MouseEvent);
80+
let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 809, "offsetY": 196} as MouseEvent);
8181
draw.castMouseMove(canvasMouse, frameMouse, mouseCoords);
8282
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;
8383

84-
[canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 822, "offsetY": 196} as MouseEvent);
84+
[canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 816, "offsetY": 196} as MouseEvent);
8585
draw.castMouseMove(canvasMouse, frameMouse, mouseCoords);
8686
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;
8787
});
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Loading
Lines changed: 2 additions & 2 deletions
Loading
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
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

cypress/templates/emptyMultiplot.template.html

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,83 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<style>
4-
.slider {
5-
-webkit-appearance: none;
6-
height: 10px;
7-
background: #d3d3d3;
8-
outline: none;
9-
opacity: 0.7;
10-
-webkit-transition: .2s;
11-
transition: opacity .2s;
12-
}
13-
14-
.slider:hover {
15-
opacity: 1;
16-
}
17-
18-
.slider::-moz-range-thumb {
19-
width: 25px;
20-
height: 10px;
21-
background: #04AA6D;
22-
cursor: pointer;
23-
}
4+
.slider {
5+
-webkit-appearance: none;
6+
height: 10px;
7+
background: #d3d3d3;
8+
outline: none;
9+
opacity: 0.7;
10+
-webkit-transition: .2s;
11+
transition: opacity .2s;
12+
}
13+
14+
.slider:hover {
15+
opacity: 1;
16+
}
17+
18+
.slider::-moz-range-thumb {
19+
width: 25px;
20+
height: 10px;
21+
background: #04AA6D;
22+
cursor: pointer;
23+
}
24+
25+
#buttons {
26+
display: flex;
27+
column-gap: 3rem;
28+
row-gap: 0.5em;
29+
flex-wrap: wrap;
30+
margin-bottom: 0.5rem;
31+
margin-top: 1rem;
32+
margin: 0 auto;
33+
}
34+
35+
#sub_button {
36+
display: flex;
37+
gap: 0.5rem;
38+
flex-wrap: wrap;
39+
}
2440
</style>
2541
<head>
2642
<script src=$core_path></script>
2743
</head>
2844
<div id="buttons">
29-
<button name="mergeON" value="OK" type="button" onclick="plot_data.switchMerge()"> Switch Point Merge </button> &nbsp;&nbsp;
30-
<button name="Zoom" value="OK" type="button" onclick="plot_data.switchZoom()"> Zoom Box </button>
31-
<button name="Zoom+" value="OK" type="button" onclick="plot_data.zoomIn()"> Zoom+ </button>
32-
<button name="Zoom-" value="OK" type="button" onclick="plot_data.zoomOut()"> Zoom- </button> &nbsp;&nbsp;
33-
Cluster:&nbsp; <input type="range" class="slider" min="0" max="2500" value="1250" onclick="plot_data.simpleCluster(value / 10000)"></input>
34-
<button name="resetClusters" value="OK" type="button" onclick="plot_data.resetClusters()"> Reset clusters </button> &nbsp;&nbsp;
35-
<button name="resetView" value="OK" type="button" onclick="plot_data.resetView()"> Reset view </button>
36-
<button name="showPoints" value="OK" type="button" onclick="plot_data.togglePoints()"> Show points </button>
37-
<button name="switchOrientation" value="OK" type="button" onclick="plot_data.switchOrientation()"> Change Disposition </button>
38-
<button name="toogleAxes" value="OK" type="button" onclick="plot_data.htmlToggleAxes()"> Show / Hide Axes </button>
39-
<hr style="border-top: 2px;">
45+
<div id="sub_button">
46+
<button name="mergeON" value="OK" type="button"
47+
onclick="plot_data.switchMerge()"> Switch Point Merge </button>
48+
</div>
49+
<div id="sub_button">
50+
<button name="Zoom" value="OK" type="button"
51+
onclick="plot_data.switchZoom()"> Zoom Box </button>
52+
<button name="Zoom+" value="OK" type="button" onclick="plot_data.zoomIn()"> Zoom+ </button>
53+
<button name="Zoom-" value="OK" type="button" onclick="plot_data.zoomOut()"> Zoom- </button>
54+
</div>
55+
<div id="sub_button">
56+
Cluster: <input type="range" class="slider" min="0" max="2500" value="1250"
57+
onclick="plot_data.simpleCluster(value / 10000)"/>
58+
<button name="resetClusters" value="OK" type="button"
59+
onclick="plot_data.resetClusters()"> Reset clusters </button>
60+
</div>
61+
<div id="sub_button">
62+
<button name="resetView" value="OK" type="button"
63+
onclick="plot_data.resetView()"> Reset view </button>
64+
<button name="showPoints" value="OK" type="button"
65+
onclick="plot_data.togglePoints()"> Show points </button>
66+
<button name="switchOrientation" value="OK" type="button"
67+
onclick="plot_data.switchOrientation()"> Change Disposition </button>
68+
<button name="toogleAxes" value="OK" type="button"
69+
onclick="plot_data.htmlToggleAxes()"> Show / Hide Axes </button>
70+
<button name="logScale" value="OK" type="button"
71+
onclick="plot_data.switchLogScale()"> Log Scale</button>
72+
</div>
73+
74+
<div id="sub_button">
75+
<button name="resize" value="OK" type="button" onclick="plot_data.switchResize()"> Resize Figures </button>
76+
<button name="resizeMP" value="OK" type="button"
77+
onclick="plot_data.resize(...PlotData.computeCanvasSize('#buttons'))"> Resize Multiplot </button>
78+
</div>
4079
</div>
80+
<hr style="border-top: 2px;"/>
4181
<div id="app">
4282
<canvas id="$canvas_id" width="$width" height="$height" style="border: 1px solid black;"></canvas>
4383

0 commit comments

Comments
 (0)