diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/charts/bubble-chart.js')
-rw-r--r-- | server/sonar-web/src/main/js/components/charts/bubble-chart.js | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/components/charts/bubble-chart.js b/server/sonar-web/src/main/js/components/charts/bubble-chart.js index ab1d1833358..270bec31d12 100644 --- a/server/sonar-web/src/main/js/components/charts/bubble-chart.js +++ b/server/sonar-web/src/main/js/components/charts/bubble-chart.js @@ -37,8 +37,6 @@ export const Bubble = React.createClass({ export const BubbleChart = React.createClass({ - mixins: [ResizeMixin, TooltipsMixin], - propTypes: { items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, sizeRange: React.PropTypes.arrayOf(React.PropTypes.number), @@ -52,6 +50,8 @@ export const BubbleChart = React.createClass({ formatYTick: React.PropTypes.func }, + mixins: [ResizeMixin, TooltipsMixin], + getDefaultProps() { return { sizeRange: [5, 45], @@ -94,7 +94,12 @@ export const BubbleChart = React.createClass({ let x = xScale(tick); let y1 = yScale.range()[0]; let y2 = yScale.range()[1]; - return <line key={index} x1={x} x2={x} y1={y1} y2={y2} className="bubble-chart-grid"/>; + return <line key={index} + x1={x} + x2={x} + y1={y1} + y2={y2} + className="bubble-chart-grid"/>; }); return <g ref="xGrid">{lines}</g>; @@ -109,7 +114,12 @@ export const BubbleChart = React.createClass({ let y = yScale(tick); let x1 = xScale.range()[0]; let x2 = xScale.range()[1]; - return <line key={index} x1={x1} x2={x2} y1={y} y2={y} className="bubble-chart-grid"/>; + return <line key={index} + x1={x1} + x2={x2} + y1={y} + y2={y} + className="bubble-chart-grid"/>; }); return <g ref="yGrid">{lines}</g>; @@ -123,8 +133,12 @@ export const BubbleChart = React.createClass({ let ticks = xScale.ticks().map((tick, index) => { let x = xScale(tick); let y = yScale.range()[0]; - let text = this.props.formatXTick(tick); - return <text key={index} className="bubble-chart-tick" x={x} y={y} dy="1.5em">{text}</text>; + let innerText = this.props.formatXTick(tick); + return <text key={index} + className="bubble-chart-tick" + x={x} + y={y} + dy="1.5em">{innerText}</text>; }); return <g>{ticks}</g>; @@ -138,9 +152,13 @@ export const BubbleChart = React.createClass({ let ticks = yScale.ticks(5).map((tick, index) => { let x = xScale.range()[0]; let y = yScale(tick); - let text = this.props.formatYTick(tick); - return <text key={index} className="bubble-chart-tick bubble-chart-tick-y" - x={x} y={y} dx="-0.5em" dy="0.3em">{text}</text>; + let innerText = this.props.formatYTick(tick); + return <text key={index} + className="bubble-chart-tick bubble-chart-tick-y" + x={x} + y={y} + dx="-0.5em" + dy="0.3em">{innerText}</text>; }); return <g>{ticks}</g>; |