Skip to content

Commit

Permalink
Merge pull request allegro#140 from implydata/multi-measure
Browse files Browse the repository at this point in the history
Single measure mode and Bar Chart
  • Loading branch information
evasomething committed Apr 4, 2016
2 parents c43eb2d + fe8e9e9 commit b3f1bda
Show file tree
Hide file tree
Showing 112 changed files with 2,073 additions and 858 deletions.
2 changes: 2 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/dictionaries/vadim.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imply-pivot",
"version": "0.7.52",
"version": "0.8.0",
"description": "A web-based exploratory visualization UI for Druid.io",
"keywords": [
"imply",
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"body-parser": "1.15.0",
"chronoshift": "0.3.7",
"chronoshift": "0.4.2",
"clipboard": "1.5.9",
"compression": "1.6.1",
"d3": "3.5.16",
Expand All @@ -38,26 +38,26 @@
"morgan": "1.7.0",
"nopt": "3.0.6",
"numeral": "1.5.3",
"plywood": "0.9.19",
"plywood": "0.9.23",
"plywood-druid-requester": "1.4.1",
"plywood-mysql-requester": "1.2.2",
"q": "1.4.1",
"qajax": "1.3.0",
"react": "0.14.7",
"react-addons-css-transition-group": "0.14.7",
"react-dom": "0.14.7"
"react": "0.14.8",
"react-addons-css-transition-group": "0.14.8",
"react-dom": "0.14.8"
},
"devDependencies": {
"chai": "3.5.0",
"fs-extra": "0.26.7",
"gulp": "3.9.1",
"gulp-watch": "4.3.5",
"istanbul": "0.4.2",
"jsdom": "8.1.0",
"jsdom": "8.2.0",
"laborer": "2.4.13",
"mkdirp": "0.5.1",
"mocha": "2.4.5",
"react-addons-test-utils": "0.14.7",
"react-addons-test-utils": "0.14.8",
"replace": "0.3.0",
"run-sequence": "1.1.5",
"sinon": "1.17.3",
Expand Down
24 changes: 24 additions & 0 deletions src/client/components/about-modal/about-modal.mocha.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import '../../utils/jsdom-setup';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import '../../utils/require-extensions';
import * as TestUtils from 'react-addons-test-utils';

import { $, Expression } from 'plywood';
import { AboutModal } from './about-modal';

describe('AboutModal', () => {
it('adds the correct class', () => {
var renderedComponent = TestUtils.renderIntoDocument(
<AboutModal
onClose={null}
/>
);

expect(TestUtils.isCompositeComponent(renderedComponent), 'should be composite').to.equal(true);
expect((ReactDOM.findDOMNode(renderedComponent) as any).className, 'should contain class').to.contain('about-modal');
});

});
24 changes: 24 additions & 0 deletions src/client/components/about-modal/about-modal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@import '../../imports';

.about-modal {
p {
margin-bottom: $form-spacing-compact;

&:last-child {
margin-bottom: 0;
}
}

a {
color: $brand;
cursor: pointer;

&:hover {
text-decoration: underline;
}
}

.button-bar {
padding-top: 6px;
}
}
46 changes: 46 additions & 0 deletions src/client/components/about-modal/about-modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require('./about-modal.css');

import * as React from 'react';
import { Fn } from "../../../common/utils/general/general";
import { STRINGS } from '../../config/constants';
import { Modal } from '../modal/modal';
import { Button } from '../button/button';

export interface AboutModalProps extends React.Props<any> {
onClose: Fn;
}

export interface AboutModalState {
}

export class AboutModal extends React.Component<AboutModalProps, AboutModalState> {

constructor() {
super();
// this.state = {};

}

render() {
const { onClose } = this.props;

return <Modal
className="about-modal"
title="About"
onClose={onClose}
>
<p>
For feedback and support please visit the <a href="https://groups.google.com/forum/#!forum/imply-user-group">Imply User Group</a>.
</p>
<p>
For bug reports please create an issue on <a href="https://github.com/implydata/pivot/issues">GitHub</a>.
</p>
<p>
<a href="https://github.com/implydata/pivot">Imply Pivot</a> is released under the <a href="https://github.com/implydata/pivot/blob/master/LICENSE">Apache 2.0</a> license.
</p>
<div className="button-bar">
<Button type="primary" onClick={onClose} title={STRINGS.close}/>
</div>
</Modal>;
}
}
7 changes: 4 additions & 3 deletions src/client/components/auto-refresh-menu/auto-refresh-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require('./auto-refresh-menu.css');

import * as React from 'react';
import { Duration } from 'chronoshift';
import { Fn } from "../../../common/utils/general/general";
import { Stage, DataSource } from '../../../common/models/index';
import { STRINGS } from '../../config/constants';
import { BubbleMenu } from '../bubble-menu/bubble-menu';
Expand Down Expand Up @@ -29,10 +30,10 @@ const REFRESH_DURATIONS: Duration[] = [

export interface AutoRefreshMenuProps extends React.Props<any> {
openOn: Element;
onClose: Function;
onClose: Fn;
autoRefreshRate: Duration;
setAutoRefreshRate: Function;
refreshMaxTime: Function;
setAutoRefreshRate: Fn;
refreshMaxTime: Fn;
dataSource: DataSource;
}

Expand Down
2 changes: 0 additions & 2 deletions src/client/components/body-portal/body-portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ require('./body-portal.css');

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { $, Expression, Executor, Dataset } from 'plywood';
import { Essence, Filter, Dimension, Measure } from '../../../common/models/index';

export interface BodyPortalProps extends React.Props<any> {
left?: number;
Expand Down
7 changes: 2 additions & 5 deletions src/client/components/bubble-menu/bubble-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
require('./bubble-menu.css');

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { SvgIcon } from '../svg-icon/svg-icon';
import { List } from 'immutable';
import { $, Expression, Executor } from 'plywood';
import { Fn } from "../../../common/utils/general/general";
import { Stage } from '../../../common/models/index';
import { isInside, escapeKey, uniqueId } from '../../utils/dom/dom';
import { BodyPortal } from '../body-portal/body-portal';
Expand All @@ -23,7 +20,7 @@ export interface BubbleMenuProps extends React.Props<any> {
fixedSize?: boolean;
containerStage?: Stage;
openOn: Element;
onClose: Function;
onClose: Fn;
inside?: Element;
layout?: BubbleLayout;
}
Expand Down
26 changes: 26 additions & 0 deletions src/client/components/bucket-marks/bucket-marks.mocha.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import '../../utils/jsdom-setup';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import '../../utils/require-extensions';
import * as TestUtils from 'react-addons-test-utils';

import { $, Expression } from 'plywood';
import { BucketMarks } from './bucket-marks';

describe('BucketMarks', () => {
it('adds the correct class', () => {
var renderedComponent = TestUtils.renderIntoDocument(
<BucketMarks
stage={null}
ticks={null}
scale={null}
/>
);

expect(TestUtils.isCompositeComponent(renderedComponent), 'should be composite').to.equal(true);
expect((ReactDOM.findDOMNode(renderedComponent) as any).className, 'should contain class').to.contain('bucket-marks');
});

});
10 changes: 10 additions & 0 deletions src/client/components/bucket-marks/bucket-marks.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import '../../imports';

.bucket-marks {
pointer-events: none;

line {
pointer-events: none;
stroke: $gray;
}
}
49 changes: 49 additions & 0 deletions src/client/components/bucket-marks/bucket-marks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
require('./bucket-marks.css');

import * as React from 'react';
import { $, Expression, Executor, Dataset } from 'plywood';
import { Stage } from '../../../common/models/index';
import { roundToHalfPx } from "../../utils/dom/dom";

const TICK_HEIGHT = 5;

export interface BucketMarksProps extends React.Props<any> {
stage: Stage;
ticks: string[];
scale: any;
}

export interface BucketMarksState {
}

export class BucketMarks extends React.Component<BucketMarksProps, BucketMarksState> {
constructor() {
super();
// this.state = {};

}

render() {
const { stage, ticks, scale } = this.props;
var stageWidth = stage.width;

var lines: JSX.Element[] = [];
function addLine(x: number, key: string) {
if (stageWidth < x) return;
lines.push(<line key={key} x1={x} y1={0} x2={x} y2={TICK_HEIGHT}/>);
}

for (var tick of ticks) {
var x = roundToHalfPx(scale(tick));
addLine(x, '_' + tick);
}
if (ticks.length) {
var x = roundToHalfPx(scale(ticks[ticks.length - 1]) + scale.rangeBand());
addLine(x, 'last');
}

return <g className="bucket-marks" transform={stage.getTransform()}>
{lines}
</g>;
}
}
25 changes: 25 additions & 0 deletions src/client/components/button/button.mocha.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import '../../utils/jsdom-setup';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import '../../utils/require-extensions';
import * as TestUtils from 'react-addons-test-utils';

import { $, Expression } from 'plywood';
import { Button } from './button';

describe('Button', () => {
it('adds the correct class', () => {
var renderedComponent = TestUtils.renderIntoDocument(
<Button
title="Important button"
type="primary"
/>
);

expect(TestUtils.isCompositeComponent(renderedComponent), 'should be composite').to.equal(true);
expect((ReactDOM.findDOMNode(renderedComponent) as any).className, 'should contain class').to.contain('button');
});

});
11 changes: 11 additions & 0 deletions src/client/components/button/button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import '../../imports';

.button {
&.primary {
@extend %button-primary;
}

&.secondary {
@extend %button-secondary;
}
}
Loading

0 comments on commit b3f1bda

Please sign in to comment.