Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More gl2d symbols! #1781

Merged
merged 19 commits into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from 7 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
77 changes: 77 additions & 0 deletions src/constants/gl2d_markers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright 2012-2017, 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';

module.exports = {
'circle': '●',
'circle-open': '○',
'square': '■',
'square-open': '□',
'diamond': '◆',
'diamond-open': '◇',
'cross': '✚',
'triangle-up': '▲',
'triangle-up-open': '△',
'triangle-down': '▼',
'triangle-down-open': '▽',
'triangle-left': '◄',
'triangle-left-open': '◁',
'triangle-right': '►',
'triangle-right-open': '▷',
'triangle-ne': '◥',
'triangle-ne-open': '◹',
'triangle-nw': '◤',
'triangle-nw-open': '◸',
'triangle-se': '◢',
'triangle-se-open': '◿',
'triangle-sw': '◣',
'triangle-sw-open': '◺',
'pentagon': '⬟',
'pentagon-open': '⬠',
'hexagon': '⬢',
'hexagon-open': '⬡',
'hexagon2': '⬣',
'star': '★',
'star-open': '☆',
'diamond-tall': '♦',
'diamond-tall-open': '♢',
'diamond-wide': '▰',
'diamond-wide-open': '▱',
'bowtie': '⧓',
'bowtie-open': '⋈',
'circle-cross': '⨁',
'circle-x': '⨂',
'square-cross': '⊞',
'square-x': '⊠',
'diamond-cross': '⟠',
'diamond-x': '❖',
'cross-thin': '+',
'cross-thin-open': '+',
'x-thin': '╳',
'x-thin-open': '╳',
'asterisk': '✳',
'asterisk-open': '✳',
'y-up': '⅄',
'y-up-open': '⅄',
'y-down': 'Y',
'y-down-open': 'Y',
'y-left': '≺',
'y-left-open': '≺',
'y-right': '≻',
'y-right-open': '≻',
'line-ew': '─',
'line-ew-open': '─',
'line-ns': '│',
'line-ns-open': '│',
'line-ne': '╱',
'line-ne-open': '╱',
'line-nw': '╲',
'line-nw-open': '╲'
};
File renamed without changes.
2 changes: 1 addition & 1 deletion src/traces/scatter3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var colorAttributes = require('../../components/colorscale/color_attributes');
var errorBarAttrs = require('../../components/errorbars/attributes');
var DASHES = require('../../constants/gl3d_dashes');

var MARKER_SYMBOLS = require('../../constants/gl_markers');
var MARKER_SYMBOLS = require('../../constants/gl3d_markers');
var extendFlat = require('../../lib/extend').extendFlat;

var scatterLineAttrs = scatterAttrs.line,
Expand Down
2 changes: 1 addition & 1 deletion src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var str2RgbaArray = require('../../lib/str2rgbarray');
var formatColor = require('../../lib/gl_format_color');
var makeBubbleSizeFn = require('../scatter/make_bubble_size_func');
var DASH_PATTERNS = require('../../constants/gl3d_dashes');
var MARKER_SYMBOLS = require('../../constants/gl_markers');
var MARKER_SYMBOLS = require('../../constants/gl3d_markers');

var calculateError = require('./calc_errors');

Expand Down
2 changes: 1 addition & 1 deletion src/traces/scatter3d/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var Scatter3D = {};

Scatter3D.plot = require('./convert');
Scatter3D.attributes = require('./attributes');
Scatter3D.markerSymbols = require('../../constants/gl_markers');
Scatter3D.markerSymbols = require('../../constants/gl3d_markers');
Scatter3D.supplyDefaults = require('./defaults');
Scatter3D.colorbar = require('../scatter/colorbar');
Scatter3D.calc = require('./calc');
Expand Down
2 changes: 1 addition & 1 deletion src/traces/scattergl/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var scatterAttrs = require('../scatter/attributes');
var colorAttributes = require('../../components/colorscale/color_attributes');

var DASHES = require('../../constants/gl2d_dashes');
var MARKERS = require('../../constants/gl_markers');
var MARKERS = require('../../constants/gl2d_markers');
var extendFlat = require('../../lib/extend').extendFlat;
var extendDeep = require('../../lib/extend').extendDeep;

Expand Down
2 changes: 1 addition & 1 deletion src/traces/scattergl/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var formatColor = require('../../lib/gl_format_color');
var subTypes = require('../scatter/subtypes');
var makeBubbleSizeFn = require('../scatter/make_bubble_size_func');
var getTraceColor = require('../scatter/get_trace_color');
var MARKER_SYMBOLS = require('../../constants/gl_markers');
var MARKER_SYMBOLS = require('../../constants/gl2d_markers');
var DASHES = require('../../constants/gl2d_dashes');

var AXES = ['xaxis', 'yaxis'];
Expand Down
Binary file added test/image/baselines/gl3d_marker_symbols.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/marker_symbols.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions test/image/mocks/gl3d_marker_symbols.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"data": [
{
"type": "scatter3d",
"x": [1, 2, 3, 4, 5, 6, 7, 8],
"y": [1, 1, 1, 1, 1, 1, 1, 1],
"z": [1, 1, 1, 1, 1, 1, 1, 1],
"mode": "markers",
"text": [
"marker symbol: 'circle'",
"marker symbol: 'circle-open'",
"marker symbol: 'square'",
"marker symbol: 'square-open'",
"marker symbol: 'diamond'",
"marker symbol: 'diamond-open'",
"marker symbol: 'cross'"
],
"marker": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure new marker symbols are positioned and scaled properly in gl3d before adding them. To be completed in a future PR.

"color": "blue",
"size": 8,
"symbol": [
"circle",
"circle-open",
"square",
"square-open",
"diamond",
"diamond-open",
"cross"
],
"line": {
"color": "orange",
"width": 1.5
}
},
"hovertext": "text"
}
],
"layout": {
"width": 500,
"height": 500,
"margin": {"l": 0, "r": 0, "b": 0, "t": 0},
"scene": {
"camera": {
"eye": {
"x": 0.1,
"y": 0.1,
"z": 2.1
}
},
"xaxis": {
"showgrid": false,
"zeroline": false,
"showline": false,
"showticklabels": false,
"title": "",
"range": [0, 10]
},
"yaxis": {
"showgrid": false,
"zeroline": false,
"showline": false,
"showticklabels": false,
"title": "",
"range": [0, 6]
},
"zaxis": {
"showgrid": false,
"zeroline": false,
"showline": false,
"showticklabels": false,
"title": "",
"range": [0, 2]
}
},
"hovermode": "closest"
}
}
Loading