Skip to content

Commit

Permalink
pull out 'convert' logic in scattergl/convert.js
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Mar 21, 2018
1 parent f9a15be commit 1c6144e
Show file tree
Hide file tree
Showing 5 changed files with 469 additions and 389 deletions.
19 changes: 0 additions & 19 deletions src/constants/gl2d_dashes.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/traces/scattergl/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ var plotAttrs = require('../../plots/attributes');
var scatterAttrs = require('../scatter/attributes');
var colorAttrs = require('../../components/colorscale/color_attributes');

var DASHES = require('../../constants/gl2d_dashes');
var extendFlat = require('../../lib/extend').extendFlat;
var overrideAll = require('../../plot_api/edit_types').overrideAll;
var DASHES = require('./constants').DASHES;

var scatterLineAttrs = scatterAttrs.line,
scatterMarkerAttrs = scatterAttrs.marker,
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
var scatterLineAttrs = scatterAttrs.line;
var scatterMarkerAttrs = scatterAttrs.marker;
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;

var attrs = module.exports = overrideAll({
x: scatterAttrs.x,
Expand Down
31 changes: 31 additions & 0 deletions src/traces/scattergl/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

var SYMBOL_SIZE = 20;

module.exports = {
TOO_MANY_POINTS: 1e5,

SYMBOL_SDF_SIZE: 200,
SYMBOL_SIZE: SYMBOL_SIZE,
SYMBOL_STROKE: SYMBOL_SIZE / 20,

DOT_RE: /-dot/,
OPEN_RE: /-open/,

DASHES: {
solid: [1],
dot: [1, 1],
dash: [4, 1],
longdash: [8, 1],
dashdot: [4, 1, 1, 1],
longdashdot: [8, 1, 1, 1]
}
};
Loading

0 comments on commit 1c6144e

Please sign in to comment.