forked from allegro/turnilo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request allegro#140 from implydata/multi-measure
Single measure mode and Bar Chart
- Loading branch information
Showing
112 changed files
with
2,073 additions
and
858 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.