1
1
'use strict' ;
2
2
3
3
var d3 = require ( '@plotly/d3' ) ;
4
+ var Lib = require ( '../../lib' ) ;
5
+ var numberFormat = Lib . numberFormat ;
4
6
var render = require ( './render' ) ;
5
7
var Fx = require ( '../../components/fx' ) ;
6
8
var Color = require ( '../../components/color' ) ;
7
- var Lib = require ( '../../lib' ) ;
8
9
var cn = require ( './constants' ) . cn ;
9
10
10
11
var _ = Lib . _ ;
@@ -192,7 +193,7 @@ module.exports = function plot(gd, calcData) {
192
193
link . fullData = link . trace ;
193
194
obj = d . link . trace . link ;
194
195
var hoverCenter = hoverCenterPosition ( link ) ;
195
- var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( link . value ) + d . valueSuffix } ;
196
+ var hovertemplateLabels = { valueLabel : numberFormat ( d . valueFormat ) ( link . value ) + d . valueSuffix } ;
196
197
197
198
hoverItems . push ( {
198
199
x : hoverCenter [ 0 ] ,
@@ -202,7 +203,7 @@ module.exports = function plot(gd, calcData) {
202
203
link . label || '' ,
203
204
sourceLabel + link . source . label ,
204
205
targetLabel + link . target . label ,
205
- link . concentrationscale ? concentrationLabel + d3 . format ( '%0.2f' ) ( link . flow . labelConcentration ) : ''
206
+ link . concentrationscale ? concentrationLabel + numberFormat ( '%0.2f' ) ( link . flow . labelConcentration ) : ''
206
207
] . filter ( renderableValuePresent ) . join ( '<br>' ) ,
207
208
color : castHoverOption ( obj , 'bgcolor' ) || Color . addOpacity ( link . color , 1 ) ,
208
209
borderColor : castHoverOption ( obj , 'bordercolor' ) ,
@@ -281,7 +282,7 @@ module.exports = function plot(gd, calcData) {
281
282
var hoverCenterX1 = boundingBox . right + 2 - rootBBox . left ;
282
283
var hoverCenterY = boundingBox . top + boundingBox . height / 4 - rootBBox . top ;
283
284
284
- var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
285
+ var hovertemplateLabels = { valueLabel : numberFormat ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
285
286
d . node . fullData = d . node . trace ;
286
287
287
288
gd . _fullLayout . _calcInverseTransform ( gd ) ;
@@ -292,7 +293,7 @@ module.exports = function plot(gd, calcData) {
292
293
x0 : scaleX * hoverCenterX0 ,
293
294
x1 : scaleX * hoverCenterX1 ,
294
295
y : scaleY * hoverCenterY ,
295
- name : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
296
+ name : numberFormat ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
296
297
text : [
297
298
d . node . label ,
298
299
incomingLabel + d . node . targetLinks . length ,
0 commit comments