File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
ui/src/design-system/components/plot Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,12 @@ def event_top_taxa(event_pk: int, top_n: int = 10):
279
279
else :
280
280
taxa , counts = [], []
281
281
282
+ # Restrict number of top species if too many
283
+ MAX_SPECIES = 10
284
+ if len (taxa ) > MAX_SPECIES :
285
+ taxa = taxa [:MAX_SPECIES ]
286
+ counts = counts [:MAX_SPECIES ]
287
+
282
288
return {
283
289
"title" : "Top species" ,
284
290
"data" : {"x" : counts , "y" : taxa },
Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ const Plot = ({
34
34
marker : {
35
35
color : markerColor ,
36
36
} ,
37
- hovertemplate,
37
+ hovertemplate :
38
+ type === 'bar' && orientation === 'h'
39
+ ? '%{x}'
40
+ : type === 'bar'
41
+ ? '%{y}'
42
+ : '<b>%{x}</b>: %{y}' ,
43
+ name : '' , // Remove ‘trace 0’ next to hover
38
44
} ,
39
45
] }
40
46
config = { {
You can’t perform that action at this time.
0 commit comments