Skip to content

Commit 14610ca

Browse files
committed
require Titles directly,
into colorbar/draw and axes.js, remove Title from internal Plotly
1 parent 3e99e87 commit 14610ca

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/components/colorbar/draw.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var Fx = require('../../plots/cartesian/graph_interact');
1818
var Lib = require('../../lib');
1919
var Drawing = require('../drawing');
2020
var Color = require('../color');
21+
var Titles = require('../titles');
2122

2223
var handleAxisDefaults = require('../../plots/cartesian/axis_defaults');
2324
var handleAxisPositionDefaults = require('../../plots/cartesian/position_defaults');
@@ -253,10 +254,10 @@ module.exports = function draw(gd, id) {
253254

254255
cbAxisOut._axislayer = container.select('.cbaxis');
255256
var titleHeight = 0;
256-
if(['top','bottom'].indexOf(opts.titleside)!==-1) {
257+
if(['top', 'bottom'].indexOf(opts.titleside) !==- 1) {
257258
// draw the title so we know how much room it needs
258259
// when we squish the axis
259-
Plotly.Titles.draw(gd, cbAxisOut._id + 'title');
260+
Titles.draw(gd, cbAxisOut._id + 'title');
260261
}
261262

262263
function drawAxis(){

src/plotly.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ exports.Colorbar = require('./components/colorbar');
4848
exports.ErrorBars = require('./components/errorbars');
4949
exports.Annotations = require('./components/annotations');
5050
exports.Shapes = require('./components/shapes');
51-
exports.Titles = require('./components/titles');
5251
exports.Legend = require('./components/legend');
5352
exports.ModeBar = require('./components/modebar');
5453

@@ -59,7 +58,6 @@ exports.register = function register(_modules) {
5958
_modules = [_modules];
6059
}
6160

62-
6361
for(var i = 0; i < _modules.length; i++){
6462
var newModule = _modules[i];
6563

src/plots/cartesian/axes.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
'use strict';
1111

12-
var Plotly = require('../../plotly');
1312
var d3 = require('d3');
1413
var isNumeric = require('fast-isnumeric');
1514

15+
var Plotly = require('../../plotly');
16+
var Titles = require('../../components/titles');
17+
1618
var axes = module.exports = {};
1719

1820
axes.layoutAttributes = require('./layout_attributes');
@@ -1439,7 +1441,7 @@ axes.doTicks = function(td, axid, skipTitle) {
14391441
var tickLabels=container.selectAll('g.'+tcls).data(vals, datafn);
14401442
if(!ax.showticklabels || !isNumeric(position)) {
14411443
tickLabels.remove();
1442-
Plotly.Titles.draw(td, axid + 'title');
1444+
Titles.draw(td, axid + 'title');
14431445
return;
14441446
}
14451447

@@ -1607,7 +1609,7 @@ axes.doTicks = function(td, axid, skipTitle) {
16071609
// (so it can move out of the way if needed)
16081610
// TODO: separate out scoot so we don't need to do
16091611
// a full redraw of the title (modtly relevant for MathJax)
1610-
if(!skipTitle) Plotly.Titles.draw(td, axid + 'title');
1612+
if(!skipTitle) Titles.draw(td, axid + 'title');
16111613
return axid+' done';
16121614
}
16131615

0 commit comments

Comments
 (0)