99'use strict' ;
1010
1111var d3 = require ( 'd3' ) ;
12+ var Lib = require ( '../../lib' ) ;
13+ var numberFormat = Lib . numberFormat ;
1214var render = require ( './render' ) ;
1315var Fx = require ( '../../components/fx' ) ;
1416var Color = require ( '../../components/color' ) ;
15- var Lib = require ( '../../lib' ) ;
1617var cn = require ( './constants' ) . cn ;
1718
1819var _ = Lib . _ ;
@@ -200,7 +201,7 @@ module.exports = function plot(gd, calcData) {
200201 link . fullData = link . trace ;
201202 obj = d . link . trace . link ;
202203 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 } ;
204205
205206 hoverItems . push ( {
206207 x : hoverCenter [ 0 ] ,
@@ -210,7 +211,7 @@ module.exports = function plot(gd, calcData) {
210211 link . label || '' ,
211212 sourceLabel + link . source . label ,
212213 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 ) : ''
214215 ] . filter ( renderableValuePresent ) . join ( '<br>' ) ,
215216 color : castHoverOption ( obj , 'bgcolor' ) || Color . addOpacity ( link . color , 1 ) ,
216217 borderColor : castHoverOption ( obj , 'bordercolor' ) ,
@@ -289,14 +290,14 @@ module.exports = function plot(gd, calcData) {
289290 var hoverCenterX1 = boundingBox . right + 2 - rootBBox . left ;
290291 var hoverCenterY = boundingBox . top + boundingBox . height / 4 - rootBBox . top ;
291292
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 } ;
293294 d . node . fullData = d . node . trace ;
294295
295296 var tooltip = Fx . loneHover ( {
296297 x0 : hoverCenterX0 ,
297298 x1 : hoverCenterX1 ,
298299 y : hoverCenterY ,
299- name : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
300+ name : numberFormat ( d . valueFormat ) ( d . node . value ) + d . valueSuffix ,
300301 text : [
301302 d . node . label ,
302303 incomingLabel + d . node . targetLinks . length ,
0 commit comments