]> source.dussan.org Git - sonarqube.git/commitdiff
Invert y axis of project and coverage overview bubblecharts on measures page
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 25 Aug 2017 09:04:36 +0000 (11:04 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 25 Aug 2017 15:53:46 +0000 (17:53 +0200)
server/sonar-web/src/main/js/apps/component-measures/config/bubbles.js
server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.js
server/sonar-web/src/main/js/apps/component-measures/utils.js

index 12aa314d30b181cd0a1e86f990e4ba14437ecd87..04ead5c4e4ea2cbed2e44e5cf54aac4a3c41cd72 100644 (file)
@@ -37,12 +37,13 @@ export const bubbles = {
     size: 'code_smells',
     colors: ['sqale_rating']
   },
-  Coverage: { x: 'complexity', y: 'coverage', size: 'uncovered_lines' },
+  Coverage: { x: 'complexity', y: 'coverage', size: 'uncovered_lines', yDomain: [100, 0] },
   Duplications: { x: 'ncloc', y: 'duplicated_lines', size: 'duplicated_blocks' },
   project_overview: {
     x: 'sqale_index',
     y: 'coverage',
     size: 'ncloc',
-    colors: ['reliability_rating', 'security_rating']
+    colors: ['reliability_rating', 'security_rating'],
+    yDomain: [100, 0]
   }
 };
index dd333e09067f5e0b36e7b1ea24e39e55fdfddc8c..a57d110e5ea2648bd2c8ea7400cfe8d0909fd7e7 100644 (file)
@@ -29,7 +29,7 @@ import {
   translate,
   translateWithParameters
 } from '../../../helpers/l10n';
-import { getBubbleMetrics, isProjectOverview } from '../utils';
+import { getBubbleMetrics, getBubbleYDomain, isProjectOverview } from '../utils';
 import { RATING_COLORS } from '../../../helpers/constants';
 /*:: import type { Component, ComponentEnhanced } from '../types'; */
 /*:: import type { Metric } from '../../../store/metrics/actions'; */
@@ -131,6 +131,7 @@ export default class BubbleChart extends React.PureComponent {
         formatXTick={formatXTick}
         formatYTick={formatYTick}
         onBubbleClick={this.handleBubbleClick}
+        yDomain={getBubbleYDomain(this.props.domain)}
       />
     );
   }
index ff80141bc789a416d9e66606f17ac785a366b9b6..b3db6ba1baa9a85cc8b81d56dfe5f84986de172b 100644 (file)
@@ -150,6 +150,10 @@ export function getBubbleMetrics(domain /*: string */, metrics /*: { [string]: M
   };
 }
 
+export function getBubbleYDomain(domain /*: string */) {
+  return bubbles[domain].yDomain;
+}
+
 export function isProjectOverview(metric /*: string */) {
   return metric === PROJECT_OVERVEW;
 }