Skip to content

Commit 1c6144e

Browse files
committed
pull out 'convert' logic in scattergl/convert.js
1 parent f9a15be commit 1c6144e

File tree

5 files changed

+469
-389
lines changed

5 files changed

+469
-389
lines changed

src/constants/gl2d_dashes.js

-19
This file was deleted.

src/traces/scattergl/attributes.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ var plotAttrs = require('../../plots/attributes');
1212
var scatterAttrs = require('../scatter/attributes');
1313
var colorAttrs = require('../../components/colorscale/color_attributes');
1414

15-
var DASHES = require('../../constants/gl2d_dashes');
1615
var extendFlat = require('../../lib/extend').extendFlat;
1716
var overrideAll = require('../../plot_api/edit_types').overrideAll;
17+
var DASHES = require('./constants').DASHES;
1818

19-
var scatterLineAttrs = scatterAttrs.line,
20-
scatterMarkerAttrs = scatterAttrs.marker,
21-
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
19+
var scatterLineAttrs = scatterAttrs.line;
20+
var scatterMarkerAttrs = scatterAttrs.marker;
21+
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
2222

2323
var attrs = module.exports = overrideAll({
2424
x: scatterAttrs.x,

src/traces/scattergl/constants.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright 2012-2018, 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+
'use strict';
10+
11+
var SYMBOL_SIZE = 20;
12+
13+
module.exports = {
14+
TOO_MANY_POINTS: 1e5,
15+
16+
SYMBOL_SDF_SIZE: 200,
17+
SYMBOL_SIZE: SYMBOL_SIZE,
18+
SYMBOL_STROKE: SYMBOL_SIZE / 20,
19+
20+
DOT_RE: /-dot/,
21+
OPEN_RE: /-open/,
22+
23+
DASHES: {
24+
solid: [1],
25+
dot: [1, 1],
26+
dash: [4, 1],
27+
longdash: [8, 1],
28+
dashdot: [4, 1, 1, 1],
29+
longdashdot: [8, 1, 1, 1]
30+
}
31+
};

0 commit comments

Comments
 (0)