-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {this.state.showColors && [getNodeColor, getNodeColorDark].map(fn => (
+
+
+ {LABEL_PREFIXES.map(r => (
+
+ {LABEL_PREFIXES.map(c => (
+ |
+ ))}
+
+ ))}
+
+
+ ))}
);
}
diff --git a/client/app/scripts/components/metric-selector-item.js b/client/app/scripts/components/metric-selector-item.js
new file mode 100644
index 000000000..d3890e0a4
--- /dev/null
+++ b/client/app/scripts/components/metric-selector-item.js
@@ -0,0 +1,51 @@
+import React from 'react';
+import classNames from 'classnames';
+import { selectMetric, pinMetric, unpinMetric } from '../actions/app-actions';
+
+
+export class MetricSelectorItem extends React.Component {
+
+ constructor(props, context) {
+ super(props, context);
+
+ this.onMouseOver = this.onMouseOver.bind(this);
+ this.onMouseClick = this.onMouseClick.bind(this);
+ }
+
+ onMouseOver() {
+ const k = this.props.metric.get('id');
+ selectMetric(k);
+ }
+
+ onMouseClick() {
+ const k = this.props.metric.get('id');
+ const pinnedMetric = this.props.pinnedMetric;
+
+ if (k === pinnedMetric) {
+ unpinMetric(k);
+ } else {
+ pinMetric(k);
+ }
+ }
+
+ render() {
+ const {metric, selectedMetric, pinnedMetric} = this.props;
+ const id = metric.get('id');
+ const isPinned = (id === pinnedMetric);
+ const isSelected = (id === selectedMetric);
+ const className = classNames('metric-selector-action', {
+ 'metric-selector-action-selected': isSelected
+ });
+
+ return (
+