Custom Time Tick Representation With Zoom Capability

Hi Plotly community!

I am trying to use Plotly to plot Martian (planet Mars) local solar time (LST or LMST) on one of the axes, but also have the plot ticks resize and scale properly on zoom with the same time units, ideally down to the millisecond.

My time strings will look something like this: 'SOL-01234M12:34:56.789'.

I have no trouble plotting these time values as a string value on the axis, but when zooming in, I cannot get the desired tickformat behavior to work and autoscale at each level, which is something critical to my project.

My initial thinking in solving this problem was to create a custom python datetime.datetime object child class that overrides the normal __repr__ to convert from an Earth time to Martian LST time (I have this built already) and then hope since it was a datetime.datetime derivative that the plotly backend would show the representation as the Martian time. The general code for this type of class looks like the following to override the __repr__ to show the Mars time conversion (inspired by this SOE thread):

However, this does not work…the dates show up as the normal earth time version :frowning:

So, my question really comes down to how can I change the representation of a plot’s time axis tick mark dynamically? Is this possible? Is it something I can write an extension for or ask for help with? Is there an easier solution I may be missing?

I have seen the examples for using the tickformat attribute but I do not think it extends or explains my application.

One of the reasons I would like this solution to work for multiple types of custom time types is that this is for a plotting library used to plot events on other planets in the local time relative of the planet so no d3 time types are acceptable for my application, unfortunately.

Any and all help is appreciated, and many thanks to the hivemind ahead of time! This forum has helped me immensely in my learning and work to date :slight_smile: