Skip to content

Commit 7ffde41

Browse files
committed
revise attribute description
1 parent cd2975b commit 7ffde41

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/plots/cartesian/layout_attributes.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var colorAttrs = require('../../components/color/attributes');
55
var dash = require('../../components/drawing/attributes').dash;
66
var extendFlat = require('../../lib/extend').extendFlat;
77
var templatedArray = require('../../plot_api/plot_template').templatedArray;
8-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
8+
var templateFormatStringDescription = require('../../plots/template_attributes').templateFormatStringDescription;
99
var descriptionWithDates = require('../../plots/cartesian/axis_format_attributes').descriptionWithDates;
1010

1111
var ONEDAY = require('../../constants/numerical').ONEDAY;
@@ -976,9 +976,15 @@ module.exports = {
976976
editType: 'none',
977977
description: descriptionWithDates('hover text')
978978
},
979-
unifiedhovertemplate: hovertemplateAttrs({
980-
noSupportOther: true
981-
}),
979+
unifiedhovertemplate: {
980+
valType: 'string',
981+
dflt: '',
982+
editType: 'none',
983+
description: [
984+
'Template string used for rendering the title that appear on x or y unified hover box.',
985+
templateFormatStringDescription()
986+
].join(' ')
987+
},
982988
// lines and grids
983989
showline: {
984990
valType: 'boolean',

src/plots/template_attributes.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function templateFormatStringDescription(opts) {
2222
'for details on the date formatting syntax.'
2323
].join(' ');
2424
}
25+
exports.templateFormatStringDescription = templateFormatStringDescription;
2526

2627
function shapeTemplateFormatStringDescription() {
2728
return [
@@ -71,9 +72,7 @@ exports.hovertemplateAttrs = function(opts, extra) {
7172
description: [
7273
'Template string used for rendering the information that appear on hover box.',
7374
'Note that this will override `hoverinfo`.',
74-
templateFormatStringDescription({
75-
supportOther: opts.noSupportOther ? false : true
76-
}),
75+
templateFormatStringDescription({supportOther: true}),
7776
'The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.',
7877
'Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.',
7978
descPart,

test/plot-schema.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14950,17 +14950,11 @@
1495014950
"valType": "any"
1495114951
},
1495214952
"unifiedhovertemplate": {
14953-
"arrayOk": true,
14954-
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `<extra>` is displayed in the secondary box, for example \"<extra>{fullData.name}</extra>\". To hide the secondary box completely, use an empty tag `<extra></extra>`.",
14953+
"description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.",
1495514954
"dflt": "",
1495614955
"editType": "none",
1495714956
"valType": "string"
1495814957
},
14959-
"unifiedhovertemplatesrc": {
14960-
"description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.",
14961-
"editType": "none",
14962-
"valType": "string"
14963-
},
1496414958
"visible": {
1496514959
"description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false",
1496614960
"editType": "plot",
@@ -16206,17 +16200,11 @@
1620616200
"valType": "any"
1620716201
},
1620816202
"unifiedhovertemplate": {
16209-
"arrayOk": true,
16210-
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `<extra>` is displayed in the secondary box, for example \"<extra>{fullData.name}</extra>\". To hide the secondary box completely, use an empty tag `<extra></extra>`.",
16203+
"description": "Template string used for rendering the title that appear on x or y unified hover box. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax.",
1621116204
"dflt": "",
1621216205
"editType": "none",
1621316206
"valType": "string"
1621416207
},
16215-
"unifiedhovertemplatesrc": {
16216-
"description": "Sets the source reference on Chart Studio Cloud for `unifiedhovertemplate`.",
16217-
"editType": "none",
16218-
"valType": "string"
16219-
},
1622016208
"visible": {
1622116209
"description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false",
1622216210
"editType": "plot",

0 commit comments

Comments
 (0)