Skip to content

Commit 4890881

Browse files
committed
unifiedhovertemplate > unifiedhovertitle
1 parent 9e44a73 commit 4890881

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

draftlogs/7439_add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Add unifiedhovertemplate to format unified hover title [[#7439](https://github.com/plotly/plotly.js/pull/7439)]
1+
- Add unifiedhovertitle to format unified hover title [[#7439](https://github.com/plotly/plotly.js/pull/7439)]

src/components/fx/hover.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,14 +1214,14 @@ function createHoverText(hoverData, opts) {
12141214

12151215
var item0 = groupedHoverData[0];
12161216

1217-
var unifiedhovertemplate = (
1217+
var unifiedhovertitle = (
12181218
hovermode === 'x unified' ?
12191219
item0.xa :
12201220
item0.ya
1221-
).unifiedhovertemplate;
1221+
).unifiedhovertitle;
12221222

1223-
var mainText = !unifiedhovertemplate ? t0 :
1224-
Lib.hovertemplateString(unifiedhovertemplate, {}, fullLayout._d3locale,
1223+
var mainText = !unifiedhovertitle ? t0 :
1224+
Lib.hovertemplateString(unifiedhovertitle, {}, fullLayout._d3locale,
12251225
hovermode === 'x unified' ?
12261226
{xa: item0.xa, x: item0.xVal} :
12271227
{ya: item0.ya, y: item0.yVal}

src/plots/cartesian/axis_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
102102

103103
if(!options.noHover) {
104104
if(axType !== 'category') coerce('hoverformat');
105-
if(!options.noUnifiedhovertemplate) coerce('unifiedhovertemplate');
105+
if(!options.noUnifiedhovertitle) coerce('unifiedhovertitle');
106106
}
107107

108108
var dfltColor = coerce('color');

src/plots/cartesian/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ module.exports = {
976976
editType: 'none',
977977
description: descriptionWithDates('hover text')
978978
},
979-
unifiedhovertemplate: {
979+
unifiedhovertitle: {
980980
valType: 'string',
981981
dflt: '',
982982
editType: 'none',

src/plots/gl3d/layout/axis_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
5151
noTicklabelposition: true,
5252
noTicklabeloverflow: true,
5353
noInsiderange: true,
54-
noUnifiedhovertemplate: true,
54+
noUnifiedhovertitle: true,
5555
bgColor: options.bgColor,
5656
calendar: options.calendar
5757
},

test/jasmine/tests/hover_label_test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6902,7 +6902,7 @@ describe('hovermode: (x|y)unified', function() {
69026902
.then(done, done.fail);
69036903
});
69046904

6905-
it('should format title of unified hover in respect to `unifiedhovertemplate` linear axis', function(done) {
6905+
it('should format title of unified hover in respect to `unifiedhovertitle` linear axis', function(done) {
69066906
Plotly.newPlot(gd, [{
69076907
type: 'bar',
69086908
y: [1, 2, 3]
@@ -6911,7 +6911,7 @@ describe('hovermode: (x|y)unified', function() {
69116911
y: [2, 3, 1]
69126912
}], {
69136913
xaxis: {
6914-
unifiedhovertemplate: 'X: %{x:.2f}',
6914+
unifiedhovertitle: 'X: %{x:.2f}',
69156915
},
69166916
hovermode: 'x unified',
69176917
showlegend: false,
@@ -6934,7 +6934,7 @@ describe('hovermode: (x|y)unified', function() {
69346934
.then(done, done.fail);
69356935
});
69366936

6937-
it('should format title of unified hover in respect to `unifiedhovertemplate` date axis', function(done) {
6937+
it('should format title of unified hover in respect to `unifiedhovertitle` date axis', function(done) {
69386938
Plotly.newPlot(gd, [{
69396939
type: 'bar',
69406940
x: ['2000-01-01', '2000-02-01', '2000-03-01'],
@@ -6946,7 +6946,7 @@ describe('hovermode: (x|y)unified', function() {
69466946
}], {
69476947
xaxis: {
69486948
type: 'date',
6949-
unifiedhovertemplate: 'X: %{x|%x %X}',
6949+
unifiedhovertitle: 'X: %{x|%x %X}',
69506950
},
69516951
hovermode: 'x unified',
69526952
showlegend: false,

test/plot-schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14949,7 +14949,7 @@
1494914949
"editType": "none",
1495014950
"valType": "any"
1495114951
},
14952-
"unifiedhovertemplate": {
14952+
"unifiedhovertitle": {
1495314953
"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.",
1495414954
"dflt": "",
1495514955
"editType": "none",
@@ -16199,7 +16199,7 @@
1619916199
"editType": "none",
1620016200
"valType": "any"
1620116201
},
16202-
"unifiedhovertemplate": {
16202+
"unifiedhovertitle": {
1620316203
"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.",
1620416204
"dflt": "",
1620516205
"editType": "none",

0 commit comments

Comments
 (0)