Skip to content

Commit

Permalink
Merge pull request #133 from Esri/support/vega2
Browse files Browse the repository at this point in the history
Upgraded to Vega2
  • Loading branch information
HeikoH committed Jul 14, 2015
2 parents a2eba51 + 2a53db0 commit aa0f7c9
Show file tree
Hide file tree
Showing 39 changed files with 309 additions and 474 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ language: node_js
node_js:
- "0.10"
before_script:
- npm update -q
- gem install sass
- npm install -g grunt-cli
- npm install -g bower
- bower install
install:
- sudo apt-get install libgif-dev
script: bash ./deploy.sh
env:
global:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Upcoming

### Added
- Sparkline chart type
- JSDoc documentation

### Changed
- Upgraded to Vega2
- Tooltip demo improvements
- Homepage improvements

## v0.1

Baseline version.

- Types: Bar, Horizontal, Pie, Scatter, Bubble, Time line
- Basic interaction events: on, off, clicked
- Map to Chart interaction demos
33 changes: 5 additions & 28 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,7 @@ module.exports = function(grunt) {
// '* Apache License' +
// '*/\n';

var cedar_vega_d3 = [
'bower_components/d3/d3.js',
'bower_components/vega/vega.js',
'src/cedar.js'
];

var cedar_vega = [
'bower_components/vega/vega.js',
'src/cedar.js'
];

//core is just cedar
var core = [
var cedar_core = [
'src/cedar.js',
];

Expand Down Expand Up @@ -130,16 +118,8 @@ module.exports = function(grunt) {
sourceMap: true,
separator: '\n\n'
},
cedar_vega_d3: {
src: cedar_vega_d3,
dest: 'dist/builds/cedar-vega-d3.js'
},
cedar_vega: {
src: cedar_vega,
dest: 'dist/builds/cedar-vega.js'
},
core: {
src: core,
src: cedar_core,
dest: 'dist/builds/cedar.js'
}
},
Expand All @@ -150,17 +130,12 @@ module.exports = function(grunt) {
sourceMapIncludeSources: true,
wrap: false,
mangle:true,
// mangle: {
// except: ['d3', 'vg', 'cedar']
// },
preserveComments: 'some',
report: 'gzip'
},
dist: {
files: {
'dist/builds/cedar-vega-d3.min.js': cedar_vega_d3,
'dist/builds/cedar-vega.min.js': cedar_vega,
'dist/builds/cedar.min.js': core
'dist/builds/cedar.min.js': cedar_core
}
}
},
Expand Down Expand Up @@ -254,6 +229,8 @@ module.exports = function(grunt) {
scripts: {
files: [
{ expand: true, cwd: 'dist/builds', src: '*.js*', dest: 'site/build/js/'},
{ expand: true, cwd: 'node_modules/d3', src: 'd3.min.js', dest: 'site/build/js/'},
{ expand: true, cwd: 'node_modules/vega', src: 'vega.min.js', dest: 'site/build/js/'}
]
},
specs: {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can load Cedar and its dependencies by including script tags. This will make

```html
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/vega/1.4.3/vega.min.js"></script>
<script type="text/javascript" src="http://vega.github.io/vega/vega.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/Esri/cedar/master/src/cedar.js"></script>
<script>
var chart = new Cedar({"type": "bar"});
Expand All @@ -46,7 +46,7 @@ Altenatively, you can use Dojo loader that is bundled with the [ArcGIS API for J
main: 'topojson.min'
}, {
name: 'vega',
location: 'http://cdnjs.cloudflare.com/ajax/libs/vega/1.4.3',
location: 'http://vega.github.io/vega/',
main: 'vega.min'
}, {
name: 'cedar',
Expand Down Expand Up @@ -136,7 +136,7 @@ Make sure you have the [Grunt CLI](http://gruntjs.com/getting-started) installed
### Dependencies

* [D3](http://d3js.org/) version 3 or higher is required but the latest version is recommended.
* [Vega](http://trifacta.github.io/vega/)
* [Vega](http://vega.github.io/vega/)

### Versioning

Expand Down
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
"package.json"
],
"dependencies": {
"d3": "~3.5.2",
"vega": "~1.4.3"
"d3": "~3.5.6"
},
"resolutions": {
"d3": "~3.5.2"
"d3": "~3.5.6"
},
"devDependencies": {
"bootstrap-sass-official": "~3.3.4"
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ "$TRAVIS_BRANCH" == "master" ]; then
rm -rf site/build || exit 0;
mkdir -p site/build;

bower install
npm install
# run our compile script, discussed above
grunt docs:build

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"browserify": "~8.0.2"
},
"dependencies": {
"underscore": "~1.7.0"
"d3": "~3.5.6",
"underscore": "~1.7.0",
"vega": "~2.0.1"
}
}
12 changes: 6 additions & 6 deletions site/source/data/definitions/dc-schools-scatter-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"range": "width",
"domain": {
"data": "iris",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
}
},
{
Expand All @@ -41,15 +41,15 @@
"range": "height",
"domain": {
"data": "iris",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
}
},
{
"name": "c",
"type": "ordinal",
"domain": {
"data": "iris",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"range": [
"#800",
Expand Down Expand Up @@ -102,15 +102,15 @@
"enter": {
"x": {
"scale": "x",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
},
"y": {
"scale": "y",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
},
"fill": {
"scale": "c",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"fillOpacity": {
"value": 0.5
Expand Down
12 changes: 6 additions & 6 deletions site/source/data/definitions/home-scatter-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"range": "width",
"domain": {
"data": "iris",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
}
},
{
Expand All @@ -42,15 +42,15 @@
"range": "height",
"domain": {
"data": "iris",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
}
},
{
"name": "c",
"type": "ordinal",
"domain": {
"data": "iris",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"range": [
"#800",
Expand Down Expand Up @@ -103,15 +103,15 @@
"enter": {
"x": {
"scale": "x",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
},
"y": {
"scale": "y",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
},
"fill": {
"scale": "c",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"fillOpacity": {
"value": 0.5
Expand Down
12 changes: 6 additions & 6 deletions site/source/data/definitions/scatter-events.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"range": "width",
"domain": {
"data": "iris",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
}
},
{
Expand All @@ -42,15 +42,15 @@
"range": "height",
"domain": {
"data": "iris",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
}
},
{
"name": "c",
"type": "ordinal",
"domain": {
"data": "iris",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"range": [
"#800",
Expand Down Expand Up @@ -86,15 +86,15 @@
"enter": {
"x": {
"scale": "x",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
},
"y": {
"scale": "y",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
},
"fill": {
"scale": "c",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"fillOpacity": {
"value": 0.5
Expand Down
12 changes: 6 additions & 6 deletions site/source/data/examples/chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"range": "width",
"domain": {
"data": "iris",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
}
},
{
Expand All @@ -103,15 +103,15 @@
"range": "height",
"domain": {
"data": "iris",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
}
},
{
"name": "c",
"type": "ordinal",
"domain": {
"data": "iris",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"range": [
"#800",
Expand Down Expand Up @@ -163,15 +163,15 @@
"enter": {
"x": {
"scale": "x",
"field": "data.attributes.{x.field}"
"field": "attributes.{x.field}"
},
"y": {
"scale": "y",
"field": "data.attributes.{y.field}"
"field": "attributes.{y.field}"
},
"fill": {
"scale": "c",
"field": "data.attributes.{color.field}"
"field": "attributes.{color.field}"
},
"fillOpacity": {
"value": 0.5
Expand Down
12 changes: 6 additions & 6 deletions site/source/data/read-only-charts/dc-schools-scatter-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"range": "width",
"domain": {
"data": "iris",
"field": "data.attributes.POPULATION_ENROLLED_2008"
"field": "attributes.POPULATION_ENROLLED_2008"
}
},
{
Expand All @@ -26,15 +26,15 @@
"range": "height",
"domain": {
"data": "iris",
"field": "data.attributes.SQUARE_FOOTAGE"
"field": "attributes.SQUARE_FOOTAGE"
}
},
{
"name": "c",
"type": "ordinal",
"domain": {
"data": "iris",
"field": "data.attributes.FACUSE"
"field": "attributes.FACUSE"
},
"range": [
"#800",
Expand Down Expand Up @@ -69,15 +69,15 @@
"enter": {
"x": {
"scale": "x",
"field": "data.attributes.POPULATION_ENROLLED_2008"
"field": "attributes.POPULATION_ENROLLED_2008"
},
"y": {
"scale": "y",
"field": "data.attributes.SQUARE_FOOTAGE"
"field": "attributes.SQUARE_FOOTAGE"
},
"fill": {
"scale": "c",
"field": "data.attributes.FACUSE"
"field": "attributes.FACUSE"
},
"fillOpacity": {
"value": 0.5
Expand Down
Loading

0 comments on commit aa0f7c9

Please sign in to comment.