Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all textinfo/hoverinfo flags should be available to hovertemplate #3960

Closed
nicolaskruchten opened this issue Jun 13, 2019 · 5 comments
Closed

Comments

@nicolaskruchten
Copy link
Contributor

Following on from #3954 ... I'm not sure if this is or isn't the case for pie already, but it should be 🔒'ed down please :)

@archmoj
Copy link
Contributor

archmoj commented Jun 13, 2019

Thanks for the report.
The percent flag seem to be not available in hoverinfo of pie & funnelarea.

@archmoj archmoj added the bug something broken label Jun 13, 2019
@archmoj archmoj self-assigned this Jun 13, 2019
@archmoj archmoj removed the bug something broken label Jun 13, 2019
@archmoj archmoj removed their assignment Jun 13, 2019
@archmoj
Copy link
Contributor

archmoj commented Jun 13, 2019

Correction: there is no issue found with pie and funnelarea with percent flag.

@etpinard
Copy link
Contributor

@archmoj how's our test coverage for funnelarea + hoverinfo and hovertemplate ?

@archmoj
Copy link
Contributor

archmoj commented Jun 14, 2019

@archmoj how's our test coverage for funnelarea + hoverinfo and hovertemplate ?

I think that is pretty good.

For hovertemplate we have:

return Plotly.restyle(gd, 'hovertemplate', '%{percent}<extra></extra>');
})
.then(_hover)
.then(function() {
assertLabel(
['33.3%'].join('\n'),
null,
'hovertemplate %{percent}'
);
return Plotly.restyle(gd, 'hovertemplate', '%{label}<extra></extra>');
})
.then(_hover)
.then(function() {
assertLabel(
['0'].join('\n'),
null,
'hovertemplate %{label}'
);
})
.then(function() { return Plotly.restyle(gd, 'hovertemplate', [['ht 5 %{percent:0.2%}<extra></extra>', '', '', '', '']]); })
.then(_hover)
.then(function() {
assertLabel(
['ht 5 33.33%'].join('\n'),
null,
'hovertemplate arrayOK'
);
})

And for hoverinfo we have:

return Plotly.restyle(gd, 'hoverinfo', [['label+percent', null, null, null, null]]);
})
.then(_hover)
.then(function() {
assertLabel(['0', '33.3%'].join('\n'), null, 'new hoverinfo');
return Plotly.restyle(gd, 'hoverinfo', [['dont+know+what+im-doing', null, null, null, null]]);
})
.then(_hover)
.then(function() {
assertLabel(
['0', 'SUP', '5', '33.3%'].join('\n'),
null,
'garbage hoverinfo'
);
})

@etpinard
Copy link
Contributor

Yep, good enough.

I think you can close this issue @archmoj

@archmoj archmoj closed this as completed Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants