Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into improve-box-violin-…
Browse files Browse the repository at this point in the history
…hoverlabels
  • Loading branch information
archmoj committed Jun 14, 2022
2 parents 98d841e + 1ec75d5 commit 3e25576
Show file tree
Hide file tree
Showing 19 changed files with 247 additions and 46 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ jobs:
command: .circleci/env_image.sh
- run:
name: Install poppler-utils to have pdftops for exporting eps
command: sudo apt-get install poppler-utils
command: |
sudo apt-get update --allow-releaseinfo-change
sudo apt-get install poppler-utils
- run:
name: Create svg, jpg, jpeg, webp, pdf and eps files
command: python3 test/image/make_exports.py
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ While non-minified source files may contain characters outside UTF-8, it is reco

> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
To support MathJax, you could load either version two or version three of MathJax files, for example:
### MathJax
You could load either version two or version three of MathJax files, for example:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
```

```html
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-svg.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-svg.js"></script>
```

> When using MathJax version 3, it is also possible to use `chtml` output on the other parts of the page in addition to `svg` output for the plotly graph.
Expand Down
1 change: 1 addition & 0 deletions draftlogs/6216_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `unselected.line.color` and `unselected.line.opacity` options to `parcoords` trace [[#6216](https://github.com/plotly/plotly.js/pull/6216)]
66 changes: 33 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"deep-equal": "^2.0.5",
"derequire": "^2.1.1",
"ecstatic": "^4.1.4",
"eslint": "^8.15.0",
"eslint": "^8.17.0",
"extra-iterable": "^2.5.22",
"falafel": "^2.2.5",
"fs-extra": "^10.1.0",
Expand All @@ -156,7 +156,7 @@
"lodash": "^4.17.21",
"madge": "^5.0.1",
"mathjax-v2": "npm:mathjax@2.7.5",
"mathjax-v3": "npm:mathjax@^3.2.1",
"mathjax-v3": "npm:mathjax@^3.2.2",
"minify-stream": "^2.1.0",
"npm-link-check": "^4.0.0",
"open": "^8.4.0",
Expand All @@ -166,7 +166,7 @@
"read-last-lines": "^1.8.0",
"run-series": "^1.1.9",
"sane-topojson": "^4.0.0",
"sass": "^1.52.1",
"sass": "^1.52.3",
"through2": "^4.0.2",
"true-case-path": "^2.2.1",
"watchify": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/shapes/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = templatedArray('shape', {

yref: extendFlat({}, annAttrs.yref, {
description: [
'Sets the annotation\'s y coordinate axis.',
'Sets the shape\'s y coordinate axis.',
axisPlaceableObjs.axisRefDescription('y', 'bottom', 'top')
].join(' ')
}),
Expand Down
30 changes: 29 additions & 1 deletion src/traces/parcoords/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,33 @@ module.exports = {
autoColorDflt: false,
editTypeOverride: 'calc'
})
)
),

unselected: {
line: {
color: {
valType: 'color',
dflt: '#777',
editType: 'plot',
description: [
'Sets the base color of unselected lines.',
'in connection with `unselected.line.opacity`.'
].join(' ')
},
opacity: {
valType: 'number',
min: 0,
max: 1,
dflt: 'auto',
editType: 'plot',
description: [
'Sets the opacity of unselected lines.',
'The default *auto* decreases the opacity smoothly as the number of lines increases.',
'Use *1* to achieve exact `unselected.line.color`.'
].join(' ')
},
editType: 'plot'
},
editType: 'plot'
}
};
1 change: 0 additions & 1 deletion src/traces/parcoords/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
layers: ['contextLineLayer', 'focusLineLayer', 'pickLineLayer'],
axisTitleOffset: 28,
axisExtentOffset: 10,
deselectedLineColor: '#777',
bar: {
width: 4, // Visible width of the filter bar
captureWidth: 10, // Mouse-sensitive width for interaction (Fitts law)
Expand Down
3 changes: 3 additions & 0 deletions src/traces/parcoords/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

coerce('labelangle');
coerce('labelside');

coerce('unselected.line.color');
coerce('unselected.line.opacity');
};
5 changes: 3 additions & 2 deletions src/traces/parcoords/lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function makeItem(
var layoutWidth = model.layoutWidth * plotGlPixelRatio;

var deselectedLinesColor = model.deselectedLines.color;
var deselectedLinesOpacity = model.deselectedLines.opacity;

var itemModel = Lib.extendFlat({
key: crossfilterDimensionIndex,
Expand All @@ -206,8 +207,8 @@ function makeItem(
deselectedLinesColor[0] / 255,
deselectedLinesColor[1] / 255,
deselectedLinesColor[2] / 255,
deselectedLinesColor[3] < 1 ?
deselectedLinesColor[3] :
deselectedLinesOpacity !== 'auto' ?
deselectedLinesColor[3] * deselectedLinesOpacity :
Math.max(1 / 255, Math.pow(1 / model.lines.color.length, 1 / 3))
],

Expand Down
5 changes: 4 additions & 1 deletion src/traces/parcoords/parcoords.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ function model(layout, d, i) {
var trace = cd0.trace;
var lineColor = helpers.convertTypedArray(cd0.lineColor);
var line = trace.line;
var deselectedLines = {color: rgba(c.deselectedLineColor)};
var deselectedLines = {
color: rgba(trace.unselected.line.color),
opacity: trace.unselected.line.opacity
};
var cOpts = Colorscale.extractOpts(line);
var cscale = cOpts.reversescale ? Colorscale.flipScale(cd0.cscale) : cd0.cscale;
var domain = trace.domain;
Expand Down
Binary file modified test/image/baselines/gl2d_parcoords_256_colors.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 modified test/image/baselines/gl2d_parcoords_constraints.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 modified test/image/baselines/gl2d_parcoords_dark_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions test/image/mocks/gl2d_parcoords_256_colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"data": [
{
"type": "parcoords",
"unselected": {
"line": {
"color": "blue"
}
},
"line": {
"colorscale": [
[
Expand Down
8 changes: 8 additions & 0 deletions test/image/mocks/gl2d_parcoords_constraints.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"layout": {
"paper_bgcolor": "lightgray",
"width": 1000,
"height": 400
},
Expand All @@ -24,6 +25,13 @@
]
},

"unselected": {
"line": {
"opacity": 1,
"color": "white"
}
},

"dimensions": [
{
"label": "±1.1",
Expand Down
6 changes: 6 additions & 0 deletions test/image/mocks/gl2d_parcoords_dark_background.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"color": [-41, -1317, -164, -1856, -79, -931, -191, -2983, -341, -3846, -278, -3019, -523, -2357, -985, -3447, -211, -2842, -458, -4388, -784, -2563, -935, -2253, -313, -3667, -1479, -1030, -632, -623, -1945, -1324, -1221, -878, -947, -1615, -697, -575, -482, -905, -869, -433, -484, -349, -667, -248, -1135, -888, -1019, -223, -2067, -729, -579, -659, -334, -340, -554, -455, -377, -375, -453, -834, -934, -334, -369, -290, -354, -497, -490, -329, -729, -1794, -151, -1162, -3935, -1013, -509, -825, -997, -320, -680, -422, -785, -542, -563, -489, -1283, -680, -78, -450, -514, -449, -548, -661, -641, -503, -570, -257, -394, -450]
},

"unselected": {
"line": {
"opacity": 0.5
}
},

"dimensions": [
{
"constraintrange": [100000, 150000],
Expand Down
Loading

0 comments on commit 3e25576

Please sign in to comment.