Skip to content

Commit

Permalink
Merge pull request #6944 from weiweikee/dev-parcats-color-hover
Browse files Browse the repository at this point in the history
Fix hover count info label in `createHoverLabelForColorHovermode`
  • Loading branch information
archmoj authored Mar 28, 2024
2 parents 33b7e8c + e50cc7a commit d20b8e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions draftlogs/6944_change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Fix hover count in parcats trace [[#6944](https://github.com/plotly/plotly.js/pull/6944)],
with thanks to @weiweikee for the contribution!

2 changes: 1 addition & 1 deletion src/traces/parcats/parcats.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ function createHoverLabelForColorHovermode(gd, rootBBox, bandElement) {
var pColorGivenCat = bandColorCount / catCount;

var labels = {
countLabel: totalCount,
countLabel: bandColorCount,
categoryLabel: catLabel,
probabilityLabel: pColorAndCat.toFixed(3)
};
Expand Down
2 changes: 1 addition & 1 deletion test/image/mocks/parcats_hoveron_color.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{"type": "parcats",
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
"hoveron": "color",
"hoverinfo": "probability",
"hoverinfo": "count+probability",
"dimensions":[
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1]},
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"]},
Expand Down

0 comments on commit d20b8e2

Please sign in to comment.