From 88da517aa8e393096ae64df61bc2327cd8fbcbfe Mon Sep 17 00:00:00 2001 From: Vishnu Y S Date: Fri, 13 Jan 2017 16:04:30 +0530 Subject: [PATCH 1/2] Resize according to height and width --- src/ReactBubbleChartD3.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ReactBubbleChartD3.js b/src/ReactBubbleChartD3.js index 4bf7e59..31c964d 100644 --- a/src/ReactBubbleChartD3.js +++ b/src/ReactBubbleChartD3.js @@ -36,6 +36,10 @@ import d3 from 'd3'; * duration * delay */ + +var setWidth = 300; +var setHeight = 500; + export default class ReactBubbleChartD3 { constructor(el, props = {}) { this.legendSpacing = typeof props.legendSpacing === 'number' ? props.legendSpacing : 3; @@ -49,7 +53,7 @@ export default class ReactBubbleChartD3 { // create an and element - store a reference to it for later this.svg = d3.select(el).append('svg') - .attr('class', 'bubble-chart-d3') + .attr({className:'bubble-chart-d3', width: setWidth, height: setHeight}) .style('overflow', 'visible'); this.html = d3.select(el).append('div') .attr('class', 'bubble-chart-text') @@ -58,10 +62,11 @@ export default class ReactBubbleChartD3 { .style('right', 0) .style('margin-left', 'auto') .style('margin-right', 'auto'); - this.legend = d3.select(el).append('svg') - .attr('class', 'bubble-legend') - .style('overflow', 'visible') - .style('position', 'absolute'); + this.legend = d3.select(el) + //.append('svg') + //.attr('class', 'bubble-legend') + //.style('overflow', 'visible') + //.style('position', 'absolute'); this.tooltip = this.html.append('div') .attr('class', 'tooltip') .style('position', 'absolute') From 9a33d562fa925076dd370e64b72f15f009575754 Mon Sep 17 00:00:00 2001 From: Vishnu Y S Date: Fri, 13 Jan 2017 16:11:13 +0530 Subject: [PATCH 2/2] Small bugfix --- src/ReactBubbleChartD3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactBubbleChartD3.js b/src/ReactBubbleChartD3.js index 31c964d..2377d55 100644 --- a/src/ReactBubbleChartD3.js +++ b/src/ReactBubbleChartD3.js @@ -38,7 +38,7 @@ import d3 from 'd3'; */ var setWidth = 300; -var setHeight = 500; +var setHeight = 300; export default class ReactBubbleChartD3 { constructor(el, props = {}) {