Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to master #393

Merged
merged 44 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
37ccf4a
fix(zoom): fix initial zoom on draws by removing labels from boundaries
Tanguylo Jun 17, 2024
6e70657
fix(zoom): change script to consider fix
Tanguylo Jun 17, 2024
7fc4e92
fix(zoom): change line2d method for null null return in getbounds
Tanguylo Jun 17, 2024
9c749d1
fix(zoom): update cypress and fix tests
Tanguylo Jun 17, 2024
02c4149
fix(zoom): remove console log
Tanguylo Jun 17, 2024
67d9e71
fix(legend): fix text of legend but discover new bugs on draw and leg…
Tanguylo Jun 17, 2024
18a033b
fix(legend): regenerate test pics
Tanguylo Jun 17, 2024
bddc4ec
feat(filters): add methods and write html to filter on axes but did n…
Tanguylo Jun 17, 2024
84ff0f1
feat(filters): remove discrete behavior
Tanguylo Jun 18, 2024
60b4a93
feat(filters): add tests
Tanguylo Jun 19, 2024
39e0b9f
feat(filters): write changeleog
Tanguylo Jun 19, 2024
c3f70e0
fix(rubberband): fix rubberband range changing when going outside an …
Tanguylo Jun 19, 2024
7f3f759
fix(rubberband): write tests
Tanguylo Jun 19, 2024
f88ba48
fix(rubberband): changelog
Tanguylo Jun 19, 2024
651305e
fix(legend): fix bug of text fontsize nd intempestive crop of text
Tanguylo Jun 19, 2024
440aafe
fix(legend): fix scale problems on draws
Tanguylo Jun 19, 2024
4e2e98a
fix(legend): fix text legend resizing
Tanguylo Jun 20, 2024
6e43540
feat(filter): make filters available on non displayed features for mu…
Tanguylo Jun 21, 2024
adf8636
feat(filters): fix bugs and repair tests
Tanguylo Jun 21, 2024
520cf4c
feat(rubberband): emit on change
GhislainJ Jul 3, 2024
2aae347
Merge remote-tracking branch 'origin/feat/filters' into feat/emit-fil…
GhislainJ Jul 3, 2024
5205f44
Merge pull request #388 from Dessia-tech/fix/zoom
Tanguylo Jul 5, 2024
c483d61
Merge pull request #391 from Dessia-tech/fix/rubberband
Tanguylo Jul 5, 2024
765abd2
feat(filters): add number to types in setrubberband
Tanguylo Jul 5, 2024
3d8febb
Merge remote-tracking branch 'origin/dev' into fix/legend
Tanguylo Jul 5, 2024
89c3759
feat(filters): add id to emitted fitlers
GhislainJ Jul 9, 2024
52d6451
fix(legend): add comment on catch
Tanguylo Jul 11, 2024
77afd7a
feat(filters): pr remarks but test does not pass
Tanguylo Jul 11, 2024
a619e21
Merge remote-tracking branch 'origin/dev' into feat/emit-filter-witho…
GhislainJ Jul 11, 2024
f5a4f12
Merge remote-tracking branch 'origin/dev' into feat/filters
Tanguylo Jul 11, 2024
053439b
docs(changelog): update
GhislainJ Jul 11, 2024
33957c6
test(multiplot): check rubberband emission
GhislainJ Jul 11, 2024
4744acb
feat(filtes): fix tests
Tanguylo Jul 11, 2024
c2a3c59
Merge remote-tracking branch 'origin/fix/legend' into feat/filters
Tanguylo Jul 11, 2024
293d749
Merge pull request #389 from Dessia-tech/fix/legend
Tanguylo Jul 11, 2024
5bc7ed4
Merge pull request #390 from Dessia-tech/feat/filters
Tanguylo Jul 11, 2024
11d7d93
Merge remote-tracking branch 'origin/dev' into feat/emit-filter-witho…
GhislainJ Jul 11, 2024
c3002b2
chore(interactions): add trailing newline
GhislainJ Jul 12, 2024
83fecc7
Merge branch 'feat/emit-filter-without-refactor' of github.com:Dessia…
GhislainJ Jul 12, 2024
0a48ee5
Merge pull request #394 from Dessia-tech/feat/emit-filter-without-ref…
Tanguylo Jul 12, 2024
462a74a
Merge branch 'master' into dev
Tanguylo Jul 12, 2024
7e0ac7d
fix(dev): fix
Tanguylo Jul 15, 2024
4959d74
fix(dev): changelog
Tanguylo Jul 15, 2024
6354738
Merge pull request #395 from Dessia-tech/fix/dev
Tanguylo Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ 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.26.0]
### Add
- RemoteFigure.setFeatureFilter to directly edit rubberbands' value from external requests
- Multiplot.setFeatureFilter to directly edit rubberbands' value from external requests
- Emit rubberband changes

