|
1 | 1 | /*
|
2 | 2 | * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
|
3 | 3 | */
|
4 |
| -import {isUndefined, debounce, get, omit} from 'lodash'; |
| 4 | +import {isUndefined, debounce, get, has, omit} from 'lodash'; |
5 | 5 | import shallowequal from 'shallowequal';
|
6 | 6 | import React, {PropTypes} from 'react';
|
7 | 7 | import ReactHighcharts from 'react-highcharts';
|
@@ -66,12 +66,12 @@ const MINMAX = 'minmax';
|
66 | 66 |
|
67 | 67 | const datapointsColor = 'rgba(63, 127, 191, 0.5)';
|
68 | 68 | const datapointsColorWithErrors = 'rgba(63, 127, 191, 0.7)';
|
69 |
| -const errorBarColor = 'rgba(191, 192, 193, 0.5)'; |
70 |
| -const selectedColorWithErrors = 'rgba(21, 138, 15, 0.7)'; |
71 |
| -const selectedColor = 'rgba(21, 138, 15, 0.5)'; |
72 |
| -const highlightedColor = 'rgba(250, 243, 40, 1)'; |
73 |
| -const selectionRectColor = 'rgba(165, 165, 165, 0.5)'; |
74 |
| - |
| 69 | +const errorBarColor = 'rgba(255, 209, 128, 0.5)'; |
| 70 | +const selectedColorWithErrors = 'rgba(255, 200, 0, 1)'; |
| 71 | +const selectedColor = 'rgba(255, 200, 0, 1)'; |
| 72 | +const highlightedColor = 'rgba(255, 165, 0, 1)'; |
| 73 | +const selectionRectColor = 'rgba(255, 209, 128, 0.5)'; |
| 74 | +const selectionRectColorGray = 'rgba(165, 165, 165, 0.5)'; |
75 | 75 |
|
76 | 76 | /*
|
77 | 77 | @param {number} weight for a given point
|
@@ -470,9 +470,10 @@ export class XYPlot extends React.Component {
|
470 | 470 | const yMaxPx = chart.yAxis[0].toPixels(selection.yMax);
|
471 | 471 | const width = Math.abs(xMaxPx - xMinPx);
|
472 | 472 | const height = Math.abs(yMaxPx - yMinPx);
|
| 473 | + const selColor = has(this.props, 'data.decimateKey') ? selectionRectColor : selectionRectColorGray; |
473 | 474 | this.selectionRect = chart.renderer.rect(Math.min(xMinPx, xMaxPx), Math.min(yMinPx, yMaxPx), width, height, 1)
|
474 | 475 | .attr({
|
475 |
| - fill: selectionRectColor, |
| 476 | + fill: selColor, |
476 | 477 | stroke: '#8c8c8c',
|
477 | 478 | 'stroke-width': 0.5,
|
478 | 479 | zIndex: 7 // same as Highcharts' selectionMrker rectangle
|
@@ -640,7 +641,7 @@ export class XYPlot extends React.Component {
|
640 | 641 | id: HIGHLIGHTED,
|
641 | 642 | name: HIGHLIGHTED,
|
642 | 643 | color: highlightedColor,
|
643 |
| - marker: {symbol: 'circle', lineColor: '#404040', lineWidth: 1, radius: 4}, |
| 644 | + marker: {symbol: 'circle', radius: 4, lineColor: '#737373', lineWidth: 1}, |
644 | 645 | data: highlightedData,
|
645 | 646 | showInLegend: false
|
646 | 647 | }, true, false);
|
@@ -725,7 +726,7 @@ export class XYPlot extends React.Component {
|
725 | 726 | display: 'none'
|
726 | 727 | }
|
727 | 728 | },
|
728 |
| - selectionMarkerFill: selectionRectColor |
| 729 | + selectionMarkerFill: decimateKey? selectionRectColor : selectionRectColorGray |
729 | 730 | },
|
730 | 731 | exporting: {
|
731 | 732 | enabled: true
|
|
0 commit comments