9
9
'use strict' ;
10
10
11
11
var d3 = require ( 'd3' ) ;
12
+ var Lib = require ( '../../lib' ) ;
13
+ var numberFormat = Lib . numberFormat ;
12
14
var render = require ( './render' ) ;
13
15
var Fx = require ( '../../components/fx' ) ;
14
16
var Color = require ( '../../components/color' ) ;
15
- var Lib = require ( '../../lib' ) ;
16
17
var cn = require ( './constants' ) . cn ;
17
18
18
19
var _ = Lib . _ ;
@@ -200,7 +201,7 @@ module.exports = function plot(gd, calcData) {
200
201
link . fullData = link . trace ;
201
202
obj = d . link . trace . link ;
202
203
var hoverCenter = hoverCenterPosition ( link ) ;
203
- var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( link . value ) + d . valueSuffix } ;
204
+ var hovertemplateLabels = { valueLabel : numberFormat ( d . valueFormat ) ( link . value ) + d . valueSuffix } ;
204
205
205
206
hoverItems . push ( {
206
207
x : hoverCenter [ 0 ] ,
@@ -210,7 +211,7 @@ module.exports = function plot(gd, calcData) {
210
211
link . label || '' ,
211
212
sourceLabel + link . source . label ,
212
213
targetLabel + link . target . label ,
213
- link . concentrationscale ? concentrationLabel + d3 . format ( '%0.2f' ) ( link . flow . labelConcentration ) : ''
214
+ link . concentrationscale ? concentrationLabel + numberFormat ( '%0.2f' ) ( link . flow . labelConcentration ) : ''
214
215
] . filter ( renderableValuePresent ) . join ( '<br>' ) ,
215
216
color : castHoverOption ( obj , 'bgcolor' ) || Color . addOpacity ( link . color , 1 ) ,
216
217
borderColor : castHoverOption ( obj , 'bordercolor' ) ,
@@ -289,14 +290,14 @@ module.exports = function plot(gd, calcData) {
289
290
var hoverCenterX1 = boundingBox . right + 2 - rootBBox . left ;
290
291
var hoverCenterY = boundingBox . top + boundingBox . height / 4 - rootBBox . top ;
291
292
292
- var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
293
+ var hovertemplateLabels = { valueLabel : numberFormat ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
293
294
d . node . fullData = d . node . trace ;
294
295
295
296
var tooltip = Fx . loneHover ( {
296
297
x0 : hoverCenterX0 ,
297
298
x1 : hoverCenterX1 ,
298
299
y : hoverCenterY ,
299
- name : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
300
+ name : numberFormat ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
300
301
text : [
301
302
d . node . label ,
302
303
incomingLabel + d . node . targetLinks . length ,
0 commit comments