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

[BUG] Programatic zoom resets after wheel in then out #2194

Closed
jimmy764 opened this issue Jul 16, 2021 · 1 comment
Closed

[BUG] Programatic zoom resets after wheel in then out #2194

jimmy764 opened this issue Jul 16, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@jimmy764
Copy link

Description

After setting zoom programmatically, scrolling in one step then out one step will reset zoom to original (as if .unzoom had been called).

I observed this with Chrome 91 & Firefox 90, but not Firefox 89.

Steps to check or reproduce

  1. Load chart with "zoom" example
  2. Add programmatic zoom
  3. Scroll in (at least one step)
  4. Scroll out (at least one step)

https://stackblitz.com/edit/udgqfr?file=index.js

var chart = bb.generate({
  data: {
    columns: [
	["sample", 30, 200, 100, 400, 150, 250, 150, 200, 170, 240, 350, 150, 100, 400, 150, 250, 150, 200, 170, 240, 100, 150, 250, 150, 200, 170, 240, 30, 200, 100, 400, 150, 250, 150, 200, 170, 240, 350, 150, 100, 400, 350, 220, 250, 300, 270, 140, 150, 90, 150, 50, 120, 70, 40]
    ],
    type: "line",
  },
  zoom: {
    enabled: true, 
  },
  bindto: "#zoom"
});

chart.zoom([24, 30]);
@netil netil added the bug label Jul 21, 2021
@netil
Copy link
Member

netil commented Jul 21, 2021

Hi @jimmy764, thanks for the report.

netil added a commit to netil/billboard.js that referenced this issue Jul 27, 2021
Refactor zoom transform and its releated codes.

Ref naver#2194
netil added a commit to netil/billboard.js that referenced this issue Jul 27, 2021
Refactor zoom transform and its releated codes.

Ref naver#2194
netil added a commit to netil/billboard.js that referenced this issue Jul 27, 2021
Refactor zoom transform and its releated codes.

Ref naver#2194
@netil netil closed this as completed in 4eee2d8 Jul 27, 2021
@netil netil added this to the Patch milestone Jul 27, 2021
@netil netil self-assigned this Jul 27, 2021
github-actions bot pushed a commit that referenced this issue Jul 28, 2021
## [3.1.3](3.1.2...3.1.3) (2021-07-28)

### Bug Fixes

* **api:** fix subchart APIs usage with zoom reset button ([982f6ee](982f6ee)), closes [#2201](#2201)
* **axis:** fix bar type tick.fit=false throwing error ([083f5c7](083f5c7)), closes [#2210](#2210)
* **axis:** fix handling x axis localtime ([1d2ce8f](1d2ce8f)), closes [#2186](#2186)
* **Axis:** fix transition on flow ([a656fe5](a656fe5)), closes [#2189](#2189)
* **shape:** fix incorrect shape offset ([d2be8c0](d2be8c0)), closes [#2187](#2187)
* **types:** fix wrong legend.item callbacks args types ([1196bbf](1196bbf)), closes [#2203](#2203)
* **zoom:** fix inconsistent zoom on .zoom() -> wheel ([4eee2d8](4eee2d8)), closes [#2194](#2194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants