Fix numeric and numeric-string marker symbol variant detection in `scattergl` by Lexachoc · Pull Request #8071 · plotly/plotly.js · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions draftlogs/8071_fix.md
3 changes: 0 additions & 3 deletions src/traces/scattergl/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ export const SYMBOL_SDF_SIZE = 200;
export const SYMBOL_SIZE = 20;
export const SYMBOL_STROKE = SYMBOL_SIZE / 20;

export const DOT_RE = /-dot/;
export const OPEN_RE = /-open/;

export const DASHES = {
solid: [1],
dot: [1, 1],
Expand Down
14 changes: 3 additions & 11 deletions src/traces/scattergl/helpers.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
'use strict';

var constants = require('./constants');
const { symbolNumber } = require('../../components/drawing');

exports.isOpenSymbol = function(symbol) {
return (typeof symbol === 'string') ?
constants.OPEN_RE.test(symbol) :
symbol % 200 > 100;
};
exports.isOpenSymbol = (symbol) => symbolNumber(symbol) % 200 >= 100;

exports.isDotSymbol = function(symbol) {
return (typeof symbol === 'string') ?
constants.DOT_RE.test(symbol) :
symbol > 200;
};
exports.isDotSymbol = (symbol) => symbolNumber(symbol) >= 200;
32 changes: 32 additions & 0 deletions test/jasmine/tests/scattergl_test.js
Loading