font-style: italic;
}
+.projects-visualizations-ratings {
+ display: flex;
+ justify-content: center;
+ margin-top: 16px;
+}
+
+.projects-visualizations-ratings > *:not(:first-child) {
+ margin-left: 24px;
+}
+
+.projects-visualizations-ratings-rect {
+ display: inline-block;
+ vertical-align: top;
+ margin-top: 1px;
+ margin-right: 4px;
+ border: 1px solid;
+}
+
+.projects-visualizations-ratings-rect-inner {
+ display: block;
+ width: 8px;
+ height: 8px;
+ opacity: 0.2;
+}
+
.measure-details-bubble-chart-axis {
position: absolute;
color: #777;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+// @flow
+import React from 'react';
+import { formatMeasure } from '../../../helpers/measures';
+import { RATING_COLORS } from '../../../helpers/constants';
+
+export default function RatingsLegend() {
+ return (
+ <div className="projects-visualizations-ratings">
+ {[1, 2, 3, 4, 5].map(rating => (
+ <div key={rating}>
+ <span
+ className="projects-visualizations-ratings-rect"
+ style={{ borderColor: RATING_COLORS[rating - 1] }}>
+ <span
+ className="projects-visualizations-ratings-rect-inner"
+ style={{ backgroundColor: RATING_COLORS[rating - 1] }}
+ />
+ </span>
+ {formatMeasure(rating, 'RATING')}
+ </div>
+ ))}
+ </div>
+ );
+}
*/
// @flow
import React from 'react';
+import RatingsLegend from './RatingsLegend';
import BubbleChart from '../../../components/charts/BubbleChart';
import { formatMeasure } from '../../../helpers/measures';
import { translate, translateWithParameters } from '../../../helpers/l10n';
formatYTick={formatYTick}
height={600}
items={items}
- padding={[40, 20, 60, 100]}
+ padding={[80, 20, 60, 100]}
yDomain={[100, 0]}
/>
<div className="measure-details-bubble-chart-axis x">
'component_measures.legend.size_x',
translate('metric', SIZE_METRIC, 'name')
)}
+ <RatingsLegend />
</div>
</div>
);
*/
// @flow
import React from 'react';
+import RatingsLegend from './RatingsLegend';
import BubbleChart from '../../../components/charts/BubbleChart';
import { formatMeasure } from '../../../helpers/measures';
import { translate, translateWithParameters } from '../../../helpers/l10n';
formatYTick={formatYTick}
height={600}
items={items}
- padding={[40, 20, 60, 100]}
+ padding={[colorMetric ? 80 : 40, 20, 60, 100]}
yDomain={this.props.yDomain}
/>
<div className="measure-details-bubble-chart-axis x">
'component_measures.legend.size_x',
translate('metric', sizeMetric.key, 'name')
)}
+ {colorMetric != null && <RatingsLegend />}
</div>
</div>
);