-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from spenceralger/visualize_skelly
save point
- Loading branch information
Showing
308 changed files
with
182,006 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "K4D3", | ||
"main": "core.js", | ||
"scripts": [ | ||
"k4.d3.js" | ||
], | ||
"homepage": "https://github.com/elasticsearch/K4D3", | ||
"authors": [ | ||
"Shelby Sturgis", | ||
"Juan Thomassie" | ||
], | ||
"description": "D3 Charting Library for Kibana 4", | ||
"keywords": [ | ||
"data", | ||
"visualization", | ||
"elasticsearch", | ||
"kibana" | ||
], | ||
"license": "MIT", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"d3": "~3.4.1", | ||
"requirejs": "~2.1.11", | ||
"queue-async": "~1.0.7", | ||
"topojson": "~1.4.6" | ||
}, | ||
"devDependencies": {}, | ||
"_release": "1a5f428a2b", | ||
"_resolution": { | ||
"type": "branch", | ||
"branch": "master", | ||
"commit": "1a5f428a2b4493e9a11934956a7ac8ad9328a5c8" | ||
}, | ||
"_source": "[email protected]:elasticsearch/K4D3.git", | ||
"_target": "*", | ||
"_originalSource": "[email protected]:elasticsearch/K4D3.git", | ||
"_direct": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
module.exports = function(grunt) { | ||
|
||
//Project configuration. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
karma: { | ||
unit: { | ||
configFile: 'karma.conf.js' | ||
} | ||
}, | ||
concat: { | ||
options: { | ||
separator: '' | ||
}, | ||
dist: { | ||
src: [ | ||
'src/start.js', | ||
'src/core.js', | ||
'src/modules/area.js', | ||
'src/modules/dendrogram.js', | ||
'src/modules/heatmap.js', | ||
'src/modules/histogram.js', | ||
'src/modules/horizon.js', | ||
'src/modules/line.js', | ||
'src/modules/map.js', | ||
'src/modules/pie.js', | ||
'src/modules/scatterplot.js', | ||
'src/modules/sparkline.js', | ||
'src/modules/spider.js', | ||
'src/modules/sunburst.js', | ||
'src/modules/sortedTable.js', | ||
'src/modules/timeBars.js', | ||
'src/modules/treemap.js', | ||
'src/modules/table.js', | ||
'src/end.js' | ||
], | ||
dest: 'k4.d3.js' | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + | ||
'<%= grunt.template.today("yyyy-mm-dd") %> */' | ||
}, | ||
js: { | ||
files: { | ||
'k4.d3.min.js': ['k4.d3.js'] | ||
} | ||
} | ||
}, | ||
jshint: { | ||
foo: { | ||
src: "src/**/*.js" | ||
}, | ||
options: { | ||
jshintrc: '.jshintrc' | ||
} | ||
}, | ||
watch: { | ||
js: { | ||
files: ["src/**/*.js"], | ||
tasks: ['concat'] | ||
} | ||
}, | ||
copy: { | ||
css: { | ||
files: [ | ||
{ src: 'style/k4.d3.css', dest: 'k4.d3.css' } | ||
] | ||
} | ||
}, | ||
cssmin: { | ||
dist: { | ||
files: { | ||
'k4.d3.min.css' : ['k4.d3.css'] | ||
} | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-karma'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-contrib-concat'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); | ||
|
||
grunt.registerTask('default', ['concat', 'copy', 'watch']); | ||
grunt.registerTask('production', ['concat', 'uglify', 'copy', 'cssmin']); | ||
grunt.registerTask('release', ['production']); | ||
grunt.registerTask('lint', ['jshint']); | ||
grunt.registerTask('unit-test', ['karma']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# target is the final output for your library | ||
TARGET=k4.js | ||
SRC_FILES=$(shell find src -type f -name "*.js") | ||
BUILD_OPTIONS=build/build.js | ||
RJS=node_modules/.bin/r.js | ||
|
||
all: build | ||
|
||
build: $(TARGET) | ||
|
||
clean: | ||
rm -rf $(TARGET) node_modules | ||
|
||
$(TARGET): $(RJS) | ||
$(RJS) -o $(BUILD_OPTIONS) out=$(TARGET) | ||
|
||
$(RJS): | ||
npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# K4D3 | ||
D3 Visualization Library for Kibana 4! | ||
|
||
## Environment Setup | ||
1. Fork the repository. You will need node, npm, bower, and grunt installed. | ||
|
||
a. Install node and npm. | ||
|
||
b. To install Bower, run: | ||
|
||
```bash | ||
npm install -g bower | ||
``` | ||
|
||
c. To install Grunt, run: | ||
|
||
```bash | ||
npm install -g grunt cli | ||
``` | ||
|
||
2. Change into the project's root directory. | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
Run Grunt with `grunt`. That's it! | ||
|
||
## Directory Structure | ||
Despite the fact that this may be obvious, I always find a directory layout helpful. | ||
|
||
1. `docs/` - visualization library documentation. | ||
2. `examples/` - example code for creating charts. | ||
3. `lib/` - third party dependencies. | ||
4. `src/` - source code. | ||
5. `tests/` - unit tests. | ||
6. `.bowerrc` - bower configuration file. | ||
7. `.gitignore` - list of files/directories for git to ignore. | ||
8. `.jshintrc` - jshint configurations. | ||
9. `GruntFile.js` - Grunt configuration file. | ||
10. `bower.json` - bower dependencies list. | ||
11. `index.html` - list of charting examples. | ||
12. `kd3.css` - concatenated css code. | ||
13. `kd3.min.css` - minified, concatenated css code. | ||
14. `k4.d3.js` - concatenated source code. | ||
15. `k4.d3.min.js` - minified, concatenated source code. | ||
16. `karma.conf.js` - Karma configuration file for testing. | ||
17. `package.json` - npm config file with (Grunt) development dependencies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "K4D3", | ||
"version": "0.1.0", | ||
"main": "k4.d3.js", | ||
"scripts": [ | ||
"k4.d3.js" | ||
], | ||
"homepage": "https://github.com/elasticsearch/K4D3", | ||
"authors": [ | ||
"Shelby Sturgis", | ||
"Juan Thomassie" | ||
], | ||
"description": "D3 Charting Library for Kibana 4", | ||
"main": "core.js", | ||
"keywords": [ | ||
"data", | ||
"visualization", | ||
"elasticsearch", | ||
"kibana" | ||
], | ||
"license": "MIT", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"d3": "~3.4.1", | ||
"requirejs": "~2.1.11", | ||
"queue-async": "~1.0.7", | ||
"topojson": "~1.4.6" | ||
}, | ||
"devDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Example Doc | ||
Work in progress! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Area Test</title> | ||
<style> | ||
body { | ||
font: 10px sans-serif; | ||
fill: #444; | ||
background: #f4f4f4; | ||
} | ||
|
||
.axis path, | ||
.axis line { | ||
fill: none; | ||
stroke: #ccc; | ||
shape-rendering: crispEdges; | ||
} | ||
|
||
rect { | ||
fill: #fff; | ||
} | ||
|
||
.area { | ||
/* fill: rgba(113, 131, 255, .7); */ | ||
} | ||
|
||
.line { | ||
/* | ||
stroke: #2a39ff; | ||
stroke-width: 3.5px; | ||
*/ | ||
} | ||
|
||
.tooltip { | ||
position: absolute; | ||
text-align: center; | ||
width: 100px; | ||
height: 100px; | ||
padding: 5px; | ||
font: 12px sans-serif; | ||
background: black; | ||
border: 0px; | ||
border-radius: 8px; | ||
pointer-events: none; | ||
left: -120px; | ||
top: 100px; | ||
/*visibility: hidden;*/ | ||
} | ||
|
||
.overlay { | ||
fill: none; | ||
pointer-events: all; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div id="area-chart"></div> | ||
|
||
<script src="../lib/d3/d3.min.js"></script> | ||
<script src="../k4.d3.js"></script> | ||
<script> | ||
var formatDate = d3.time.format("%b %Y").parse, | ||
data = [ | ||
{x: "Jan 2013", y: 256}, | ||
{x: "Feb 2013", y: 770}, | ||
{x: "Mar 2013", y: 470}, | ||
{x: "Apr 2013", y: 370}, | ||
{x: "May 2013", y: 159}, | ||
{x: "Jun 2013", y: 809}, | ||
{x: "Jul 2013", y: 689}, | ||
{x: "Aug 2013", y: 299}, | ||
{x: "Sep 2013", y: 630}, | ||
{x: "Oct 2013", y: 106}, | ||
{x: "Nov 2013", y: 506}, | ||
{x: "Dec 2013", y: 23} | ||
]; | ||
|
||
var viz = k4.area() | ||
.height(500) | ||
.width(960) | ||
.interpolate("linear") | ||
.x(function(d) { return formatDate(d.x); }) | ||
.y(function(d) { return d.y; }); | ||
|
||
d3.select("#area-chart") | ||
.datum(data) | ||
.call(viz); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.