Skip to content

Commit 1ef511f

Browse files
emilyklcamdecoster
andcommitted
Update src/traces/bar/cross_trace_calc.js
Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
1 parent 2294dbd commit 1ef511f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ var getAxisGroup = require('../../plots/cartesian/constraints').getAxisGroup;
1010
var Sieve = require('./sieve.js');
1111

1212
var TEXTPAD = require('./constants').TEXTPAD;
13-
var LINE_SPACING = require('../../constants/alignment').LINE_SPACING;
14-
var BR_TAG_ALL = require('../../lib/svg_text_utils').BR_TAG_ALL;
13+
const { TEXTPAD } = require('./constants');
14+
const { BR_TAG_ALL } = require('../../lib/svg_text_utils');
1515

1616
/*
1717
* Bar chart stacking/grouping positioning and autoscaling calculations
@@ -784,15 +784,15 @@ function estimateAxisPaddingForText(trace, calcTrace) {
784784
if (
785785
trace.orientation === 'v' &&
786786
(trace.text || trace.texttemplate) &&
787-
trace.textposition == 'outside' &&
788-
(trace.textangle == 'auto' || trace.textangle == 0)
787+
trace.textposition === 'outside' &&
788+
(trace.textangle === 'auto' || trace.textangle === 0)
789789
) {
790790
// count number of lines by counting <br> elements
791791
function countLines(text) {
792792
if (!text || typeof text !== 'string') return 0;
793793
return (text.match(BR_TAG_ALL) || []).length + 1;
794794
}
795-
var nLines = trace.texttemplate
795+
const nLines = trace.texttemplate
796796
? countLines(trace.texttemplate)
797797
: isArrayOrTypedArray(trace.text)
798798
? Math.max(...trace.text.map((t) => countLines(t)))

0 commit comments

Comments
 (0)