Skip to content

Commit

Permalink
Merge pull request #482 from Kitware/circleci
Browse files Browse the repository at this point in the history
Switch from Travis to Circle
  • Loading branch information
Roni Choudhury committed Apr 28, 2017
2 parents 53579f9 + fcd1204 commit 8c13fa6
Show file tree
Hide file tree
Showing 32 changed files with 94 additions and 129 deletions.
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion app/examples/bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BarChart from '../../../components/BarChart';
import showComponent from '../util/showComponent';

window.onload = () => {
showComponent(BarChart, 'div', {
showComponent(BarChart, {
data: [
{id: 0, a: 1, b: 3, c: 3},
{id: 1, a: 10, b: 4, c: 3},
Expand Down
2 changes: 1 addition & 1 deletion app/examples/box/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import BoxPlot from '../../../components/BoxPlot';

window.onload = () => {
showComponent(BoxPlot, 'div', {
showComponent(BoxPlot, {
data: iris,
fields: [
'sepalLength',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/bullet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import BulletChart from '../../../components/BulletChart';

window.onload = () => {
showComponent(BulletChart, 'div', {
showComponent(BulletChart, {
value: 0.2,
title: 'Error',
subtitle: '% dev from ground truth',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/date-histogram/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import Histogram from '../../../components/Histogram';

window.onload = () => {
showComponent(Histogram, 'div', {
showComponent(Histogram, {
data: stocks,
bin: 'date'
});
Expand Down
2 changes: 1 addition & 1 deletion app/examples/gantt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import GanttChart from '../../../components/GanttChart';

window.onload = () => {
showComponent(GanttChart, 'div', {
showComponent(GanttChart, {
data: [
{name: '1. Algorithms', level: 1, enter: 0, leave: 6},
{name: 'Algorithm Specification', level: 2, enter: 0, leave: 2},
Expand Down
2 changes: 1 addition & 1 deletion app/examples/geo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import Geo from '../../../components/Geo';

window.onload = () => {
showComponent(Geo, 'div', {
showComponent(Geo, {
map: {
zoom: 10,
center: {
Expand Down
2 changes: 1 addition & 1 deletion app/examples/geoblank/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import Geo from '../../../components/Geo';

window.onload = () => {
showComponent(Geo, 'div', {
showComponent(Geo, {
map: {
zoom: 10,
center: {
Expand Down
2 changes: 1 addition & 1 deletion app/examples/geodots/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import GeoDots from '../../../components/GeoDots';

window.onload = () => {
showComponent(GeoDots, 'div', {
showComponent(GeoDots, {
zoom: 10,
center: {
longitude: -87.6194,
Expand Down
2 changes: 1 addition & 1 deletion app/examples/geodotsblank/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import showComponent from '../util/showComponent';
import GeoDots from '../../../components/GeoDots';

window.onload = () => {
showComponent(GeoDots, 'div', {
showComponent(GeoDots, {
zoom: 10,
center: {
longitude: -87.6194,
Expand Down
2 changes: 1 addition & 1 deletion app/examples/heatmap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import Heatmap from '../../../components/Heatmap';

window.onload = () => {
showComponent(Heatmap, 'div', {
showComponent(Heatmap, {
data: iris,
fields: [
'sepalLength',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/histogram/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import Histogram from '../../../components/Histogram';

window.onload = () => {
showComponent(Histogram, 'div', {
showComponent(Histogram, {
data: iris,
bin: 'sepalLength',
width: 735,
Expand Down
2 changes: 1 addition & 1 deletion app/examples/line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import LineChart from '../../../components/LineChart';

window.onload = () => {
showComponent(LineChart, 'div', {
showComponent(LineChart, {
data: msft,
x: 'date',
y: ['price'],
Expand Down
2 changes: 1 addition & 1 deletion app/examples/linechart-points/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import LineChart from '../../../components/LineChart';

window.onload = () => {
let vis = showComponent(LineChart, 'div', {
let vis = showComponent(LineChart, {
data: msft,
x: 'date',
y: ['price'],
Expand Down
2 changes: 1 addition & 1 deletion app/examples/lineup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import LineUp from '../../../components/LineUp';

window.onload = () => {
showComponent(LineUp, 'div', {
showComponent(LineUp, {
data: iris,
fields: [
'species',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/onset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import OnSet from '../../../components/OnSet';

window.onload = () => {
showComponent(OnSet, 'div', {
showComponent(OnSet, {
data: simpsons,
id: 'Name',
sets: [
Expand Down
2 changes: 1 addition & 1 deletion app/examples/scatter-solid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import ScatterPlot from '../../../components/ScatterPlot';

window.onload = () => {
showComponent(ScatterPlot, 'div', {
showComponent(ScatterPlot, {
data: iris,
x: 'petalLength',
y: 'petalWidth',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/scatter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import ScatterPlot from '../../../components/ScatterPlot';

window.onload = () => {
showComponent(ScatterPlot, 'div', {
showComponent(ScatterPlot, {
data: iris,
x: 'petalLength',
y: 'petalWidth',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/scattermatrix/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import ScatterPlotMatrix from '../../../components/ScatterPlotMatrix';

window.onload = () => {
showComponent(ScatterPlotMatrix, 'div', {
showComponent(ScatterPlotMatrix, {
data: iris,
fields: [
'petalWidth',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/survival/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import SurvivalPlot from '../../../components/SurvivalPlot';

window.onload = () => {
showComponent(SurvivalPlot, 'div', {
showComponent(SurvivalPlot, {
data: hmohiv,
time: 'time',
censor: 'censor',
Expand Down
2 changes: 1 addition & 1 deletion app/examples/upset-alternate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import UpSet from '../../../components/UpSet';

window.onload = () => {
showComponent(UpSet, 'div', {
showComponent(UpSet, {
data: simpsons_alternate,
id: 'Name',
sets: [
Expand Down
2 changes: 1 addition & 1 deletion app/examples/upset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import showComponent from '../util/showComponent';
import UpSet from '../../../components/UpSet';

window.onload = () => {
showComponent(UpSet, 'div', {
showComponent(UpSet, {
data: simpsons,
id: 'Name',
sets: [
Expand Down
50 changes: 50 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
machine:
node:
version: 7.7.3

dependencies:
pre:
# Install libgif (needed for npm install).
- sudo apt-get update
- sudo apt-get install libgif-dev

# Install flake8 for Python linting.
- sudo pip install flake8

cache_directories:
- node_modules

compile:
override:
- npm run build
- npm run build:examples

test:
override:
# Lint tests.
- npm run lint
- npm run lint:pycandela

# Unit tests.
- npm run test:unit

# Image tests.
- npm run test:image:
environment:
CANDELA_DUMP_IMAGE: all

# Coverage tests.
- npm run cover
- npm run codecov

post:
# Gather up the testing images as build artifacts.
- mkdir $CIRCLE_ARTIFACTS/test_images
- find components -name '*.png' | xargs -I xxx cp xxx $CIRCLE_ARTIFACTS/test_images

deployment:
semantic-release:
branch: master
commands:
- npm run dist
- npm run semantic-release
2 changes: 1 addition & 1 deletion components/LineUp/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import $ from 'jquery';
import datalib from 'datalib';
import d3 from 'd3';
import d3 from 'lineupjs/node_modules/d3';
import VisComponent from '../../VisComponent';
import { type } from 'datalib';
import * as LineUpJS from 'lineupjs/build/LineUpJS.min';
Expand Down
Binary file modified components/LineUp/test/lineup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion components/OnSet/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import d3 from 'd3';
import d3 from 'onset/node_modules/d3';
import { unique } from 'datalib';
import onset from 'onset';
import VisComponent from '../../VisComponent';
Expand Down
26 changes: 15 additions & 11 deletions components/SimilarityGraph/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import VisComponent from '../../VisComponent';

import d3 from 'd3';
import * as d3 from 'd3';
import cola from 'webcola';

export default class SimilarityGraph extends VisComponent {
Expand All @@ -21,12 +21,12 @@ export default class SimilarityGraph extends VisComponent {
// Construct a function that returns the needed size - either a constant
// supplied in the `size` parameter, or a lookup function that pulls it from
// the data table.
const sizeMap = d3.scale.linear().domain(d3.extent(data, d => d[size])).range([5, 15]);
const sizeMap = d3.scaleLinear().domain(d3.extent(data, d => d[size])).range([5, 15]);
const sizeFunc = d => typeof size === 'string' ? sizeMap(d[size]) : size;

// Construct lookup function for the color field.
const colorScale = d3.scale.linear().domain(d3.extent(data, d => d[color])).range(['white', 'steelblue']);
const colormap = typeof data[0][color] === 'string' ? d3.scale.category10() : colorScale;
const colorScale = d3.scaleLinear().domain(d3.extent(data, d => d[color])).range(['white', 'steelblue']);
const colormap = typeof data[0][color] === 'string' ? d3.scaleOrdinal(d3.schemeCategory10) : colorScale;
const colorFunc = color !== undefined ? d => colormap(d[color]) : () => 'rgb(31, 119, 180)';

// Get the width and height of the SVG element. This is necessary here in
Expand All @@ -36,7 +36,8 @@ export default class SimilarityGraph extends VisComponent {
const h = bbox.height;

// Initialize the cola object.
this.cola = cola.d3adaptor()
console.log(d3);
this.cola = cola.d3adaptor(d3)
.linkDistance(linkDistance)
.size([w, h]);

Expand Down Expand Up @@ -73,34 +74,36 @@ export default class SimilarityGraph extends VisComponent {
.selectAll('line.link')
.data(this.links);

this.linkSelection.enter()
this.linkSelection = this.linkSelection.enter()
.append('line')
.classed('link', true)
.attr('stroke-width', 1)
.attr('stroke', 'gray');
.attr('stroke', 'gray')
.merge(this.linkSelection);

// Create a D3 selection for the nodes, and initialize it with some circle
// elements.
this.nodeSelection = d3.select(this.svg)
.selectAll('circle.node')
.data(this.nodes);

this.nodeSelection.enter()
this.nodeSelection = this.nodeSelection.enter()
.append('circle')
.classed('node', true)
.attr('r', d => d.size)
.style('stroke', 'black')
.style('fill', d => d.color)
.style('cursor', 'crosshair')
.call(this.cola.drag);
.call(this.cola.drag)
.merge(this.nodeSelection);

// Create a D3 selection for node labels.
this.labelSelection = d3.select(this.svg)
.selectAll('text.label')
.data(this.nodes);

const that = this;
this.labelSelection.enter()
this.labelSelection = this.labelSelection.enter()
.append('text')
.classed('label', true)
.text(d => d.id)
Expand All @@ -109,7 +112,8 @@ export default class SimilarityGraph extends VisComponent {
that.nodes[i].height += bbox.height;
})
.style('cursor', 'crosshair')
.call(this.cola.drag);
.call(this.cola.drag)
.merge(this.labelSelection);

this.cola.on('tick', (...args) => {
this.nodeSelection
Expand Down
2 changes: 1 addition & 1 deletion components/UpSet/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import d3 from 'd3';
import d3 from 'UpSet/node_modules/d3';
import { unique, read } from 'datalib';
import VisComponent from '../../VisComponent';
import * as upset from 'UpSet';
Expand Down

0 comments on commit 8c13fa6

Please sign in to comment.