diff --git a/CHANGELOG.md b/CHANGELOG.md index 2af509d0..84a605ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.23.0] +## [0.24.0] +### Add +- Allow to directly specify if axes are on or off in Python +### Fix +- LineSegment2D : If it is overloaded, MPL Plot now show the right edge_style instead of generating of random one +- Arc2D: mpl_plot + +## [0.23.0] ### Feat - Add events (Subject) to emit shape hovering and clicking - 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 ### Refactor - Implements InteractiveObject for handling all mouse objects in one class +## [0.22.5] +### Fix +- Fix global bug on RemoteFigure.resize methods, fixing a browser crasher bug + +## [0.22.4] +### Fix +- Fix bug on tooltip origin when mouse leaving while hovering a shape +- Remove unused code +- Fix html for prettier to work +- Remove name from add plot feature + +## [0.22.2] +### Fix +- Local import +- Add tooltip on any shape with Python with Shape object ## [0.22.0] ### Add diff --git a/code_pylint.py b/code_pylint.py index cc09dbae..62a31ce2 100644 --- a/code_pylint.py +++ b/code_pylint.py @@ -35,7 +35,7 @@ 'trailing-whitespace': 11, 'empty-docstring': 7, 'missing-module-docstring': 4, - 'too-many-arguments': 20, + 'too-many-arguments': 24, 'too-few-public-methods': 5, 'unnecessary-comprehension': 5, 'no-value-for-parameter': 2, diff --git a/cypress/e2e/figures.cy.ts b/cypress/e2e/figures.cy.ts index 472f9b94..6e57f5c8 100644 --- a/cypress/e2e/figures.cy.ts +++ b/cypress/e2e/figures.cy.ts @@ -35,7 +35,8 @@ describe("Figure", function() { { "name": "", "cx": 3, "cy": 3, "type_": "point" }, { "name": "", "cx": 8, "cy": 3, "type_": "point" }, { "name": "", "data": [66, 11.5, 73, 11.5], "point1": [66, 11.5], "point2": [73, 11.5], "type_": "linesegment2d" } - ] + ], + "axis_on": true }; it('should create a new instance of Figure from multiplot data with valid arguments', function() { @@ -209,7 +210,8 @@ describe("Histogram", function() { { "name": "", "values": { "x": 3, "y": 2 }, "x": 3, "y": 2 }, { "name": "", "values": { "x": 4, "y": 3 }, "x": 4, "y": 3 } ], - "type_": "histogram" + "type_": "histogram", + "axis_on": true }; const histogram = new Histogram(data, canvas.width, canvas.height, 0, 0, canvasID, false); histogram.setCanvas(canvas.id); @@ -270,7 +272,8 @@ describe("Scatter", function() { { "name": "", "values": { "x": 3, "y": 2 }, "x": 3, "y": 2 }, { "name": "", "values": { "x": 4, "y": 3 }, "x": 4, "y": 3 } ], - "type_": "scatterplot" + "type_": "scatterplot", + "axis_on": true } const scatter = new Scatter(data, canvas.width, canvas.height, 0, 0, canvasID, false); const frameMatrix = new DOMMatrix([ @@ -334,7 +337,8 @@ describe("Graph2D", function() { ] }, ], - "type_": "graph2d" + "type_": "graph2d", + "axis_on": true } const graph = new Graph2D(data, canvas.width, canvas.height, 0, 0, canvasID, false); @@ -366,7 +370,8 @@ describe("ParallelPlot", function() { { "name": "", "values": { "x": 3, "y": 2, "z": 2 }, "x": 3, "y": 2, "z": 2 }, { "name": "", "values": { "x": 4, "y": 3, "z": 5 }, "x": 4, "y": 3, "z": 5 } ], - "type_": "parallelplot" + "type_": "parallelplot", + "axis_on": true } const parallelplot = new ParallelPlot(data, canvas.width, canvas.height, 0, 0, canvasID, false); parallelplot.setCanvas(canvas.id); diff --git a/cypress/e2e/remoteFigure.cy.ts b/cypress/e2e/remoteFigure.cy.ts index f745ab71..e1e13d6a 100644 --- a/cypress/e2e/remoteFigure.cy.ts +++ b/cypress/e2e/remoteFigure.cy.ts @@ -147,6 +147,16 @@ describe("RemoteFigure.resizeUpdate", function() { }); }); +describe("RemoteFigure.resizeWindow", function() { + it("should resize figure with new window size", function() { + const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id); + figure.setCanvas(canvas.id); + figure.resizeWindow(700, 500); + expect(figure.size.x, "size.x").to.be.equal(700); + expect(figure.size.y, "size.y").to.be.equal(500); + }); +}); + describe("RemoteFigure.reset", function() { it("should reset scales and selectors", function() { const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id); diff --git a/cypress/e2e/visualRegressions.cy.ts b/cypress/e2e/visualRegressions.cy.ts index b51f9e0d..6fee2e1b 100644 --- a/cypress/e2e/visualRegressions.cy.ts +++ b/cypress/e2e/visualRegressions.cy.ts @@ -15,7 +15,7 @@ const FIGURES_DATA = [ { name: "parallelplot", data: parallelPlotData, threshold: 0.05 }, { name: "plotscatter", data: plotScatterData, threshold: 0.05 }, { name: "primitivegroupcontainer", data: primitiveGroupContainerData, threshold: 0.05 }, - { name: "scattermatrix", data: scattermatrixData, threshold: 0.07 }, + { name: "scattermatrix", data: scattermatrixData, threshold: 0.08 }, { name: "simpleshapes", data: simpleshapesData, threshold: 0.05 }, { name: "textscaling", data: textscalingData, threshold: 0.05 }, { name: "multiplot", data: multiplotData, threshold: 0.05 } @@ -77,11 +77,11 @@ FIGURES_DATA.forEach(figureData => { it("should hover line even if mouse is not exactly on line", function () { cy.window().then((win) => { const draw = win.eval('plot_data'); - let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 814, "offsetY": 196} as MouseEvent); + let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 809, "offsetY": 196} as MouseEvent); draw.castMouseMove(canvasMouse, frameMouse, mouseCoords); expect(draw.relativeObjects.shapes[23].isHovered).to.be.true; - [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 822, "offsetY": 196} as MouseEvent); + [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 816, "offsetY": 196} as MouseEvent); draw.castMouseMove(canvasMouse, frameMouse, mouseCoords); expect(draw.relativeObjects.shapes[23].isHovered).to.be.true; }); diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw a nice horizontal parallel plot-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw a nice horizontal parallel plot-base.png index 196e6538..c419a74d 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw a nice horizontal parallel plot-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw a nice horizontal parallel plot-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:783d412bb560327742c6dfd30e751de8a875c7c84e0432ab1815a0dcb64d2ca9 -size 203978 +oid sha256:65f1600224d3c1a80ca0967a6bb7e665f7291d7beda24a217aeb573947795bc8 +size 202822 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw canvas-base.png index ee6f9ba9..677d0538 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/GRAPH2D -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce2a9f1279e7ca25b0ed7e33a83c969d4660aeccf5ba97d57ae6b3f330f87345 -size 120131 +oid sha256:5b9cb1c861edf1d42c27975799cebb6b2186976f49687d36670ffbc73a186b13 +size 119872 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/HISTOGRAM -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/HISTOGRAM -- should draw canvas-base.png index 1eb69b16..072dc8d6 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/HISTOGRAM -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/HISTOGRAM -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6773e01e627de36f3e1c071edf5e485f7bf87f862c35fa9fde9fb9a88b765f41 -size 90175 +oid sha256:6f6a6efd85a0a844ef8dacfc15867f1e2e29f010ba51b3f4c8fb6ef6a8000d6f +size 89885 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw a canvas with text of empty data-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw a canvas with text of empty data-base.png index c17bcae8..ec18df99 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw a canvas with text of empty data-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw a canvas with text of empty data-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ff5582c92f85e49ebadf414bc390fb197821dc56489b63c5b8c471ca5ae5600 -size 44887 +oid sha256:5d5a772beb509cd5ef3c9ef318a1e16b8668db9d615a492e6bdc42815d4d94ab +size 40423 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw canvas-base.png index 9967beb7..023cfbcf 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/MULTIPLOT -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fac311974e22e5f53cfb6ce583fc97edeb470433252cc275056288b384f72eaf -size 340611 +oid sha256:80068e8162e97d1ade1f796ef0741b430a4338dd2082da3ed420d16f5851758b +size 326178 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw a nice horizontal parallel plot-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw a nice horizontal parallel plot-base.png index ecb13b7d..aef80c00 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw a nice horizontal parallel plot-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw a nice horizontal parallel plot-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79715a26a31e693899b8ad425d7082bb83609eb0b93735dff925e6b787ca532f -size 666550 +oid sha256:dca2e55896a83766925317070951562d19a7282f79b7e801d2fc62fc81792b67 +size 655819 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw canvas-base.png index baf17654..04ae3249 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/PARALLELPLOT -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa045b9d43e9db70498aab22bd94b19e8b9492edd1f91ed958d7243da32fc49b -size 592190 +oid sha256:e932008daf3ea9630d0df32a4dc44b6593f82c5ed90de34bd7cea609636bd111 +size 582425 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/PLOTSCATTER -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/PLOTSCATTER -- should draw canvas-base.png index 9f04b432..2bc6fba0 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/PLOTSCATTER -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/PLOTSCATTER -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:121641702687b4528027ab479450d6b2d70b3fb939f8bc7ed029ccd5a7d795f4 -size 144232 +oid sha256:a24c2c7ce6d9d571f719965bb3d226a4429362a5d81cef6e5f8e0702d9220de3 +size 145499 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/PRIMITIVEGROUPCONTAINER -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/PRIMITIVEGROUPCONTAINER -- should draw canvas-base.png index ef5b46db..422f57cd 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/PRIMITIVEGROUPCONTAINER -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/PRIMITIVEGROUPCONTAINER -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f0791115bb195c2d1cd773708d4c6f4e22845e78a6ab32ad66c186955f88e10 -size 49057 +oid sha256:d1c54f00e7ba8ad6f69d912fb34cb1c0bb6fba58acfdd7904e82c335b39858de +size 39878 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/SCATTERMATRIX -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/SCATTERMATRIX -- should draw canvas-base.png index 0428318e..d77f7357 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/SCATTERMATRIX -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/SCATTERMATRIX -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f365883c6b55019124706310268e3e05680b43dfead058d715c9a253a73bea7 -size 244378 +oid sha256:6833619c116ddf8d84014339f844d035f203c0e9b3ef91f95bf37ec31df522c6 +size 248539 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw canvas-base.png index 3b16a76a..67d997e5 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:10621c3d7060f71ae61e78fc6bbcb085f0fbea52e051a24be29decd245998436 -size 183560 +oid sha256:a9024f19c2cbadd28a00fc5378b71d06d7157763d591de0198e6cde96578bef9 +size 178234 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw tooltip on line-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw tooltip on line-base.png index 1997bc44..6a6541e5 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw tooltip on line-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/SIMPLESHAPES -- should draw tooltip on line-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a82962375538d5c7fb16259421acd1658fc91c5c8ac57b6d12265b5e20849e8e -size 185846 +oid sha256:f0c7893b1f1265d2870f3466376ab23815b0747110801d10d6912115348d388e +size 180862 diff --git a/cypress/snapshots/base/visualRegressions.cy.ts/TEXTSCALING -- should draw canvas-base.png b/cypress/snapshots/base/visualRegressions.cy.ts/TEXTSCALING -- should draw canvas-base.png index 056e90aa..7f77573e 100644 --- a/cypress/snapshots/base/visualRegressions.cy.ts/TEXTSCALING -- should draw canvas-base.png +++ b/cypress/snapshots/base/visualRegressions.cy.ts/TEXTSCALING -- should draw canvas-base.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04aa6af6f2b19427ae9e7aa8f9fb201aa59d52baa57b367ed828d45523b65820 -size 175565 +oid sha256:19edbbd4bff73b3bf395d160b9a0a7ee423baaceee29ef0a3114bbb42369b24f +size 165114 diff --git a/cypress/templates/emptyMultiplot.template.html b/cypress/templates/emptyMultiplot.template.html index 0fa26d9e..9f16d979 100644 --- a/cypress/templates/emptyMultiplot.template.html +++ b/cypress/templates/emptyMultiplot.template.html @@ -1,43 +1,83 @@
+