### Fix
- Labels:
- fix wide text
- remove shape hovering
- RubberBand: fix rubberband deletion when putting it outside view point
- Fixing tests on dev

## [0.25.1]
### Doc
- Changing doc link in readme
Expand Down
9 changes: 9 additions & 0 deletions cypress/e2e/multiplot.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PointSet } from "../../instrumented/collections";
import { Scatter, Graph2D, Draw, ParallelPlot } from "../../instrumented/figures";
import { Multiplot } from "../../instrumented/multiplot";
import multiplotData from '../data_src/multiplot.data.json';
import { filterUpdate } from "../../instrumented/interactions";

const MOUSE_OFFSET = new Vertex(8, 8); // TODO: I f****** don't understand why this add (8, 8) is required for mouse to be as specified
const canvasID = "canvas";
Expand Down Expand Up @@ -150,6 +151,7 @@ describe("Multiplot.mouseListener", function() {
});

it("should draw a SelectionBox on .figures[1] and rubberBand on other rubberBanded axes", function () {
cy.spy(filterUpdate, 'next');
window.dispatchEvent(shiftKeyDown);
canvas.dispatchEvent(mouseMove2);
canvas.dispatchEvent(mouseDown2);
Expand All @@ -165,6 +167,8 @@ describe("Multiplot.mouseListener", function() {
expect(multiplot.rubberBands.get(scatter2.axes[0].name).length, "multiplot rubberBand[0] updated").to.be.closeTo(25.4, 0.1);
expect(multiplot.rubberBands.get(scatter2.axes[1].name).length, "multiplot rubberBand[1] updated").to.be.closeTo(1.02, 0.01);

expect(filterUpdate.next).to.have.been.calledWith({id: multiplot.canvasID, rubberbands: multiplot.rubberBands});

const rubberBandName0 = scatter2.axes[0].name;
const rubberBandName1 = scatter2.axes[1].name;
multiplot.figures.forEach(figure => {
Expand Down Expand Up @@ -322,4 +326,9 @@ describe("Multiplot.diverse", function() {
expect(figure.isZooming, `figure[${i}].isZooming`).to.be.false;
});
});

it('should write values in axes[0].rubberBand', function() {
multiplot.setFeatureFilter("x", -1, 25);
expect(multiplot.selectedIndices.length, "multiplot.selectedIndices.length").to.be.equal(61);
});
});
53 changes: 34 additions & 19 deletions cypress/e2e/remoteFigure.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ describe("RemoteFigure.changeAxisFeature", function() {
});
});

describe("RemoteFigure.setFeatureFilters", function() {
it('should write values in axes[0].rubberBand', function() {
const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id);
figure.setCanvas(canvas.id);
figure.axes[0] = new Axis(figure.features.get("x"), new Rect(new Vertex(), new Vertex(100, 100)), new Vertex(), new Vertex(100, 0), "x", new Vertex());
figure.setFeatureFilter("x", -1, 1.1);
expect(figure.selectedIndices.length, "figure.selectedIndices.length").to.be.equal(2);
});
});


