Skip to content

Commit

Permalink
Merge pull request #2430 from palantir/r1.2.0
Browse files Browse the repository at this point in the history
Release version 1.2.0 (--> master)
  • Loading branch information
jtlan committed Jul 2, 2015
2 parents b5c7e98 + ce23640 commit 2a7066e
Show file tree
Hide file tree
Showing 37 changed files with 1,071 additions and 398 deletions.
10 changes: 3 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
"d3": true,
"Plottable": true,
"makeRandomData": true,
"deep_copy": true
"deepCopy": true
},
"rules": {
"no-eval": 0,
"quotes": 0,
"no-console": 0,
"quotes": [2, "double", "avoid-escape"],
"no-unused-vars": [2, {"vars": "local"}],
"no-multi-spaces": 0,
"camelcase": 0,
"comma-spacing": 0,
"no-use-before-define": 0,
"strict": 0
"no-use-before-define": [2, "nofunc"]
}
}
97 changes: 48 additions & 49 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function(grunt) {
src: ["src/**/*.ts", "typings/**/*.d.ts"],
outDir: "build/src/",
options: {
target: 'es5',
target: "es5",
noImplicitAny: true,
sourceMap: false,
declaration: true,
Expand All @@ -21,15 +21,15 @@ module.exports = function(grunt) {
outDir: "build/test/",
// watch: "test",
options: {
target: 'es5',
target: "es5",
sourceMap: false,
noImplicitAny: true,
declaration: false,
compiler: "./node_modules/typescript/bin/tsc",
removeComments: false
}
},
verify_d_ts: {
verifyDefinitionFiles: {
src: ["typings/d3/d3.d.ts",
"typings/touch-events/touch-events.d.ts",
"plottable.d.ts",
Expand All @@ -39,19 +39,18 @@ module.exports = function(grunt) {

var bumpJSON = {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: ['pkg'],
files: ["package.json", "bower.json"],
updateConfigs: ["pkg"],
commit: false,
createTag: false,
push: false,
prereleaseName: "rc"
}
};

var FILES_TO_COMMIT = ['plottable.js',
'plottable.min.js',
'plottable.d.ts',
'test/tests.js',
var FILES_TO_COMMIT = ["plottable.js",
"plottable.min.js",
"plottable.d.ts",
"plottable.css",
"plottable.zip",
"bower.json",
Expand All @@ -62,18 +61,18 @@ module.exports = function(grunt) {
var nestedBraceMatch = ": \\{[^{}]*\\}";
var typeNameMatch = ": [^;]*";
var finalMatch = "((" + nestedBraceMatch + ")|(" + typeNameMatch + "))?\\n?;";
var jsdoc_init = "\\n *\\/\\*\\* *\\n";
var jsdoc_mid = "( *\\*[^\\n]*\\n)+";
var jsdoc_end = " *\\*\\/ *";
var jsdoc = "(" + jsdoc_init + jsdoc_mid + jsdoc_end + ")?";
var jsdocInit = "\\n *\\/\\*\\* *\\n";
var jsdocMid = "( *\\*[^\\n]*\\n)+";
var jsdocEnd = " *\\*\\/ *";
var jsdoc = "(" + jsdocInit + jsdocMid + jsdocEnd + ")?";

var sedJSON = {
private_definitions: {
privateDefinitions: {
pattern: jsdoc + prefixMatch + "private " + varNameMatch + finalMatch,
replacement: "",
path: "build/plottable.d.ts"
},
plottable_multifile: {
plottableMultifile: {
pattern: '/// *<reference path="([^."]*).ts" */>',
replacement: 'synchronousRequire("/build/src/$1.js");',
path: "plottable_multifile.js"
Expand All @@ -83,7 +82,7 @@ module.exports = function(grunt) {
replacement: "",
path: "build/plottable.d.ts"
},
tests_multifile: {
testsMultifile: {
pattern: '/// *<reference path="([^."]*).ts" */>',
replacement: 'synchronousRequire("/build/test/$1.js");',
path: "test/tests_multifile.js"
Expand All @@ -93,7 +92,7 @@ module.exports = function(grunt) {
replacement: '/// <reference path="../$1" />',
path: "build/sublime.d.ts"
},
version_number: {
versionNumber: {
pattern: "@VERSION",
replacement: "<%= pkg.version %>",
path: "plottable.js"
Expand Down Expand Up @@ -158,11 +157,11 @@ module.exports = function(grunt) {
src: ["license_header.txt", "plottable.js"],
dest: "plottable.js"
},
plottable_multifile: {
plottableMultifile: {
src: ["synchronousRequire.js", "src/reference.ts"],
dest: "plottable_multifile.js"
},
tests_multifile: {
testsMultifile: {
src: ["synchronousRequire.js", "test/testReference.ts"],
dest: "test/tests_multifile.js"
},
Expand Down Expand Up @@ -199,21 +198,21 @@ module.exports = function(grunt) {
}
},
jshint: {
files: ['Gruntfile.js', 'quicktests/**/*.js'],
files: ["Gruntfile.js", "quicktests/**/*.js"],
options: {
jshintrc: '.jshintrc'
jshintrc: ".jshintrc"
}
},
jscs: {
files: ['Gruntfile.js', 'quicktests/**/*.js'],
files: ["Gruntfile.js", "quicktests/**/*.js"],
options: {
config: '.jscsrc'
config: ".jscsrc"
}
},
eslint: {
target: ['Gruntfile.js', 'quicktests/**/*.js'],
target: ["Gruntfile.js", "quicktests/**/*.js"],
options: {
configFile: '.eslintrc'
configFile: ".eslintrc"
}
},
parallelize: {
Expand All @@ -238,8 +237,8 @@ module.exports = function(grunt) {
"files": ["quicktests/overlaying/tests/**/*.js"]
}
},
blanket_mocha: {
all: ['test/coverage.html'],
"blanket_mocha": {
all: ["test/coverage.html"],
options: {
threshold: 70
}
Expand Down Expand Up @@ -279,32 +278,32 @@ module.exports = function(grunt) {
compress: {
main: {
options: {
archive: 'plottable.zip'
archive: "plottable.zip"
},
files: [
{src: 'plottable.js' , dest: '.'},
{src: 'plottable.min.js', dest: '.'},
{src: 'plottable.d.ts', dest: '.'},
{src: 'plottable.css' , dest: '.'},
{src: 'README.md' , dest: '.'},
{src: 'LICENSE' , dest: '.'}]
{src: "plottable.js", dest: "."},
{src: "plottable.min.js", dest: "."},
{src: "plottable.d.ts", dest: "."},
{src: "plottable.css", dest: "."},
{src: "README.md", dest: "."},
{src: "LICENSE", dest: "."}]
}
},
uglify: {
main: {
files: {'plottable.min.js': ['plottable.js']}
files: {"plottable.min.js": ["plottable.js"]}
}
},
shell: {
sublime: {
command: "(echo 'src/reference.ts'; find typings -name '*.d.ts') > build/sublime.d.ts"
}
},
'saucelabs-mocha': {
"saucelabs-mocha": {
all: {
options: {
urls: ['http://127.0.0.1:9999/test/tests.html'],
testname: 'Plottable Sauce Unit Tests',
urls: ["http://127.0.0.1:9999/test/tests.html"],
testname: "Plottable Sauce Unit Tests",
browsers: browsers,
build: process.env.TRAVIS_JOB_ID,
"tunnel-identifier": process.env.TRAVIS_JOB_NUMBER
Expand All @@ -316,7 +315,7 @@ module.exports = function(grunt) {
// project configuration
grunt.initConfig(configJSON);

require('load-grunt-tasks')(grunt);
require("load-grunt-tasks")(grunt);

// default task (this is what runs when a task isn't specified)
grunt.registerTask("update_ts_files", updateTsFiles);
Expand All @@ -326,32 +325,32 @@ module.exports = function(grunt) {
});
grunt.registerTask("test-compile", [
"ts:test",
"concat:tests_multifile",
"sed:tests_multifile",
"concat:testsMultifile",
"sed:testsMultifile",
"concat:tests"
]);
grunt.registerTask("default", "launch");
var compile_task = [
var compileTask = [
"update_ts_files",
"update_test_ts_files",
"ts:dev",
"concat:plottable",
"concat:svgtypewriter",
"concat:definitions",
"sed:definitions",
"sed:private_definitions",
"sed:privateDefinitions",
"umd:all",
"concat:header",
"sed:version_number",
"sed:versionNumber",
"definitions_prod",
"test-compile",
"concat:plottable_multifile",
"sed:plottable_multifile",
"concat:plottableMultifile",
"sed:plottableMultifile",
"clean:tscommand",
"update-qt"
];

grunt.registerTask("dev-compile", compile_task);
grunt.registerTask("dev-compile", compileTask);

grunt.registerTask("release:patch", ["bump:patch", "dist-compile", "gitcommit:version"]);
grunt.registerTask("release:minor", ["bump:minor", "dist-compile", "gitcommit:version"]);
Expand All @@ -361,7 +360,7 @@ module.exports = function(grunt) {
"dev-compile",
"blanket_mocha",
"parallelize:tslint",
"ts:verify_d_ts",
"ts:verifyDefinitionFiles",
"uglify",
"compress"
]);
Expand All @@ -370,7 +369,7 @@ module.exports = function(grunt) {

grunt.registerTask("launch", ["connect", "dev-compile", "watch"]);
grunt.registerTask("test-sauce", ["connect", "saucelabs-mocha"]);
grunt.registerTask("test", ["dev-compile", "blanket_mocha", "parallelize:tslint", "jshint", "ts:verify_d_ts", "jscs", "eslint"]);
grunt.registerTask("test", ["dev-compile", "blanket_mocha", "parallelize:tslint", "jshint", "ts:verifyDefinitionFiles", "jscs", "eslint"]);
// Disable saucelabs for external pull requests. Check if we can see the SAUCE_USERNAME
var travisTests = ["test"];
if (process.env.SAUCE_USERNAME) {
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable",
"description": "A modular charting library",
"version": "1.1.0",
"version": "1.2.0",
"main": ["plottable.js", "plottable.css"],
"license": "MIT",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable.js",
"description": "A library for creating charts out of D3",
"version": "1.1.0",
"version": "1.2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/plottable.git"
Expand Down
62 changes: 62 additions & 0 deletions plottable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ declare module Plottable {
* Computes the position relative to the <svg> in svg-coordinate-space.
*/
computePosition(clientX: number, clientY: number): Point;
/**
* Checks whether event happened inside <svg> element.
*/
insideSVG(e: Event): boolean;
}
}
}
Expand Down Expand Up @@ -2328,6 +2332,7 @@ declare module Plottable {
class Plot extends Component {
protected static _ANIMATION_MAX_DURATION: number;
protected _renderArea: d3.Selection<void>;
protected _renderCallback: ScaleCallback<Scale<any, any>>;
protected _propertyExtents: d3.Map<any[]>;
protected _propertyBindings: d3.Map<Plots.AccessorScaleBinding<any, any>>;
/**
Expand Down Expand Up @@ -2570,6 +2575,21 @@ declare module Plottable {
* @param {Scale} yScale The y scale to use.
*/
constructor();
/**
* Returns the whether or not the rendering is deferred for performance boost.
* @return {boolean} The deferred rendering option
*/
deferredRendering(): boolean;
/**
* Sets / unsets the deferred rendering option
* Activating this option improves the performance of plot interaction (pan / zoom) by
* performing lazy renders, only after the interaction has stopped. Because re-rendering
* is no longer performed during the interaction, the zooming might experience a small
* resolution degradation, before the lazy re-render is performed.
*
* This option is intended for cases where performance is an issue.
*/
deferredRendering(deferredRendering: boolean): XYPlot<X, Y>;
/**
* Gets the AccessorScaleBinding for X.
*/
Expand Down Expand Up @@ -3757,6 +3777,48 @@ declare module Plottable {
* @returns {Interactions.PanZoom} The calling PanZoom Interaction.
*/
removeYScale(yScale: QuantitativeScale<any>): PanZoom;
/**
* Gets the minimum domain extent for the scale, specifying the minimum allowable amount
* between the ends of the domain.
*
* Note that extents will mainly work on scales that work linearly like Linear Scale and Time Scale
*
* @param {QuantitativeScale<any>} quantitativeScale The scale to query
* @returns {D} The minimum domain extent for the scale.
*/
minDomainExtent<D>(quantitativeScale: QuantitativeScale<D>): D;
/**
* Sets the minimum domain extent for the scale, specifying the minimum allowable amount
* between the ends of the domain.
*
* Note that extents will mainly work on scales that work linearly like Linear Scale and Time Scale
*
* @param {QuantitativeScale<any>} quantitativeScale The scale to query
* @param {D} minDomainExtent The minimum domain extent for the scale.
* @returns {Interactions.PanZoom} The calling PanZoom Interaction.
*/
minDomainExtent<D>(quantitativeScale: QuantitativeScale<D>, minDomainExtent: D): Interactions.PanZoom;
/**
* Gets the maximum domain extent for the scale, specifying the maximum allowable amount
* between the ends of the domain.
*
* Note that extents will mainly work on scales that work linearly like Linear Scale and Time Scale
*
* @param {QuantitativeScale<any>} quantitativeScale The scale to query
* @returns {D} The maximum domain extent for the scale.
*/
maxDomainExtent<D>(quantitativeScale: QuantitativeScale<D>): D;
/**
* Sets the maximum domain extent for the scale, specifying the maximum allowable amount
* between the ends of the domain.
*
* Note that extents will mainly work on scales that work linearly like Linear Scale and Time Scale
*
* @param {QuantitativeScale<any>} quantitativeScale The scale to query
* @param {D} minDomainExtent The maximum domain extent for the scale.
* @returns {Interactions.PanZoom} The calling PanZoom Interaction.
*/
maxDomainExtent<D>(quantitativeScale: QuantitativeScale<D>, maxDomainExtent: D): Interactions.PanZoom;
}
}
}
Expand Down
Loading

0 comments on commit 2a7066e

Please sign in to comment.