Skip to content

Commit

Permalink
Merge pull request #118 from Kitware/release-0.3
Browse files Browse the repository at this point in the history
Release 0.3
  • Loading branch information
waxlamp committed Apr 15, 2016
2 parents 85daa6c + 9d1adfa commit 56e539a
Show file tree
Hide file tree
Showing 300 changed files with 204,562 additions and 9,845 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.swp
*.sw*
*.pyc
node_modules
build
coverage
.ipynb_checkpoints
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
app
build
src
webpack.config.js
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# candela
# Candela
Visualization components for the web

# [Documentation](src/candela#readme)

# Installation from source

## Prerequisites

* npm
* cairo (`brew install cairo` on Mac OSX).

## Build

```bash
git clone https://github.com/Kitware/candela.git
cd candela
npm install
npm run build
```

# [Reference application](https://github.com/Kitware/candela/blob/master/app/resonant-reference-app/README.md)
5 changes: 0 additions & 5 deletions app/demo/index.jade

This file was deleted.

98 changes: 0 additions & 98 deletions app/demo/index.js

This file was deleted.

2 changes: 2 additions & 0 deletions app/examples/custom/dynamic-linechart/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#vcharts-line.content.border
div #[span#counter 0] updates
32 changes: 32 additions & 0 deletions app/examples/custom/dynamic-linechart/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import LineChart from './../../../../src/candela/components/LineChart';
import $ from 'jquery';
import './index.styl';

let el = document.getElementById('vcharts-line');

let data = [];

for (let i = 0; i < 20; i++) {
data.push([i, Math.random() * 10]);
}

let vis = new LineChart(el, data);
vis.render();

// Every second, add a random data point to the chart, and remove the oldest
// data point.
let counter = data.length;
window.setInterval(function () {
data.push([counter, Math.random() * 10]);
data = data.slice(1);

counter++;

vis.data(data);
vis.render();
}, 1000);

// Whenever the component renders, change the number of updates in the DOM.
vis.on('render', function () {
$('#counter').text(counter - data.length);
});
File renamed without changes.
4 changes: 4 additions & 0 deletions app/examples/custom/resize-full/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.page
#vis-element.vis-full
p.overlay This vis should have 100% width and height and should
| resize with the window.
22 changes: 22 additions & 0 deletions app/examples/custom/resize-full/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import candela from './../../../../src/candela';
import AutoResize from './../../../../src/candela/VisComponent/mixin/AutoResize';
import InitSize from './../../../../src/candela/VisComponent/mixin/InitSize';
import './index.styl';

let data = [];
for (let i = 0; i < 100; i += 1) {
data.push({x: Math.random(), y: Math.random()});
}

let el = document.getElementById('vis-element');
let vis = new (AutoResize(InitSize(candela.components.Scatter)))(el, {
data,
x: 'x',
y: 'y'
});
console.log(`initial size: ${vis.width}, ${vis.height}`);
vis.render();

vis.on('resize', () => {
console.log(`resize event: ${vis.width}, ${vis.height}`);
});
38 changes: 38 additions & 0 deletions app/examples/custom/resize-full/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
html, body, .page
width: 100%
height: 100%
margin: 0

.test-list
margin: 15px

.vis-table
height: 300px

.vis-full
width: 100%
height: 100%

.containing-matrix
width: 100%

#containing-table
width: 500px

td
max-width: 0

canvas
display: block

.overlay
position: fixed
bottom: 15px
right: 15px
width: 200px
padding: 20px
background-color: #ffeeaabb

.hidden
display: none
visibility: hidden
12 changes: 12 additions & 0 deletions app/examples/custom/resize-matrix/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.page#matrix
table.containing-matrix
tr
td.vis-element.vis-table
td.vis-element.vis-table
tr
td.vis-element.vis-table
td.vis-element.vis-table
p.overlay These vis should fit in the table and the width should resize with it
| as you change the window size.
| Note that the table cell max-width is set to zero for the columns to
| maintain even distribution.
23 changes: 23 additions & 0 deletions app/examples/custom/resize-matrix/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import candela from './../../../../src/candela';
import AutoResize from './../../../../src/candela/VisComponent/mixin/AutoResize';
import InitSize from './../../../../src/candela/VisComponent/mixin/InitSize';
import './index.styl';

let data = [];
for (let i = 0; i < 100; i += 1) {
data.push({x: Math.random(), y: Math.random()});
}

[...document.getElementsByClassName('vis-element')].forEach(el => {
let vis = new (AutoResize(InitSize(candela.components.Scatter)))(el, {
data,
x: 'x',
y: 'y'
});
console.log(`initial size: ${vis.width}, ${vis.height}`);
vis.render();

vis.on('resize', () => {
console.log(`resize event: ${vis.width}, ${vis.height}`);
});
});
38 changes: 38 additions & 0 deletions app/examples/custom/resize-matrix/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
html, body, .page
width: 100%
height: 100%
margin: 0

.test-list
margin: 15px

.vis-table
height: 300px

.vis-full
width: 100%
height: 100%

.containing-matrix
width: 100%

#containing-table
width: 500px

td
max-width: 0

canvas
display: block

.overlay
position: fixed
bottom: 15px
right: 15px
width: 200px
padding: 20px
background-color: #ffeeaabb

.hidden
display: none
visibility: hidden
18 changes: 18 additions & 0 deletions app/examples/custom/resize-table/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.page#table
table#containing-table
tr
td#vis-element.vis-table
td Hello
td There
td This
td Is
tr
td Table
td That
td I
td Made
td !!!
p.overlay This vis should fit in the table and the width should resize with it
| as the table width is updated each second.
| Note that the table cell max-width is set to zero for the columns to
| maintain even distribution.
32 changes: 32 additions & 0 deletions app/examples/custom/resize-table/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import candela from './../../../../src/candela';
import AutoResize from './../../../../src/candela/VisComponent/mixin/AutoResize';
import InitSize from './../../../../src/candela/VisComponent/mixin/InitSize';
import './index.styl';

let data = [];
for (let i = 0; i < 100; i += 1) {
data.push({x: Math.random(), y: Math.random()});
}

let el = document.getElementById('vis-element');
let vis = new (AutoResize(InitSize(candela.components.Scatter)))(el, {
data,
x: 'x',
y: 'y'
});
console.log(`initial size: ${vis.width}, ${vis.height}`);
vis.render();

vis.on('resize', () => {
console.log(`resize event: ${vis.width}, ${vis.height}`);
});

let callback = () => {
let table = document.getElementById('containing-table');
if (table) {
table.style.width = (500 + Math.floor(Math.random() * 500)) + 'px';
window.setTimeout(callback, 1000);
}
};

callback();

0 comments on commit 56e539a

Please sign in to comment.