From 7489ae0ab121ddfd9c408280a3af2bec745c3100 Mon Sep 17 00:00:00 2001 From: josdejong Date: Tue, 16 Apr 2013 15:48:10 +0200 Subject: [PATCH] Changed build script to generate a single library vis.js in the project root --- Jakefile.js | 35 +++++------ README.md | 14 ++--- .../timeline}/01_basic.html | 4 +- .../timeline}/02_dataset.html | 0 src/visualization/{timeline => }/timeline.js | 0 .../timeline/examples/01_basic.html | 31 ---------- .../timeline/examples/02_dataset.html | 62 ------------------- bin/timeline/timeline.css => vis.css | 0 bin/timeline/timeline.js => vis.js | 2 +- bin/timeline/timeline.min.js => vis.min.js | 2 +- 10 files changed, 26 insertions(+), 124 deletions(-) rename {bin/timeline/examples => examples/timeline}/01_basic.html (87%) rename {bin/timeline/examples => examples/timeline}/02_dataset.html (100%) rename src/visualization/{timeline => }/timeline.js (100%) delete mode 100644 src/visualization/timeline/examples/01_basic.html delete mode 100644 src/visualization/timeline/examples/02_dataset.html rename bin/timeline/timeline.css => vis.css (100%) rename bin/timeline/timeline.js => vis.js (99%) rename bin/timeline/timeline.min.js => vis.min.js (99%) diff --git a/Jakefile.js b/Jakefile.js index b2bf4433..25f329ff 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -11,24 +11,22 @@ require('jake-utils'); * default task */ desc('Execute all tasks: build all libraries'); -task('default', ['timeline'], function () { +task('default', ['vis'], function () { console.log('done'); }); /** - * timeline + * vis.js, vis.css */ -desc('Build the timeline visualization'); -task('timeline', function () { - var TIMELINE = './bin/timeline/timeline.js'; - var TIMELINE_MIN = './bin/timeline/timeline.min.js'; - var DIR = './bin/timeline'; - jake.rmRf(DIR); - jake.mkdirP(DIR); +desc('Build the visualization library vis.js'); +task('vis', function () { + var VIS = './vis.js'; + var VIS_MIN = './vis.min.js'; + var VIS_CSS = './vis.css'; // concatenate the script files concat({ - dest: TIMELINE, + dest: VIS, src: [ './src/header.js', './src/util.js', @@ -46,7 +44,7 @@ task('timeline', function () { './src/component/itemset.js', './src/component/item/*.js', - './src/visualization/timeline/timeline.js', + './src/visualization/timeline.js', './lib/moment.js' ], @@ -55,7 +53,7 @@ task('timeline', function () { // concatenate the css files concat({ - dest: './bin/timeline/timeline.css', + dest: VIS_CSS, src: [ './src/component/css/panel.css', './src/component/css/item.css', @@ -66,16 +64,16 @@ task('timeline', function () { // minify javascript minify({ - src: TIMELINE, - dest: TIMELINE_MIN, + src: VIS, + dest: VIS_MIN, header: read('./src/header.js') }); // update version number and stuff in the javascript files - [TIMELINE, TIMELINE_MIN].forEach(function (file) { + [VIS, VIS_MIN].forEach(function (file) { replace({ replacements: [ - {pattern: '@@name', replacement: 'timeline'}, + {pattern: '@@name', replacement: 'vis.js'}, {pattern: '@@date', replacement: today()}, {pattern: '@@version', replacement: version()} ], @@ -83,10 +81,7 @@ task('timeline', function () { }); }); - // copy examples - jake.cpR('./src/visualization/timeline/examples', './bin/timeline/examples/'); - - console.log('created timeline library'); + console.log('created vis.js library'); }); /** diff --git a/README.md b/README.md index 66480007..59bb785c 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,11 @@ Or download the library from the github project: ## Load -To use a component, include the javascript and css file of the component -in your webpage. For example for the Timeline: +To use a component, include the javascript and css file of vis in your webpage. ```html - - + + ``` A timeline can be instantiated as: @@ -45,15 +44,16 @@ component. ## Example A basic example on loading a Timeline is shown below. More examples can be -found in the examples directories of each component. +found in the [examples directory](https://github.com/almende/vis/tree/master/examples) +of the project. ```html Timeline basic demo - - + + - - -
- - - - \ No newline at end of file diff --git a/src/visualization/timeline/examples/02_dataset.html b/src/visualization/timeline/examples/02_dataset.html deleted file mode 100644 index 42bf45de..00000000 --- a/src/visualization/timeline/examples/02_dataset.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - Timeline demo - - - - - - - -
- - - - \ No newline at end of file diff --git a/bin/timeline/timeline.css b/vis.css similarity index 100% rename from bin/timeline/timeline.css rename to vis.css diff --git a/bin/timeline/timeline.js b/vis.js similarity index 99% rename from bin/timeline/timeline.js rename to vis.js index 8ef30835..565d3acb 100644 --- a/bin/timeline/timeline.js +++ b/vis.js @@ -1,5 +1,5 @@ /** - * timeline + * vis.js * https://github.com/almende/vis * * A dynamic, browser-based visualization library. diff --git a/bin/timeline/timeline.min.js b/vis.min.js similarity index 99% rename from bin/timeline/timeline.min.js rename to vis.min.js index 4891053e..6076de89 100644 --- a/bin/timeline/timeline.min.js +++ b/vis.min.js @@ -1,5 +1,5 @@ /** - * timeline + * vis.js * https://github.com/almende/vis * * A dynamic, browser-based visualization library.