Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

Resolve styled-components to root, only load 1 copy of styled-components (#7)

Shan He67c862446d1d
diff --git a/examples/webpack.config.local.js b/examples/webpack.config.local.js
index 6dc3a099c..42d88bfd3 100644
--- a/examples/webpack.config.local.js
+++ b/examples/webpack.config.local.js
@@ -54,7 +54,8 @@ function makeLocalDevConfig(EXAMPLE_DIR = LIB_DIR) {
// // Imports the kepler.gl library from the src directory in this repo
'kepler.gl': SRC_DIR,
'kepler.gl/test': TEST_DIR,
- react: resolve(LIB_DIR, './node_modules/react')
+ react: resolve(LIB_DIR, './node_modules/react'),
+ 'styled-components': resolve(LIB_DIR, './node_modules/styled-components')
}
},
module: {
diff --git a/src/components/kepler-gl.js b/src/components/kepler-gl.js
index 73a229d53..182a66eae 100644
--- a/src/components/kepler-gl.js
+++ b/src/components/kepler-gl.js
@@ -22,11 +22,9 @@ import React, {Component} from 'react';
import {console as Console} from 'global/window';
import {bindActionCreators} from 'redux';
import {json as requestJson} from 'd3-request';
-import styled from 'styled-components';
+import styled, {ThemeProvider} from 'styled-components';
import {connect as keplerGlConnect} from '../connect/keplergl-connect';
-import {ThemeProvider} from 'styled-components';
-
import * as VisStateActions from 'actions/vis-state-actions';
import * as MapStateActions from 'actions/map-state-actions';
import * as MapStyleActions from 'actions/map-style-actions';
diff --git a/website/index.html b/website/index.html
deleted file mode 100644
index 04fad5b4a..000000000
--- a/website/index.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <meta charset='UTF-8' />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Kepler.gl is a data agnostic, WebGL empowered, high-performance web application for geospatial analytic visualizations.">
- <title>Kepler.gl</title>
- <link rel="shortcut icon" href="favicon.png">
- <link rel="stylesheet" id="font-link" href="https://d1a3f4spazzrp4.cloudfront.net/uber-fonts/3.1.0/refresh.css">
-
-
- <!-— facebook open graph tags -->
- <meta property="og:url" content="https://uber.github.io/kepler.gl/" />
- <meta property="og:title" content="Large-scale WebGL-powered Geospatial Data Visualization Tool" />
- <meta property="og:description" content="Kepler.gl is a powerful web-based geospatial data analysis tool. Built on a high performance rendering engine and designed for large-scale data sets." />
- <meta property="og:site_name" content="Kepler.gl" />
- <meta property="og:image" content="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/kepler.gl-meta-tag.png" />
- <meta property="og:image:type" content="image/png" />
- <meta property="og:image:width" content="800" />
- <meta property="og:image:height" content="800" />
-
- <!-— twitter card tags -->
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:site" content="@uber">
- <meta name="twitter:creator" content="@uber">
- <meta name="twitter:title" content="Large-scale WebGL-powered Geospatial Data Visualization Tool">
- <meta name="twitter:description" content="Kepler.gl is a powerful web-based geospatial data analysis tool. Built on a high performance rendering engine and designed for large-scale data sets.">
- <meta name="twitter:image" content="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/kepler.gl-meta-tag.png" />
-
- <!-- Google Analytics -->
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-64694404-19"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
-
- gtag('config', 'UA-64694404-19');
- </script>
-
- <style>
- body {margin: 0; padding: 0; overflow: hidden;}
- </style>
- </head>
- <body>
- <script src='bundle.js'></script>
- </body>
-</html>
diff --git a/website/src/components/home.js b/website/src/components/home.js
index ca500991d..0032acccc 100644
--- a/website/src/components/home.js
+++ b/website/src/components/home.js
@@ -300,7 +300,6 @@ class Home extends Component {
return (
<ThemeProvider theme={theme}>
-
<Container>
<Helmet>
<script
diff --git a/website/src/static/index.html b/website/src/static/index.html
index e7294d626..e6c304767 100644
--- a/website/src/static/index.html
+++ b/website/src/static/index.html
@@ -7,7 +7,7 @@
<title>Kepler.gl</title>
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" id="font-link" href="https://d1a3f4spazzrp4.cloudfront.net/uber-fonts/3.1.0/refresh.css">
-
+ <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.0/mapbox-gl.css" rel="stylesheet">
<!-— facebook open graph tags -->
<meta property="og:url" content="https://uber.github.io/kepler.gl/" />
diff --git a/website/webpack.config.js b/website/webpack.config.js
index 6f0bcabdb..b3f28e289 100644
--- a/website/webpack.config.js
+++ b/website/webpack.config.js
@@ -55,7 +55,8 @@ const COMMON_CONFIG = {
'kepler.gl/dist': libSources,
// Imports the kepler.gl library from the src directory in this repo
'kepler.gl': libSources,
- react: resolve(rootDir, './node_modules/react')
+ react: resolve(rootDir, './node_modules/react'),
+ 'styled-components': resolve(rootDir, './node_modules/styled-components')
}
},