How to use d3 formatPrefix in tickformat?

I am running python 3.12.4 dash 2.17.1 dash_ag_grid 31.2.0 and plotly 5.22.0 on linux OpenSUSE Tumbleweed

I am using Plotly Graphical Objects to build a scatter chart.

I am trying to format the tick text for the y-axis and would like to use the d3 format. The documentation reads:

Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: GitHub - d3/d3-format at v1.4.5. And for dates see: GitHub - d3/d3-time-format at v2.2.3. …"

I have successfully used a d3 format e.g. ‘,.0f’ but I would like to use the d3 formatPrefix in order to automatically format tick values of order 1e6 to 1e9 as a number of millions for easy readability.

For now I have resorted to writing my own code to define tickvals and ticktext but would prefer to use tickformat and all the automatic tick generation in plotly, but that would require using the formatPrefix coding in d3.

I have searched extensively but not found any answer. Apologies if I missed where if this is covered elsewhere.

Any help is much appreciated.

Gato