Skip to content

Ticklabelindex fixes for issues #7875 and #7876#7877

Open
my-tien wants to merge 19 commits into
plotly:masterfrom
my-tien:7875-7876-ticklabelindex-fixes
Open

Ticklabelindex fixes for issues #7875 and #7876#7877
my-tien wants to merge 19 commits into
plotly:masterfrom
my-tien:7875-7876-ticklabelindex-fixes

Conversation

@my-tien

@my-tien my-tien commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #7876 by rewriting the way period label positioning works when using ticklabelindex. Previously, the next labeled tick was used as the period end for the previous tick. Now positionPeriodTicks can accept an array of periodEndTicks instead,

Fixes #7875 by adding an additional major tick at the end of the axis range + all minor ticks between the last visible tick and that helper.
Previously, there was already code that added one major tick and one minor tick before tick0. Now the behavior is symmetrical to the axis range end (1 major tick and all minor ticks between that and tick0).
We need all minor ticks between the first/last visible tick and the major helper tick so that walking ticklabelindex steps from that helper tick lands on the correct minor tick.

my-tien added 11 commits June 29, 2026 14:28
If ticklabelIndex was set, calcMinor was set to its value instead of being set to true. This didn't cause a bug but calcMinor is expected to be a boolean.
The previous name "text" is a little confusing since the return value is later used as a tick in calcTicks.
Also, don't just add one minor tick but as many as there should be between two major ticks.

This is part of the fix for the last period label sometimes not being visible if ticklabelindex is negative.

We need all minor ticks between the last visible tick and the major helper tick so that going back ticklabelindex steps from that helper tick lands on the correct minor tick.
Now uses an array "periodEndTicks" that contains the ending tick for each starting tick of a labeled period to determine label positioning.
Simplify code. labelIndex > 0 and labelIndex === 0 are actually treated in the same way.
- Fix description of lower plot.
- Fix missing trailing newline.
There are only minimal pixel differences
@my-tien my-tien marked this pull request as draft July 1, 2026 08:54
my-tien added 5 commits July 1, 2026 13:22
This is just to be consistent with the way major ticks are set. In axes_test we test for empty string, instead of for undefined.
For period axes, a label is visible if one of the enclosing ticks is visible.
…ex is used.

If tickformat isn't set, the old code just used the major dtick to determine the tickformat but when using ticklabelindex we need to look at the minor dtick.
Only add additional ticks to the end if labels are drawn left of ticks.
@my-tien my-tien force-pushed the 7875-7876-ticklabelindex-fixes branch from 1e5605e to d42829b Compare July 3, 2026 06:36
my-tien added 2 commits July 3, 2026 08:45
Also reduce impact on charts that don't use ticklabelindex. This is not really necessary, but a precaution.
@my-tien my-tien marked this pull request as ready for review July 3, 2026 09:43
The editTitle function could previously select the editNode from a previous call if the blur event didn't remove it from the DOM in time.
@my-tien

my-tien commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi guys, I was able to fix almost all failing CI tests. However, I think that the failing no-gl-jasmine (2) test is because of timing issues in the test not because of an actual bug? I can't reproduce it locally. I ran with this command:
npm run test-jasmine -- calcdata --skip-tags=gl,noCI,flaky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant