Skip to content

Commit 6002788

Browse files
committed
move scatter PTS_LINESONLY in constant into separate file:
- use it in attributes and default step
1 parent 94b2098 commit 6002788

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/traces/scatter/attributes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
var Drawing = require('../../components/drawing');
1212

13-
var PTS_LINESONLY = 20; // TODO put in constants/
13+
var constants = require('./constants');
14+
1415

1516
module.exports = {
1617
x: {
@@ -84,7 +85,7 @@ module.exports = {
8485
'If the provided `mode` includes *text* then the `text` elements',
8586
'appear at the coordinates. Otherwise, the `text` elements',
8687
'appear on hover.',
87-
'If there are less than ' + PTS_LINESONLY + ' points,',
88+
'If there are less than ' + constants.PTS_LINESONLY + ' points,',
8889
'then the default is *lines+markers*. Otherwise, *lines*.'
8990
].join(' ')
9091
},

src/traces/scatter/constants.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
10+
'use strict';
11+
12+
module.exports = {
13+
PTS_LINESONLY: 20
14+
};

src/traces/scatter/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ Scatter.supplyDefaults = require('./defaults');
4747
].join(' ')
4848
};
4949

50-
// traces with < this many points are by default shown
51-
// with points and lines, > just get lines
52-
scatter.PTS_LINESONLY = 20;
53-
5450
scatter.attributes = require('./attributes');
5551

5652
scatter.cleanData = function(fullData) {

0 commit comments

Comments
 (0)