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

Scroll affects bar width #1476

Closed
watnab opened this issue Jun 30, 2020 · 6 comments
Closed

Scroll affects bar width #1476

watnab opened this issue Jun 30, 2020 · 6 comments
Assignees
Labels
Milestone

Comments

@watnab
Copy link

watnab commented Jun 30, 2020

Description

It seems srolling zoomed bar chart affects the width of bars.

Steps to check or reproduce

  1. Show https://jsfiddle.net/psc1gjm4/
  2. Scroll to the right(Drag the chart to the left).
@watnab
Copy link
Author

watnab commented Jun 30, 2020

The width of bar will get narrow.
1
2

@watnab
Copy link
Author

watnab commented Jun 30, 2020

https://jsfiddle.net/5962c3pn/
billboard.js v1.11.1 won't reproduce this issue.

@netil netil added the bug label Jun 30, 2020
@netil
Copy link
Member

netil commented Jun 30, 2020

The update of width size by zoom was applied from #1185.
This issue seems related with that update. I'll check for that.

Thanks for the report!

@watnab
Copy link
Author

watnab commented Jul 1, 2020

This issue seems related with that update.

93184a2

The width of bar will get narrow.

  • In getBarW, tickInterval will change. $$.subX.domain()[1] and maxDataCount won't change.
  • In xx(d), $$.zoomScale(d) will change.
  • In scale(d) of getCustomizedScale, scaleValue(d) will change.

In d3.js,

  • In scale(x) of transformer$1, the value output returned will change.
  • In function(x) of bimap(domain, range, interpolate$$1), d0(x) will change.

getCustomizedScale will be called from zoom.updateTransformScale.

$$.zoomScale = $$.getCustomizedScale(newScale);

I could not see what's the right way to update scale.

@watnab
Copy link
Author

watnab commented Jul 1, 2020

It seems zoomScale should not change even if x-offset will get larger when scrolling to right.
X-offset may possibly affect zoomScale.

@netil netil added this to the 2.0-next milestone Jul 2, 2020
@netil netil self-assigned this Jul 2, 2020
netil added a commit that referenced this issue Jul 2, 2020
Maintain scaled bar width during the drag back and forth moves.

Fix #1476
netil pushed a commit that referenced this issue Jul 2, 2020
# [2.0.0-next.8](2.0.0-next.7...2.0.0-next.8) (2020-07-02)

### Bug Fixes

* **bar:** fix bar width scale on zoom ([59073bd](59073bd)), closes [#1476](#1476)

### Features

* **axis:** Intent to ship log scale  ([6fdf3e4](6fdf3e4)), closes [#1351](#1351)
@netil
Copy link
Member

netil commented Jul 2, 2020

@watnab, released 2.0.0-next.8 with the fix.

@netil netil closed this as completed Jul 2, 2020
netil pushed a commit that referenced this issue Jul 16, 2020
# [2.0.0](1.12.11...2.0.0) (2020-07-16)

### Bug Fixes

* **all:** Fix test cases ([2e1ad79](2e1ad79))
* **arc:** fix applying data.labels.colors ([#1448](#1448)) ([c128fad](c128fad)), closes [#1440](#1440)
* **axis:** fix incorrect clip node handling ([a8c6f96](a8c6f96)), closes [#1449](#1449)
* **axis:** make axis clip-path to fit real axis size ([7419f44](7419f44)), closes [#1449](#1449)
* **bar:** fix bar width scale on zoom ([59073bd](59073bd)), closes [#1476](#1476)
* **data:** fix for data.labels=false ([b7a0972](b7a0972)), closes [#1444](#1444)
* **data.selection:** fix selection.isselectable value check ([9d41a04](9d41a04))
* **gauge:** fixed wrong bottom padding calculation ([0542586](0542586)), closes [#1441](#1441) [#1471](#1471)
* **legend:** Don't bind event when interaction is false ([4546c00](4546c00))
* **point:** Correct focus.only to work in mobile env ([67eea16](67eea16))
* **point:** Correct point.focus.only ([1686594](1686594))
* **point:** update point generation ([da63e39](da63e39))
* **subchar:** correct subchart rendering ([44ed216](44ed216)), closes [#1458](#1458)

### Code Refactoring

* **all:** v2 updates ([e23998f](e23998f)), closes [#758](#758) [#757](#757) [#756](#756) [#36](#36)
* **module:** implement ESM index ([85caf71](85caf71))

### Features

* **axis:** Intent to ship log scale  ([6fdf3e4](6fdf3e4)), closes [#1351](#1351)
* **bar:** Intent to ship bar.label.threshold ([72a7b7f](72a7b7f)), closes [#1427](#1427)
* **gauge:** Intent to ship gauge.label.threshold ([#1443](#1443)) ([9a0807e](9a0807e)), closes [#1439](#1439)
* **interaction:** split selection, subchart & zoom ([ba1e4f2](ba1e4f2))
* **point:** Intent to ship point.focus.only ([bb70347](bb70347))

### BREAKING CHANGES

* **all:** v2 updates
* **module:** new index for ESM build

- split Axis releated size from size.ts --> size.axis.ts
- split common main option from Options.ts --> ./common/main.ts
- Instead export Axis class, add .getAxisInstance() to make beneficial
  from tree-shaking
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