describe("RemoteFigure.resizeUpdate", function() {
it("should resize figure", function() {
const figure = new RemoteFigure(data, canvas.width, canvas.height, 100, 100, canvas.id);
Expand All @@ -147,16 +158,6 @@ 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);
Expand Down Expand Up @@ -214,6 +215,7 @@ describe("RemoteFigure.mouseListener", function() {
const mouseDown = new MouseEvent('mousedown', { clientX: 150, clientY: 150 });
const mouseMove1 = new MouseEvent('mousemove', { clientX: 150, clientY: 150 });
const mouseMove2 = new MouseEvent('mousemove', { clientX: 370, clientY: 520 });
const mouseMove3 = new MouseEvent('mousemove', { clientX: 20000, clientY: 0 });
const mouseWheel = new WheelEvent('wheel', { clientX: 150, clientY: 150, deltaY: ZOOM_FACTOR });
const mouseLeave = new MouseEvent('mouseleave', {});

Expand Down Expand Up @@ -262,6 +264,19 @@ describe("RemoteFigure.mouseListener", function() {
expect(canvas.style.cursor, "default cursor").to.be.equal("default");
});

it("should preserve rubberBand min and max values", function () {
figure.axes[0].rubberBand.minValue = 0;
figure.axes[0].rubberBand.maxValue = 200;
figure.draw();
expect(figure.axes[0].rubberBand.canvasLength, "rubberBand.canvasLength").to.be.closeTo(764, 1.);
canvas.dispatchEvent(mouseMove1);
canvas.dispatchEvent(mouseDown);
canvas.dispatchEvent(mouseMove3);
canvas.dispatchEvent(mouseUp);
expect(figure.axes[0].rubberBand.canvasLength, "rubberBand.canvasLength").to.be.equal(0);
figure.reset();
});

it("should translate figure", function() {
canvas.dispatchEvent(mouseMove1);
canvas.dispatchEvent(mouseDown);
Expand All @@ -273,7 +288,7 @@ describe("RemoteFigure.mouseListener", function() {

expect(figure.translation, "translation").to.deep.equal(new Vertex());
});

it("should handle wheel events", function() {
const minValue0 = figure.axes[0].minValue;
const maxValue0 = figure.axes[0].maxValue;
Expand All @@ -295,16 +310,16 @@ describe("RemoteFigure.mouseListener", function() {
const maxValue1 = figure.axes[1].maxValue;

figure.zoomIn();
expect(figure.axes[0].minValue, "minValue0").to.not.be.equal(minValue0);
expect(figure.axes[0].maxValue, "maxValue0").to.not.be.equal(maxValue0);
expect(figure.axes[1].minValue, "minValue0").to.not.be.equal(minValue1);
expect(figure.axes[1].maxValue, "maxValue1").to.not.be.equal(maxValue1);
expect(figure.axes[0].minValue, "minValue0").to.not.be.closeTo(minValue0, 0.001);
expect(figure.axes[0].maxValue, "maxValue0").to.not.be.closeTo(maxValue0, 0.001);
expect(figure.axes[1].minValue, "minValue0").to.not.be.closeTo(minValue1, 0.001);
expect(figure.axes[1].maxValue, "maxValue1").to.not.be.closeTo(maxValue1, 0.001);

figure.zoomOut();
expect(figure.axes[0].minValue, "minValue0").to.be.equal(minValue0);
expect(figure.axes[0].maxValue, "maxValue0").to.be.equal(maxValue0);
expect(figure.axes[1].minValue, "minValue0").to.be.equal(minValue1);
expect(figure.axes[1].maxValue, "maxValue1").to.be.equal(maxValue1);
expect(figure.axes[0].minValue, "minValue0").to.be.closeTo(minValue0, 0.001);
expect(figure.axes[0].maxValue, "maxValue0").to.be.closeTo(maxValue0, 0.001);
expect(figure.axes[1].minValue, "minValue0").to.be.closeTo(minValue1, 0.001);
expect(figure.axes[1].maxValue, "maxValue1").to.be.closeTo(maxValue1, 0.001);
});

it("should reset state correctly on mouseleave", function() {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/visualRegressions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": 809, "offsetY": 196} as MouseEvent);
let [canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 807, "offsetY": 196} as MouseEvent);
draw.castMouseMove(canvasMouse, frameMouse, mouseCoords);
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;

[canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 816, "offsetY": 196} as MouseEvent);
[canvasMouse, frameMouse, mouseCoords] = draw.projectMouse({"offsetX": 810, "offsetY": 196} as MouseEvent);
draw.castMouseMove(canvasMouse, frameMouse, mouseCoords);
expect(draw.relativeObjects.shapes[23].isHovered).to.be.true;
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading