Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1ac31c2
Fix calcMinor boolean value
my-tien Jun 29, 2026
5bd2835
Rename return value of setTickLabel
my-tien Jun 29, 2026
5b6244c
Add period axis helper ticks to end of axis also
my-tien Jun 29, 2026
cb9ee73
Rework tick label calculation and positioning for ticklabelindex
my-tien Jun 29, 2026
145548b
Mock ticklabelindex-2 for testing more special cases with ticklabelindex
my-tien Jun 29, 2026
2a8b67c
Draftlog for PR 7877
my-tien Jun 29, 2026
9701952
tick label calc: Don't label ticks with `noTick`.
my-tien Jun 30, 2026
ff39a47
ticklabelindex-2 mock: improve tick visibility
my-tien Jun 30, 2026
1bb00e7
Baseline image ticklabelindex-2
my-tien Jun 30, 2026
01d9e6f
Fix "textposition" value in ticklabelindex-2 mock
my-tien Jun 30, 2026
b6c6392
Update baseline images with ticklabeindex on period axes
my-tien Jun 30, 2026
a2afbf0
minor tick text: If not labeled, set to empty string
my-tien Jul 1, 2026
db2dab9
ticklabelindex: refine label visibility check
my-tien Jul 1, 2026
553dc51
Fix ticklabelindex in the case minor and major ticks overlap
my-tien Jul 1, 2026
a554920
Fix period label sometimes showing incorrect format when ticklabelind…
my-tien Jul 2, 2026
d42829b
date_axes_period2_ticklabelindex: increase height for longer labels
my-tien Jul 3, 2026
680dded
Update baseline images after fixes to period label formatting
my-tien Jul 3, 2026
45d6ce1
Fix recursive ax.minor structure
my-tien Jul 3, 2026
5cc66fa
Improve robustness of titles_test "Editable titles"
my-tien Jul 3, 2026
53e8d8d
Merge remote-tracking branch 'plotly-origin/master' into 7875-7876-ti…
my-tien Jul 29, 2026
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
2 changes: 2 additions & 0 deletions draftlogs/7877_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix missing last period label when using a negative `ticklabelindex` in a chart where the last major tick is not visible [[#7877](https://github.com/plotly/plotly.js/pull/7877)]
- Fix incorrect period label positioning when using `ticklabelindex` in a chart where not enough minor ticks are visible [[#7877](https://github.com/plotly/plotly.js/pull/7877)]
420 changes: 234 additions & 186 deletions src/plots/cartesian/axes.js

Large diffs are not rendered by default.

Binary file modified test/image/baselines/date_axes_period2_ticklabelindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/date_axes_period_ticklabelindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/ticklabelindex-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ticklabelindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/image/mocks/date_axes_period2_ticklabelindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"layout": {
"showlegend": false,
"width": 600,
"height": 500,
"height": 740,
"yaxis": {
"domain": [0, 0.04]
},
Expand Down
68 changes: 68 additions & 0 deletions test/image/mocks/ticklabelindex-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"data": [
{
"x": [
"2020", "2021", "2022"
],
"y": [
3, 2, 1
]
},
{
"mode": "markers+text",
"texttemplate": "%{x|Q%q %y}",
"textposition": "top center",
"x": [
"2019-07-01", "2019-10-01", "2020-01-01", "2020-04-01", "2020-07-01"
],
"y": [
2, 2, 2, 2, 2
],
"yaxis": "y2",
"xaxis": "x2"
}
],
"layout": {
"width": 600,
"height": 800,
"grid": {
"rows": 2,
"columns": 1,
"pattern": "independent"
},
"xaxis": {
"dtick": "M12",
"insiderange": [
"2020-03-27",
"2022-07-21"
],
"tickformat": "%Y",
"ticklabelindex": -1,
"ticks": "outside",
"ticklen": 20,
"ticklabelmode": "period",
"type": "date",
"title": {
"text": "Should display 2 major ticks and labels 2020, 2021, 2022"
}
},
"xaxis2": {
"dtick": "M24",
"insiderange": [
"2019-03-01",
"2021-01-01"
],
"tick0": "2021-01-01",
"tickformat": "%Y",
"ticklabelindex": -1,
"ticklabelmode": "period",
"ticklen": 20,
"type": "date",
"ticks": "outside",
"minor": { "dtick": "M12", "ticks": "outside", "ticklen": 5 },
"title": {
"text": "Should display 1 major tick, 1 minor tick and a label 2020 in between."
}
}
}
}
6 changes: 4 additions & 2 deletions test/jasmine/tests/titles_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,10 @@ describe('Editable titles', function() {

var textNode = document.querySelector('.' + className);
textNode.dispatchEvent(new window.MouseEvent('click'));

var editNode = document.querySelector('.plugin-editable.editable');
// make sure to select the editNode created by the click, not some leftover
// from the previous call (the blur event removes it asynchronously.)
var editNodes = document.querySelectorAll('.plugin-editable.editable');
var editNode = editNodes[editNodes.length - 1];
editNode.dispatchEvent(new window.FocusEvent('focus'));
editNode.textContent = text;
editNode.dispatchEvent(new window.FocusEvent('focus'));
Expand Down
Loading