From 1e492accfab7eea15880c8a5e9b043371ea76d93 Mon Sep 17 00:00:00 2001 From: josdejong Date: Fri, 3 May 2013 16:42:30 +0200 Subject: [PATCH] Fixed code examples on the home page --- _config.yml | 0 index.md | 106 ++++++++++++++++++++++++---------------------------- 2 files changed, 49 insertions(+), 57 deletions(-) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..e69de29b diff --git a/index.md b/index.md index 0f43b872..c5c133ad 100644 --- a/index.md +++ b/index.md @@ -34,39 +34,33 @@ Or download the library from the github project: To use a component, include the javascript file of vis in your webpage: -```html - - - - - - - - - -``` + + + + + + + + + or load vis.js using require.js: -```js -require.config({ - paths: { - vis: 'path/to/vis', - } -}); -require(['vis'], function (math) { - // ... load a visualization -}); -``` + require.config({ + paths: { + vis: 'path/to/vis', + } + }); + require(['vis'], function (math) { + // ... load a visualization + }); A timeline can be instantiated as: -```js -var timeline = new Timeline(container, data, options); -``` + var timeline = new Timeline(container, data, options); Where `container` is an HTML element, `data` is an Array with data or a DataSet, and `options` is an optional object with configuration options for the @@ -79,38 +73,36 @@ A basic example on loading a Timeline is shown below. More examples can be found in the [examples directory](https://github.com/almende/vis/tree/master/examples) of the project. -```html - - - - Timeline basic demo - + + + + Timeline basic demo + + + + + +
- - - -
- - - - -``` + + + ## Build