-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
implement hoverinfo 'none' and 'skip' in sankey #3096
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
Changes from 10 commits
69c11fe
880973a
d247b8b
1919b72
e942bc5
1813d6c
9e4f1a0
706e7ae
7c24d29
53d7ce3
87c30fe
7a32036
b436003
fe7ab49
644c4e3
ccaef04
dc8ba12
ea73c64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,9 @@ var colorAttrs = require('../../components/color/attributes'); | |
var fxAttrs = require('../../components/fx/attributes'); | ||
var domainAttrs = require('../../plots/domain').attributes; | ||
|
||
var extendFlat = require('../../lib/extend').extendFlat; | ||
var overrideAll = require('../../plot_api/edit_types').overrideAll; | ||
|
||
module.exports = overrideAll({ | ||
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { | ||
flags: ['label', 'text', 'value', 'percent', 'name'], | ||
}), | ||
hoverlabel: fxAttrs.hoverlabel, // needs editType override | ||
|
||
var attrs = module.exports = overrideAll({ | ||
domain: domainAttrs({name: 'sankey', trace: true}), | ||
|
||
orientation: { | ||
|
@@ -127,6 +121,15 @@ module.exports = overrideAll({ | |
role: 'style', | ||
description: 'Sets the thickness (in px) of the `nodes`.' | ||
}, | ||
hoverinfo: { | ||
valtype: 'enumerated', | ||
values: ['all', 'none', 'skip'], | ||
dflt: 'all', | ||
role: 'info', | ||
editType: 'none', | ||
description: plotAttrs.hoverinfo.description | ||
alexcjohnson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
hoverlabel: fxAttrs.hoverlabel, // needs editType override, | ||
description: 'The nodes of the Sankey plot.' | ||
}, | ||
|
||
|
@@ -185,6 +188,18 @@ module.exports = overrideAll({ | |
role: 'info', | ||
description: 'A numeric value representing the flow volume value.' | ||
}, | ||
hoverinfo: { | ||
valtype: 'enumerated', | ||
values: ['all', 'none', 'skip'], | ||
dflt: 'all', | ||
role: 'info', | ||
editType: 'none', | ||
description: plotAttrs.hoverinfo.description | ||
}, | ||
hoverlabel: fxAttrs.hoverlabel, // needs editType override, | ||
description: 'The links of the Sankey plot.' | ||
} | ||
}, 'calc', 'nested'); | ||
// hide unsupported top-level properties from plot-schema | ||
attrs.hoverinfo = undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh so, trace-level Does this PR close #3097 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wouldn't close it. Issue #3097 is about supporting
none actually worked except There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know. Thanks! |
||
attrs.hoverlabel = undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But wait, trace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... I think we should either make node/link There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard It's great that you noticed that change and I agree this should be handled better! FYI, having a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah indeed - good catch @etpinard - I'd go for:
That would be more friendly for the (probably most common) case that users want node and link hover labels styled the same. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... and maybe we should have a trace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g. Not all the flags to be implemented in #3097 should be available from the trace hoverinfo, but I think setting trace-wide |
Uh oh!
There was an error while loading. Please reload this page.