Uh oh!
There was an error while loading. Please reload this page.
Add tickmode "proportional" - #6827
Conversation
- Create tickmode "proportional" - Map fractional tickvals to axis values w/ axis range: - Set ax.(minor?).tickvals to - Do that right before `arrayTicks()` is called - Every instance of `tickmode === "array"` gets `...|| "proportional"` This works well since tickmode "proportional" really just adds a preprocess step to tickmode "array". TODO: - Check if graph is reversed - Find where ticks are redrawn on zoom and make redraw proportional (will probably fix below) - Figure out why ticks not redrawn on double click/home - Add docs in layout
The algo has to set the tickvals property back to original value after spoofing it. This does that.
Re: 6d48a3b "Fix bug by which..." and "redrawing issue":
Issue was that replacing proportional values with actual values causes exponential |
8743766 to
00e884aCompareayjayt
commented
Dec 26, 2023
Alright that's pretty good. One more commit for whatever lint the bot picks up. I'll write tests after I get a response from devs. Questions for devs:
Tomorrow, a youtube video with results. |
ayjayt
commented
Dec 27, 2023
This strategy currently doesn't work if both major and minor ticks are |
Plotly does some math on the ticks, sometimes comrparing major and minor values, so we have to store both in their own separate values and then restore them to their attribute at the very end so plotly has them throughout the calculating process.
These tests currently fail but this commit currently doesn't include fundamental bug fixes.
ayjayt
commented
Dec 28, 2023
Alright, the testing is parameterized and randomized: It tests All It runs for File would obviously be renamed or put into other more relevant location. I don't understand how this concept would extend to multicategory especially since multicategory is Also, not sure how range padding is calculated but it might be convenient if the user were to know what proportion is added by padding so, eg., w/ |
archmoj
commented
Jan 2, 2024
Interesting PR. |
ayjayt
commented
Jan 2, 2024
Two suggestions by Alex coming tonight:
Tomrrow: |
So, I'm happy to write logic + tests for the tick-mode combination but I need it spelled out (and what do we do if they try a combo that doesn't work?- edit: I'll just take a look at how To confirm: Major Tickmode: Auto, Linearallow:
Auto # (within major ticks)Linear # (absolute values)Array # (absolute values)Major Tickmode: Arrayallow:
Linear # (absolute values)Array # (absolute values)Major Tickmode: Syncallow:
Sync # automaticMajor Tickmode: Full Domainallow:
Full Domain # (within major ticks)Domain Array # (within major ticks)Major Tickmode: Domain Arrayallow:
Domain Array # (within major ticks) |
- Use private ax._mappedTickvals instead - Remove use of Lib.nestedProperty during refactor
|
gvwilson
commented
Aug 21, 2024
archmoj
commented
Jul 18, 2025
@ayjayt Would you please resolve the conflicts? |
| 'If *array*, the placement of the ticks is set via `tickvals`,', | ||
| 'which are actual values, and the tick text is `ticktext`.', | ||
| '(*array* is the default value if `tickvals` is provided).', | ||
| 'If *full domain*, the number of ticks is set bia `nticks` but ticks', |
There was a problem hiding this comment.
| 'If *full domain*, the number of ticks is set bia `nticks` but ticks', | |
| 'If *full domain*, the number of ticks is set via `nticks` but ticks', |

For #6824:
The basic idea is that we create a mode called 'proportional' which is equivelent to 'array' but values are mapped from proportions before drawn.
Then again, array doesn't need to have to be recalculated on zoom, so it's not quite so simple.[0, .5, 1]would be[left-most point, middle, right-most point].nb: includes my other trivial pull request about meta-charset
TODO: