diff --git a/src/layout.js b/src/layout.js
index 5ad571c..aac4be1 100644
--- a/src/layout.js
+++ b/src/layout.js
@@ -1,6 +1,3 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-
import nodeTypes from 'rendering/types';
const normalizeBBox = box => ({
@@ -34,20 +31,4 @@ const layout = data => {
};
};
-const getBBox = content => {
- const container = document.createElement('div');
- document.body.appendChild(container);
-
- ReactDOM.render(
- , container);
-
- const box = container.querySelector('svg > g').getBBox();
- document.body.removeChild(container);
-
- return box;
-};
-
export default layout;
-export { getBBox };
diff --git a/src/rendering/Box/index.js b/src/rendering/Box/index.js
index e37be85..281435b 100644
--- a/src/rendering/Box/index.js
+++ b/src/rendering/Box/index.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { getBBox } from 'layout';
+import getBBox from 'rendering/getbbox';
import * as style from './style';
diff --git a/src/rendering/Loop/index.js b/src/rendering/Loop/index.js
index e11e9d3..71f8c18 100644
--- a/src/rendering/Loop/index.js
+++ b/src/rendering/Loop/index.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { getBBox } from 'layout';
+import getBBox from 'rendering/getbbox';
import * as style from 'rendering/style';
diff --git a/src/rendering/Text/index.js b/src/rendering/Text/index.js
index 5448d54..1bc8008 100644
--- a/src/rendering/Text/index.js
+++ b/src/rendering/Text/index.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { getBBox } from 'layout';
+import getBBox from 'rendering/getbbox';
import * as style from './style';
diff --git a/src/rendering/getbbox.js b/src/rendering/getbbox.js
new file mode 100644
index 0000000..f849139
--- /dev/null
+++ b/src/rendering/getbbox.js
@@ -0,0 +1,19 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+
+const getBBox = content => {
+ const container = document.createElement('div');
+ document.body.appendChild(container);
+
+ ReactDOM.render(
+ , container);
+
+ const box = container.querySelector('svg > g').getBBox();
+ document.body.removeChild(container);
+
+ return box;
+};
+
+export default getBBox;