@@ -5524,7 +5524,7 @@ describe('Test axes', function() {
55245524 } ) ;
55255525 } ) ;
55265526
5527- [ '%f' , '%L' , '% Q', '%s' , '%S' , '%M' , '% H', '%I' , '%p ', '%X' ] . forEach ( function ( formatter , i ) {
5527+ [ '%Q' , '%s' , '%H' , '%I' , '%X' ] . forEach ( function ( formatter , i ) {
55285528 it ( 'should respect daily tickformat that includes ' + formatter , function ( done ) {
55295529 Plotly . newPlot ( gd , {
55305530 data : [ {
@@ -5552,15 +5552,10 @@ describe('Test axes', function() {
55525552 '2020-01-01 21:00' ,
55535553 '2020-01-02'
55545554 ] , [
5555- [ '' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Wed-0' , 'Thu-0' ] ,
5556- [ '' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Wed-000' , 'Thu-000' ] ,
55575555 [ '' , 'Wed-1577836800000' , 'Wed-1577847600000' , 'Wed-1577858400000' , 'Wed-1577869200000' , 'Wed-1577880000000' , 'Wed-1577890800000' , 'Wed-1577901600000' , 'Wed-1577912400000' , 'Thu-1577923200000' ] ,
55585556 [ '' , 'Wed-1577836800' , 'Wed-1577847600' , 'Wed-1577858400' , 'Wed-1577869200' , 'Wed-1577880000' , 'Wed-1577890800' , 'Wed-1577901600' , 'Wed-1577912400' , 'Thu-1577923200' ] ,
5559- [ '' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Thu-00' ] ,
5560- [ '' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Wed-00' , 'Thu-00' ] ,
55615557 [ '' , 'Wed-00' , 'Wed-03' , 'Wed-06' , 'Wed-09' , 'Wed-12' , 'Wed-15' , 'Wed-18' , 'Wed-21' , 'Thu-00' ] ,
55625558 [ '' , 'Wed-12' , 'Wed-03' , 'Wed-06' , 'Wed-09' , 'Wed-12' , 'Wed-03' , 'Wed-06' , 'Wed-09' , 'Thu-12' ] ,
5563- [ '' , 'Wed-AM' , 'Wed-AM' , 'Wed-AM' , 'Wed-AM' , 'Wed-PM' , 'Wed-PM' , 'Wed-PM' , 'Wed-PM' , 'Thu-AM' ] ,
55645559 [ '' , 'Wed-00:00:00' , 'Wed-03:00:00' , 'Wed-06:00:00' , 'Wed-09:00:00' , 'Wed-12:00:00' , 'Wed-15:00:00' , 'Wed-18:00:00' , 'Wed-21:00:00' , 'Thu-00:00:00' ]
55655560 ] [ i ] ) ;
55665561 } )
@@ -5569,6 +5564,56 @@ describe('Test axes', function() {
55695564 } ) ;
55705565 } ) ;
55715566
5567+
5568+ [
5569+ {
5570+ formatter : '%p' ,
5571+ positions : [ '2019-12-31 21:00' , '2020-01-01' , '2020-01-01 12:00' , '2020-01-02' ] ,
5572+ labels : [ '' , 'Wed-AM' , 'Wed-PM' , 'Thu-AM' ]
5573+ } ,
5574+ {
5575+ formatter : '%M' ,
5576+ positions : [ '2019-12-31 21:00' , '2020-01-01 12:00' , '2020-01-02 12:00' ] ,
5577+ labels : [ '' , 'Wed-00' , '' ]
5578+ } ,
5579+ {
5580+ formatter : '%S' ,
5581+ positions : [ '2019-12-31 21:00' , '2020-01-01 12:00' , '2020-01-02 12:00' ] ,
5582+ labels : [ '' , 'Wed-00' , '' ]
5583+ } ,
5584+ {
5585+ formatter : '%L' ,
5586+ positions : [ '2019-12-31 21:00' , '2020-01-01 12:00' , '2020-01-02 12:00' ] ,
5587+ labels : [ '' , 'Wed-000' , '' ]
5588+ } ,
5589+ {
5590+ formatter : '%f' ,
5591+ positions : [ '2019-12-31 21:00' , '2020-01-01 12:00' , '2020-01-02 12:00' ] ,
5592+ labels : [ '' , 'Wed-0' , '' ]
5593+ }
5594+ ] . forEach ( function ( t ) {
5595+ it ( 'should respect time tickformat that includes ' + t . formatter , function ( done ) {
5596+ Plotly . newPlot ( gd , {
5597+ data : [ {
5598+ hovertemplate : hovertemplate ,
5599+ x : [ '2020-01-01' , '2020-01-02' ]
5600+ } ] ,
5601+ layout : {
5602+ width : 1000 ,
5603+ xaxis : {
5604+ ticklabelmode : 'period' ,
5605+ tickformat : '%a-' + t . formatter
5606+ }
5607+ }
5608+ } )
5609+ . then ( function ( ) {
5610+ _assert ( '' , t . positions , t . labels ) ;
5611+ } )
5612+ . catch ( failTest )
5613+ . then ( done ) ;
5614+ } ) ;
5615+ } ) ;
5616+
55725617 [
55735618 {
55745619 range : [ '2020-12-15' , '2084-12-15' ] ,
0 commit comments