Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrownkinetica committed Jul 9, 2018
1 parent cd0b495 commit 328fe32
Show file tree
Hide file tree
Showing 62 changed files with 23,890 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
examples/config.js
examples/ignore/*
dist/*
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "standard",
"globals": {
"btoa": true
},
"rules": {
"no-debugger": "off",
"spaced-comment": ["error", "always", { "exceptions": ["//"] }],
"semi": "off",
"space-before-function-paren": "off"
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/examples/ignore/*
/dev-dist/*
/node_modules/*
.DS_STORE
.vscode/*
test-output/*
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Kinetica Mapbox Library Changelog

# v1.0.0 <DATE>
- Initial Release
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Kinetica Kickbox.js

## Library Overview
Kinetica Kickbox.js is a set of client-side code-acellerator libraries aimed at getting you up and running with Kinetica and Mapbox GL as quickly as possible.

## Features

Specifically, this library provides common helper functions that make it easier to implement:

- WMS Layers
- Raster Layers
- Heatmap Layers
- CB Raster Layers
- Labels Layers
- Contour Layers
- Geohashed Point Cluster Layers
- Feature Identification workflows

## Why is a library needed?

While Mapbox is fully interoperable with Kinetica natively, the workflow for displaying Kinetica's WMS layers can be tricky to implement without knowing the best practices regarding their integration. Furthermore, there are common patterns that begin to emerge and this library aims to reduce the amount of code required to simply connect Kinetica's WMS output to Mapbox.

## Getting Started

### Installing Kickbox in Your Project

If you're using NPM, add this line to your package manager:

```
"dependencies": {
...
"kickbox": "kinetica/kinetica-kickbox-mapbox-gl"
...
```

Then run `npm install`.

Or from your CLI, simply run:

```
npm install --save kinetica-kickbox-mapbox-gl
```

Once it's in your node_modules folder, you can either reference the `node_modules/kinetica-kickbox/dist/kickbox.js` directly from your index.html, or use something like `var kickbox = require('kinetica-kickbox');` in your JavaScript framework.

If you're not using a package manager, you can grab a copy of Kinetica Kickbox.js from our GitHub page here: http://github.com/kinetica/kickboxjs. TODO: Put real link here

## Getting Started

- [API](./docs/api.md)
- [WMS Layers](./docs/wms.md)
- [Point Clustering](./docs/point-clustering.md)

39 changes: 39 additions & 0 deletions build/webpack.config.development.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const extractSass = new ExtractTextPlugin({
filename: 'style.css',
disable: process.env.NODE_ENV === 'development'
});

const config = {
context: path.resolve(__dirname, '../src'),
entry: {
app: './js/kickbox.js'
},
resolve: {
alias: {
'@': path.resolve(__dirname, '../src/')
}
},
output: {
library: 'kickbox',
libraryExport: 'default',
filename: 'kickbox.min.js',
path: path.resolve(__dirname, '../dev-dist'),
publicPath: path.resolve(__dirname, '../dev-dist')
},
module: {
rules: [
{ test: /\.html$/, use: ['html-loader'] },
{ test: /\.handlebars$/, loader: 'handlebars-loader' },
{ test: /\.scss$/, loader: 'style!css!sass?sourceMap' }
]
},
plugins: [
extractSass
],
devtool: 'inline-source-map'
};

module.exports = config;
54 changes: 54 additions & 0 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const extractSass = new ExtractTextPlugin({
filename: 'style.css'
});

const varConfig = {
context: path.resolve(__dirname, '../src'),
entry: {
app: ['babel-polyfill', './js/kickbox.js']
},
resolve: {
alias: {
'@': path.resolve(__dirname, '../src/')
}
},
output: {
library: 'kickbox',
libraryExport: 'default',
filename: 'kickbox.min.js',
path: path.resolve(__dirname, '../dist'),
libraryTarget: 'var'
},
module: {
rules: [
{ test: /\.html$/, use: ['html-loader'] },
{ test: /\.handlebars$/, loader: 'handlebars-loader' },
{ test: /\.scss$/, loader: 'style!css!sass' },
{ test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: { presets: ['@babel/preset-env'] }
}
}
]
},
plugins: [
extractSass,
new webpack.optimize.UglifyJsPlugin()
]
};

// #endregion Module Export

//////////////////////////////
// Module Exports
//////////////////////////////

module.exports = [varConfig];

// #endregion Module Exports
43 changes: 43 additions & 0 deletions build/webpack.config.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const path = require('path');
const webpack = require('webpack');

const config = {
devtool: 'eval-source-map',
entry: {
'kickbox': './src/js/kickbox.js',
'kickbox.cbRaster': './src/js/kickbox.cbRaster.js',
'kickbox.cluster': './src/js/kickbox.cluster.js',
'kickbox.events': './src/js/kickbox.events.js',
'kickbox.identifyByRadius': './src/js/kickbox.identifyByRadius.js',
'kickbox.identifyByPoint': './src/js/kickbox.identifyByPoint.js'
},
resolve: {
alias: {
'@': path.resolve(__dirname, '../src/')
}
},
output: {
libraryTarget: 'commonjs',
libraryExport: 'default',
filename: '[name].js',
path: path.resolve(__dirname, '../test-output')
},
module: {
rules: [
{ test: /\.handlebars$/, loader: 'handlebars-loader' },
{
test: /src\/.*\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {}
}
]
},
plugins: [
new webpack.DefinePlugin({
'ENV_TESTING': true
})
]
};

module.exports = config;
1 change: 1 addition & 0 deletions dist/kickbox.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions dist/kickbox.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 328fe32

Please sign in to comment.