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 symbols for gl2d and gl3d plots #1550

Closed
wants to merge 8 commits into from
Closed
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
37 changes: 36 additions & 1 deletion src/constants/gl_markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,40 @@ module.exports = {
diamond: '◆',
'diamond-open': '◇',
cross: '+',
x: '❌'
x: '❌',
'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': '☆',
'hexagram': '✶',
'diamond-tall': '♦',
'diamond-tall-open': '♢',
'hourglass': '⧗',
'hourglass-open': '⧖',
'bowtie': '⧓',
'bowtie-open': '⋈',
'circle-cross': '⊕',
'circle-x': '⊗',
'square-cross': '⊞',
'square-x': '⊠',
'asterisk': '✱'
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are two other tweaks this is going to need before it can really match how the svg symbols behave:

  • all the symbols should have roughly the same scale. You can see from the svg test image that this is a little bit subjective, for example the side of the square is the same as the diameter of the circle, but the outer width of X and + are a little bigger - basically I tweaked each one until put on a plot next to the other I thought they all looked "about the same size"
  • the symbol should be placed with its centroid at the data location, not the center of the bounding rect. For most of the symbols these are the same, but for the triangles they are not (and I guess also for the pentagons and 5-sided stars, to a lesser extent).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Basically this is going to require passing symbol-dependent offsets and scales to the relevant gl-vis modules. @destradafilm not sure if you want to take a crack at this, I'm afraid it'll be a little bit tedious and @etpinard and I may not be able to get to it for a while.

Choose a reason for hiding this comment

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

@alexcjohnson I'd like to take a crack at it, but it will take a while for me since I've got a full plate at the moment, as well.

};
Binary file added test/image/baselines/gl2d_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/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.
143 changes: 143 additions & 0 deletions test/image/mocks/gl2d_marker_symbols.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"data": [
{
"type": "scattergl",
"x": [1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7],
"y": [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5],
"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 symbol: 'x'",
"marker symbol: 'triangle-up'",
"marker symbol: 'triangle-up-open'",
"marker symbol: 'triangle-down'",
"marker symbol: 'triangle-down-open'",
"marker symbol: 'triangle-left'",
"marker symbol: 'triangle-left-open'",
"marker symbol: 'triangle-right'",
"marker symbol: 'triangle-right-open'",
"marker symbol: 'triangle-ne'",
"marker symbol: 'triangle-ne-open'",
"marker symbol: 'triangle-nw'",
"marker symbol: 'triangle-nw-open'",
"marker symbol: 'triangle-se'",
"marker symbol: 'triangle-se-open'",
"marker symbol: 'triangle-sw'",
"marker symbol: 'triangle-sw-open'",
"marker symbol: 'pentagon'",
"marker symbol: 'pentagon-open'",
"marker symbol: 'hexagon'",
"marker symbol: 'hexagon-open'",
"marker symbol: 'hexagon2'",
"marker symbol: 'star'",
"marker symbol: 'star-open'",
"marker symbol: 'hexagram'",
"marker symbol: 'diamond-tall'",
"marker symbol: 'diamond-tall-open'",
"marker symbol: 'hourglass'",
"marker symbol: 'hourglass-open'",
"marker symbol: 'bowtie'",
"marker symbol: 'bowtie-open'",
"marker symbol: 'circle-cross'",
"marker symbol: 'circle-x'",
"marker symbol: 'square-cross'",
"marker symbol: 'square-x'",
"marker symbol: 'asterisk'"
],
"marker": {
"color": "blue",
"size": 20,
"symbol": [
"circle",
"circle-open",
"square",
"square-open",
"diamond",
"diamond-open",
"cross",
"x",
"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",
"hexagram",
"diamond-tall",
"diamond-tall-open",
"hourglass",
"hourglass-open",
"bowtie",
"bowtie-open",
"circle-cross",
"circle-x",
"square-cross",
"square-x",
"asterisk"
],
"line": {
"color": "orange",
"width": 1.5
}
}
}
],
"layout": {
"width": 500,
"height": 500,
"xaxis": {
"showgrid": false,
"zeroline": false,
"showline": false,
"showticklabels": false,
"range": [0, 10]
},
"yaxis": {
"showgrid": false,
"zeroline": false,
"showline": false,
"showticklabels": false,
"range": [0, 6]
},
"annotations": [
{
"x": 0.5,
"y": 1,
"xref": "paper",
"yref": "paper",
"text": "Add 100 (or '-open') to marker number (or string) to remove the fill color,<br>Add 200 (or '-dot') to marker number (or string) to add a dot in the middle,<br>Add 300 (or '-open-dot', 'dot-open') to marker number (or string) for both.",
"font": {
"size": 10
},
"align": "left",
"showarrow": false,
"xanchor": "center",
"yanchor": "bottom"
}
],
"hovermode": "closest"
}
}
163 changes: 163 additions & 0 deletions test/image/mocks/gl3d_marker_symbols.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"data": [
{
"type": "scatter3d",
"x": [1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7],
"y": [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5],
"z": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 symbol: 'x'",
"marker symbol: 'triangle-up'",
"marker symbol: 'triangle-up-open'",
"marker symbol: 'triangle-down'",
"marker symbol: 'triangle-down-open'",
"marker symbol: 'triangle-left'",
"marker symbol: 'triangle-left-open'",
"marker symbol: 'triangle-right'",
"marker symbol: 'triangle-right-open'",
"marker symbol: 'triangle-ne'",
"marker symbol: 'triangle-ne-open'",
"marker symbol: 'triangle-nw'",
"marker symbol: 'triangle-nw-open'",
"marker symbol: 'triangle-se'",
"marker symbol: 'triangle-se-open'",
"marker symbol: 'triangle-sw'",
"marker symbol: 'triangle-sw-open'",
"marker symbol: 'pentagon'",
"marker symbol: 'pentagon-open'",
"marker symbol: 'hexagon'",
"marker symbol: 'hexagon-open'",
"marker symbol: 'hexagon2'",
"marker symbol: 'star'",
"marker symbol: 'star-open'",
"marker symbol: 'hexagram'",
"marker symbol: 'diamond-tall'",
"marker symbol: 'diamond-tall-open'",
"marker symbol: 'hourglass'",
"marker symbol: 'hourglass-open'",
"marker symbol: 'bowtie'",
"marker symbol: 'bowtie-open'",
"marker symbol: 'circle-cross'",
"marker symbol: 'circle-x'",
"marker symbol: 'square-cross'",
"marker symbol: 'square-x'",
"marker symbol: 'asterisk'"
],
"marker": {
"color": "blue",
"size": 8,
"symbol": [
"circle",
"circle-open",
"square",
"square-open",
"diamond",
"diamond-open",
"cross",
"x",
"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",
"hexagram",
"diamond-tall",
"diamond-tall-open",
"hourglass",
"hourglass-open",
"bowtie",
"bowtie-open",
"circle-cross",
"circle-x",
"square-cross",
"square-x",
"asterisk"
],
"line": {
"color": "orange",
"width": 1.5
}
}
}
],
"layout": {
"width": 500,
"height": 500,
"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]
}
},
"annotations": [
{
"x": 0.5,
"y": 1,
"xref": "paper",
"yref": "paper",
"text": "Add 100 (or '-open') to marker number (or string) to remove the fill color,<br>Add 200 (or '-dot') to marker number (or string) to add a dot in the middle,<br>Add 300 (or '-open-dot', 'dot-open') to marker number (or string) for both.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I presume (-open)?-dot is not supported in gl? That's fine, but we should be clear about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See b4db0ef

"font": {
"size": 10
},
"align": "left",
"showarrow": false,
"xanchor": "center",
"yanchor": "bottom"
}
],
"hovermode": "closest"
}
}
Loading