@@ -53,7 +53,6 @@ def drawBestperformance(data, y, group):
5353
5454
5555def drawlinechart (st , data : list [object ], metric , key : str ):
56- unit = metric_unit_map .get (metric , "" )
5756 minV = min ([d .get (metric , 0 ) for d in data ])
5857 maxV = max ([d .get (metric , 0 ) for d in data ])
5958 padding = maxV - minV
@@ -87,11 +86,14 @@ def drawlinechart(st, data: list[object], metric, key: str):
8786 go .Scatter (
8887 x = db_data ["recall" ],
8988 y = db_data ["qps" ],
90- mode = "lines+markers" ,
89+ mode = "lines+markers+text " ,
9190 name = db ,
9291 line = dict (color = color_map [db ]),
9392 marker = dict (color = color_map [db ]),
9493 showlegend = True ,
94+ hovertemplate = "QPS=%{y:.4g}, Recall=%{x:.2f}" ,
95+ text = [f"{ qps :.4g} @{ recall :.2f} " for recall , qps in zip (db_data ["recall" ], db_data ["qps" ])],
96+ textposition = "top right" ,
9597 )
9698 )
9799
@@ -107,9 +109,8 @@ def drawlinechart(st, data: list[object], metric, key: str):
107109 )
108110 )
109111
110- fig .update_xaxes (range = xrange )
111- fig .update_yaxes (range = yrange )
112- fig .update_traces (textposition = "bottom right" , texttemplate = "%{y:,.4~r}" + unit )
112+ fig .update_xaxes (range = xrange , title_text = "Recall" )
113+ fig .update_yaxes (range = yrange , title_text = "QPS" )
113114 fig .update_layout (
114115 margin = dict (l = 0 , r = 0 , t = 40 , b = 0 , pad = 8 ),
115116 legend = dict (orientation = "h" , yanchor = "bottom" , y = 1 , xanchor = "right" , x = 1 , title = "" ),
0 commit comments