Skip to content

Commit

Permalink
boilerplate react app with mapd libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
soft-boy committed May 24, 2017
0 parents commit 0349184
Show file tree
Hide file tree
Showing 9 changed files with 3,393 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
@@ -0,0 +1,5 @@
{
"presets":[
"es2015", "stage-0", "react"
]
}
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.DS_STORE
node_modules
30 changes: 30 additions & 0 deletions package.json
@@ -0,0 +1,30 @@
{
"name": "tweetmap",
"version": "1.0.0",
"description": "MapD Tweetmap Demo",
"main": "index.js",
"license": "ISC",
"scripts": {
"start": "webpack-dev-server"
},
"dependencies": {
"html-webpack-plugin": "^2.28.0",
"path": "^0.12.7",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-redux": "^5.0.5",
"redux": "^3.6.0",
"redux-devtools": "^3.4.0",
"webpack": "^2.6.0",
"webpack-dev-server": "^2.4.5",
"@mapd/connector": "ssh://git@github.com/mapd/mapd-connector.git#develop",
"@mapd/crossfilter": "ssh://git@github.com/mapd/mapd-crossfilter.git#develop",
"@mapd/mapdc": "ssh://git@github.com/mapd/mapd-charting.git#develop"
},
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1"
}
}
12 changes: 12 additions & 0 deletions src/components/App.js
@@ -0,0 +1,12 @@
import React from 'react';
import Map from './Map.js';

export default class App extends React.Component {
render() {
return (
<div style={{textAlign: 'center'}}>
<h1>MapD TweetMap</h1>
<Map/>
</div>);
}
}
9 changes: 9 additions & 0 deletions src/components/Map.js
@@ -0,0 +1,9 @@
import React from 'react';
import * as dc from '@mapd/mapdc'

export default class Map extends React.Component {
render() {
return (
<h1>This will be the map</h1>);
}
}
12 changes: 12 additions & 0 deletions src/index.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MapD Tweetmap</title>
</head>
<body>
<div id="root">

</div>
</body>
</html>
5 changes: 5 additions & 0 deletions src/index.js
@@ -0,0 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.js';

ReactDOM.render(<App />, document.getElementById('root'));
36 changes: 36 additions & 0 deletions webpack.config.js
@@ -0,0 +1,36 @@
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
inject: 'body'
})

module.exports = {
entry: './src/index.js',
output: {
path: path.resolve('dist'),
filename: 'index_bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
include: [
path.resolve(__dirname, "src"),
path.resolve(__dirname, "node_modules/@mapd/mapdc")
]
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" }
]
}
]
},
plugins: [HtmlWebpackPluginConfig]
}

0 comments on commit 0349184

Please sign in to comment.