Socket
Socket
Sign inDemoInstall

vega-lite

Package Overview
Dependencies
Maintainers
2
Versions
470
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-lite - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

1

bower.json
{
"name": "vega-lite",
"main": "vega-lite.js",
"version": "0.8.1",
"homepage": "https://github.com/vega/vega-lite",

@@ -6,0 +5,0 @@ "authors": [

40

docs/Encoding-Mapping.md

@@ -20,4 +20,4 @@ Vega-lite's top-level `encoding` property is a key-value mapping between

| :------------ |:-------------:| :------------- |
| name | String | A field/variable from which to pull a data value. __<sup>1</sup>__ |
| value | String,Integer | |
| name __<sup>1</sup>__ | String | A field/variable from which to pull a data value. |
| value | String,Integer | A constant value |
| type | String | Data Type (`Q` for quantitative, `O` for ordinal, `T` for temporal, and `N` for nominal). __<sup>2</sup>__ |

@@ -27,6 +27,5 @@ | [axis](#axis) | Object | Configuration object for the encoding's axis |

| [scale](#scale) | Object | Configuration object for the encoding's scale |
| [sort](#sort) | String \| Object | For all types of fields, if specified to `ascending` or `descending`, the domain values are sorted in based on the field's value in ascending or descending order. For nominal and ordinal fields, if set to an object, the values in the scale domain will be sorted based on an aggregate calculation over a specified sort field. <!-- TODO say what happen when sort is unspecified. --> See [Sort](#sort) section for more information. |
| [aggregate](#aggregate) | String | Aggregation function for the field (`mean`, `sum`, `median`, `min`, `max`, `count`) |
| [bin](#bin) | Object | Binning properties. See [Binning](#Binning) |
| [sort](#sort) | String \| Object | Sort order for a particular field. This can be string (`'ascending'`, `'descending'`, or `'unsorted'`) or a sort field definition object for sorting by an aggregate calculation of a specified sort field. If unspecified, the default value is `ascending`. See [Sort](#sort) section for more information. |
| [aggregate](#aggregate) | String | Aggregation function for the field (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`) |
| [bin](#bin) | Boolean \| Object | Binning properties. See [Binning](#Binning) |
| [timeUnit](#timeunit)| String | Property for converting time unit |

@@ -41,3 +40,11 @@

## field
__TODO__
## type
__TODO__
## bin

@@ -66,3 +73,3 @@

Vega-lite supports all [Vega aggregation operations](https://github.com/vega/vega/wiki/Data-Transforms#-aggregate).
Vega-lite supports all [Vega aggregation operations](https://github.com/vega/vega/wiki/Data-Transforms#-aggregate) (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).

@@ -123,5 +130,5 @@ If at least one of the specified encoding channel contains aggregation, a summary data table (`aggregate`) will be computed from the source data table (after binning and time unit have been derived) and the resulting visualization shows data from this summary table. In this case, all fields without aggregation function specified are treated as dimensions. The summary statistics are grouped by these dimensions.

<sup>1</sup>
If `grid` is unspecified, the default value is `true` for ROW and COL. For X
and Y, the default value is `true` for quantitative and time fields and `false`
otherwise.
If `grid` is unspecified, the default value is `true` for ROW and COL.
For X and Y, the default value is `true` for (1) quantitative fields that are not binned and (2) time fields.
Otherwise, the default value is `false`.

@@ -150,8 +157,11 @@ <sup>2</sup>

`sort` property can be specify for sorting the field's values in multiple ways:
`sort` property can be specify for sorting the field's values in two ways:
- `undefined` - the field is unsorted.
- (as __String__) `'ascending'` or `'descending'` – the field is sort by the field's value in ascending or descending order.
- (as __Object__) A sort field object - for sorting the field by an aggregate calculation over a specified sort field. A sort field object has the following properties:
1. (Supported by all types of fields) as __String__ with the following values:
- `'ascending'` – the field is sort by the field's value in ascending order. This is the default value when `sort` is not specified.
- `'descending'` – the field is sort by the field's value in descending order.
- `'unsorted`' – The field is not sorted. (This is equivalent to specifying `sort:false` in [Vega's scales](https://github.com/vega/vega/wiki/Scales).)
2. (Supported by nominal and ordinal fields only) as a __sort field definition object__ - for sorting the field by an aggregate calculation over another sort field. A sort field object has the following properties:
| Property | Type | Description |

@@ -161,3 +171,3 @@ | :------------ |:-------------:| :------------- |

| _sort.op_ | String | A valid [aggregation operation](Data-Transforms#-aggregate) (e.g., `mean`, `median`, etc.).|
| _sort.order_ | String | (Optional) `'ascending'` or `'descending'` order. |
| _sort.order_ | String | `'ascending'` or `'descending'` order. |

@@ -164,0 +174,0 @@

@@ -6,10 +6,9 @@ 'use strict';

function inc(importance) {
// get all the files to bump version in
return gulp.src(['./package.json', './bower.json'])
// bump the version number in those files
.pipe($.bump({type: importance}))
// save it back to filesystem
.pipe(gulp.dest('./'));
// get all the files to bump version in
return gulp.src(['./package.json'])
// bump the version number in those files
.pipe($.bump({type: importance}))
// save it back to filesystem
.pipe(gulp.dest('./'));
}

@@ -16,0 +15,0 @@

{
"name": "vega-lite",
"author": "Jeffrey Heer, Dominik Moritz, Kanit \"Ham\" Wongsuphasawat",
"version": "0.8.2",
"version": "0.8.3",
"collaborators": [

@@ -37,25 +37,25 @@ "Kanit Wongsuphasawat <kanitw@gmail.com> (http://kanitw.yellowpigz.com)",

"devDependencies": {
"browser-sync": "^2.8.2",
"browserify": "^11.0.1",
"browser-sync": "^2.9.11",
"browserify": "^11.2.0",
"browserify-shim": "^3.8.10",
"browserify-versionify": "^1.0.6",
"chai": "^3.2.0",
"commander": "^2.8.1",
"chai": "^3.4.0",
"commander": "^2.9.0",
"d3": "^3.5.6",
"deep-diff": "^0.3.2",
"deep-diff": "^0.3.3",
"gulp": "^3.9.0",
"gulp-bump": "^0.3.1",
"gulp-git": "^1.3.1",
"gulp-bump": "^1.0.0",
"gulp-git": "^1.6.0",
"gulp-jshint": "^1.11.2",
"gulp-load-plugins": "^1.0.0-rc",
"gulp-load-plugins": "^1.0.0",
"gulp-rename": "^1.2.2",
"gulp-run": "^1.6.10",
"gulp-sourcemaps": "^1.5.2",
"gulp-run": "^1.6.11",
"gulp-sourcemaps": "^1.6.0",
"gulp-spawn-mocha": "^2.2.1",
"gulp-tag-version": "^1.3.0",
"gulp-uglify": "^1.4.0",
"gulp-util": "^3.0.6",
"gulp-uglify": "^1.4.2",
"gulp-util": "^3.0.7",
"jshint-stylish": "^2.0.1",
"lodash": "^3.10.1",
"mocha": "^2.3.0",
"mocha": "^2.3.3",
"require-dir": "^0.3.0",

@@ -65,4 +65,4 @@ "vinyl-buffer": "^1.0.0",

"watchify": "~3.4.0",
"z-schema": "^3.12.4",
"jstransform": "^11.0.2",
"z-schema": "^3.15.4",
"jstransform": "^11.0.3",
"through": "^2.3.8"

@@ -72,8 +72,8 @@ },

"colorbrewer": "0.0.2",
"d3-color": "^0.2.4",
"d3-format": "^0.3.0",
"d3-time-format": "0.1.0",
"datalib": "^1.4.5",
"yargs": "^3.23.0",
"vega": "^2.3.0"
"d3-color": "^0.2.6",
"d3-format": "^0.3.3",
"d3-time-format": "0.1.3",
"datalib": "^1.4.6",
"yargs": "^3.29.0",
"vega": "^2.3.1"
},

@@ -80,0 +80,0 @@ "browserify": {

@@ -7,3 +7,3 @@ # Vega-Lite

**Vega-Lite is still in alpha phase and we are working on improving the code and [documentation](Documentation).
**Vega-Lite is still in alpha phase and we are working on improving the code and [documentation](docs/Documentation.md).
Note that our syntax might change slightly before we release 1.0.**

@@ -18,3 +18,3 @@

Use Vega-Lite in the [online editor](https://vega.github.io/vega-lite/).
__Try using Vega-lite in the online [Vega Editor](http://vega.github.io/vega-editor/?mode=vega-lite)__.

@@ -34,5 +34,5 @@ The complete schema for specifications as [JSON schema](http://json-schema.org/) is at [vega-lite-schema.json](https://vega.github.io/vega-lite/vega-lite-schema.json).

"encoding": {
"x": {"type": "Q","name": "yield","aggregate": "avg"},
"x": {"type": "Q","name": "yield","aggregate": "mean"},
"y": {
"sort": [{"name": "yield","aggregate": "avg","reverse": false}],
"sort": {"name": "yield","aggregate": "mean","reverse": false},
"type": "O",

@@ -39,0 +39,0 @@ "name": "variety"

@@ -84,7 +84,9 @@ 'use strict';

// If `grid` is unspecified, the default value is `true` for ROW and COL. For X
// and Y, the default value is `true` for quantitative and time fields and `false` otherwise.
// If `grid` is unspecified, the default value is `true` for ROW and COL.
// For X and Y, the default value is `true` for (1) quantitative fields that are not binned and (2) time fields.
// Otherwise, the default value is `false`.
var grid = _grid === undefined ?
(name === ROW || name === COL || encoding.isTypes(name, [Q, T])) :
_grid;
( name === ROW || name === COL ||
(encoding.isTypes(name, [Q, T]) && !encoding.encDef(name).bin)
) : _grid;

@@ -91,0 +93,0 @@ if (grid) {

@@ -94,4 +94,4 @@ 'use strict';

if (details.length > 0 && lineType) {
//subfacet to group stack / line together in one group
compiler.subfacet(group, mdef, details, encoding);
//subfacet to group area / line together in one group
compiler.subfacet(group, mdef, details);
}

@@ -98,0 +98,0 @@

@@ -117,5 +117,14 @@ 'use strict';

field: encDef.name,
output: {start: encoding.fieldRef(encType)},
output: {
start: encoding.fieldRef(encType, {bin_suffix: '_start'}),
end: encoding.fieldRef(encType, {bin_suffix: '_end'})
},
maxbins: encoding.bin(encType).maxbins
});
// temporary fix for adding missing `bin_mid` from the bin transform
transform.push({
type: 'formula',
field: encoding.fieldRef(encType, {bin_suffix: '_mid'}),
expr: '(' + encoding.fieldRef(encType, {datum:1, bin_suffix: '_start'}) + '+' + encoding.fieldRef(encType, {datum:1, bin_suffix: '_end'}) + ')/2'
});
}

@@ -194,3 +203,11 @@ return transform;

} else {
dims[encDef.name] = encoding.fieldRef(encType);
if (encDef.bin) {
// TODO(#694) only add dimension for the required ones.
dims[encoding.fieldRef(encType, {bin_suffix: '_start'})] = encoding.fieldRef(encType, {bin_suffix: '_start'});
dims[encoding.fieldRef(encType, {bin_suffix: '_mid'})] = encoding.fieldRef(encType, {bin_suffix: '_mid'});
dims[encoding.fieldRef(encType, {bin_suffix: '_end'})] = encoding.fieldRef(encType, {bin_suffix: '_end'});
} else {
dims[encDef.name] = encoding.fieldRef(encType);
}
}

@@ -197,0 +214,0 @@ });

@@ -99,3 +99,6 @@ 'use strict';

// x's and width
if (e.isMeasure(X)) {
if (e.encDef(X).bin) {
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_start'}), offset: 1};
p.x2 = {scale: X, field: e.fieldRef(X, {bin_suffix: '_end'})};
} else if (e.isMeasure(X)) {
p.x = {scale: X, field: e.fieldRef(X)};

@@ -130,3 +133,6 @@ if (!e.has(Y) || e.isDimension(Y)) {

// y's & height
if (e.isMeasure(Y)) {
if (e.encDef(Y).bin) {
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_start'})};
p.y2 = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_end'}), offset: 1};
} else if (e.isMeasure(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};

@@ -173,3 +179,3 @@ p.y2 = {field: {group: 'height'}};

if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
} else if (!e.has(X)) {

@@ -181,3 +187,3 @@ p.x = {value: e.bandSize(X, layout.x.useSmallBand) / 2};

if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
} else if (!e.has(Y)) {

@@ -230,3 +236,3 @@ p.y = {value: e.bandSize(Y, layout.y.useSmallBand) / 2};

if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
} else if (!e.has(X)) {

@@ -238,3 +244,3 @@ p.x = {value: 0};

if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
} else if (!e.has(Y)) {

@@ -259,2 +265,3 @@ p.y = {field: {group: 'height'}};

// TODO(#694): optimize area's usage with bin
function area_props(e, layout, style) {

@@ -272,3 +279,3 @@ // jshint unused:false

} else if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
} else {

@@ -283,3 +290,3 @@ p.x = {value: 0};

} else if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
} else {

@@ -307,3 +314,3 @@ p.y = {field: {group: 'height'}};

if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
if (e.isDimension(X)) {

@@ -318,3 +325,3 @@ p.x.offset = -e.bandSize(X, layout.x.useSmallBand) / 3;

if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
if (e.isDimension(Y)) {

@@ -329,2 +336,3 @@ p.y.offset = -e.bandSize(Y, layout.y.useSmallBand) / 3;

if (!e.has(X) || e.isDimension(X)) {
// TODO(#694): optimize tick's width for bin
p.width = {value: e.bandSize(X, layout.y.useSmallBand) / 1.5};

@@ -337,2 +345,3 @@ } else {

if (!e.has(Y) || e.isDimension(Y)) {
// TODO(#694): optimize tick's height for bin
p.height = {value: e.bandSize(Y, layout.y.useSmallBand) / 1.5};

@@ -362,3 +371,3 @@ } else {

if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
} else if (!e.has(X)) {

@@ -370,3 +379,3 @@ p.x = {value: e.bandSize(X, layout.x.useSmallBand) / 2};

if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
} else if (!e.has(Y)) {

@@ -406,3 +415,3 @@ p.y = {value: e.bandSize(Y, layout.y.useSmallBand) / 2};

if (e.has(X)) {
p.x = {scale: X, field: e.fieldRef(X)};
p.x = {scale: X, field: e.fieldRef(X, {bin_suffix: '_mid'})};
} else if (!e.has(X)) {

@@ -418,3 +427,3 @@ if (e.has(TEXT) && e.isType(TEXT, Q)) {

if (e.has(Y)) {
p.y = {scale: Y, field: e.fieldRef(Y)};
p.y = {scale: Y, field: e.fieldRef(Y, {bin_suffix: '_mid'})};
} else if (!e.has(Y)) {

@@ -421,0 +430,0 @@ p.y = {value: e.bandSize(Y, layout.y.useSmallBand) / 2};

@@ -6,4 +6,3 @@ 'use strict';

colorbrewer = require('colorbrewer'),
interpolate = require('d3-color').interpolateHsl,
schema = require('../schema/schema');
interpolate = require('d3-color').interpolateHsl;

@@ -25,5 +24,5 @@ var scale = module.exports = {};

scaleDef.type = scale.type(name, encoding);
scaleDef.domain = scale.domain(encoding, name, scaleDef.type, stats, facet);
scaleDef.domain = scale.domain(encoding, name, scaleDef.type, facet);
// add `reverse` if applicable
// Add optional properties
var reverse = scale.reverse(encoding, name);

@@ -34,2 +33,8 @@ if (reverse) {

var zero = scale.zero(encoding, name);
if (zero !== undefined) {
scaleDef.zero = zero;
}
// TODO split scale.range into methods for each properties
scaleDef = scale.range(scaleDef, encoding, layout, stats);

@@ -50,4 +55,3 @@

if (encoding.bin(name)) {
// TODO: revise this
return name === COLOR ? 'linear' : 'ordinal';
return 'linear';
}

@@ -58,3 +62,3 @@ return encoding.scale(name).type;

scale.domain = function (encoding, name, type, stats, facet) {
scale.domain = function (encoding, name, type, facet) {
var encDef = encoding.encDef(name);

@@ -68,14 +72,2 @@

// For binned, produce fixed stepped domain.
// TODO(#614): this must be changed in vg2
if (encDef.bin) {
var fieldStat = stats[encDef.name],
bins = util.getbins(fieldStat, encDef.bin.maxbins || schema.MAXBINS_DEFAULT),
numbins = (bins.stop - bins.start) / bins.step;
return util.range(numbins).map(function(i) {
return bins.start + bins.step * i;
});
}
// For stack, use STACKED data.

@@ -96,3 +88,3 @@ var stack = encoding.stack();

if (useRawDomain) {
if (useRawDomain) { // useRawDomain - only Q/T
return {

@@ -102,4 +94,12 @@ data: RAW,

};
} else if (sort) { // have sort
} else if (encDef.bin) { // bin -- need to merge both bin_start and bin_end
return {
data: encoding.dataTable(),
field: [
encoding.fieldRef(name, {bin_suffix:'_start'}),
encoding.fieldRef(name, {bin_suffix:'_end'})
]
};
} else if (sort) { // have sort -- only for ordinal
return {
// If sort by aggregation of a specified sort field, we need to use RAW table,

@@ -177,7 +177,28 @@ // so we can aggregate values for the scale independently from the main aggregation.

// FIXME revise if we should produce undefined for shorter spec (and just use vega's default value.)
// However, let's ignore it for now as it is unclear what is Vega's default value.
scale.zero = function(encoding, name) {
var spec = encoding.scale(name);
var encDef = encoding.encDef(name);
var timeUnit = encDef.timeUnit;
if (spec.zero) {
return spec.zero; // return explicit value if defined
}
if (encoding.isType(name, T) && (!timeUnit || timeUnit === 'year')) { // FIXME revise this
// Returns false (undefined) by default for time scale
return false;
}
if (encDef.bin) {
// Returns false (undefined) by default of bin
return false;
}
// if not bin / temporal, returns true by default
return name === X || name === Y || name === SIZE;
};
scale.range = function (scaleDef, encoding, layout, stats) {
var spec = encoding.scale(scaleDef.name),
encDef = encoding.encDef(scaleDef.name),
timeUnit = encDef.timeUnit;
var encDef = encoding.encDef(scaleDef.name);
var timeUnit = encDef.timeUnit;

@@ -189,8 +210,2 @@ switch (scaleDef.name) {

scaleDef.bandWidth = encoding.bandSize(X, layout.x.useSmallBand);
} else {
if (encoding.isType(scaleDef.name,T) && timeUnit === 'year') {
scaleDef.zero = false;
} else {
scaleDef.zero = spec.zero === undefined ? true : spec.zero;
}
}

@@ -212,7 +227,2 @@ scaleDef.round = true;

scaleDef.range = layout.cellHeight ? [layout.cellHeight, 0] : 'height';
if (encoding.isType(scaleDef.name,T) && timeUnit === 'year') {
scaleDef.zero = false;
} else {
scaleDef.zero = spec.zero === undefined ? true : spec.zero;
}
}

@@ -250,3 +260,2 @@

scaleDef.round = true;
scaleDef.zero = false;
break;

@@ -258,3 +267,2 @@ case SHAPE:

scaleDef.range = scale.color(scaleDef, encoding, stats);
if (scaleDef.type !== 'ordinal') scaleDef.zero = false;
break;

@@ -261,0 +269,0 @@ default:

@@ -15,4 +15,19 @@ 'use strict';

var transforms = [];
if (encoding.marktype() === 'area') {
// Add impute transform to ensure we have all values for each series
transforms.push({
type: 'impute',
field: encoding.fieldRef(field),
groupby: [encoding.fieldRef(stack.stack)],
orderby: [encoding.fieldRef(groupby)],
method: 'value',
value: 0
});
}
// add stack transform to mark
var transform = {
var stackTransform = {
type: 'stack',

@@ -26,7 +41,9 @@ groupby: [encoding.fieldRef(groupby)],

if (stack.properties.offset) {
transform.offset = stack.properties.offset;
stackTransform.offset = stack.properties.offset;
}
mdef.from.transform = [transform];
transforms.push(stackTransform)
mdef.from.transform = transforms;
// TODO(#276): This is super hack-ish -- consolidate into modular mark properties?

@@ -33,0 +50,0 @@ mdef.properties.update[field] = mdef.properties.enter[field] = {

@@ -28,8 +28,2 @@ 'use strict';

trans.push({type: 'facet', groupby: details});
// TODO: understand why we need this sort transform and write comment
var stack = encoding.stack();
if (stack && encoding.has(COLOR)) {
trans.unshift({type: 'sort', by: encoding.fieldRef(COLOR)});
}
}

@@ -138,2 +138,3 @@ 'use strict';

// FIXME revise this -- should 'year' be linear too?
return time.isOrdinalFn(timeUnit) || name === COL || name === ROW ? 'ordinal' : 'linear';

@@ -140,0 +141,0 @@ };

@@ -23,2 +23,3 @@ 'use strict';

* opt.prefn - prepend fn with custom function prefix
* opt.bin_suffix - append suffix to the field ref for bin (default='_start')

@@ -38,3 +39,4 @@ * @return {[type]} [description]

} else if (!opt.nofn && field.bin) {
return f + 'bin_' + name;
var bin_suffix = opt.bin_suffix || '_start';
return f + 'bin_' + name + bin_suffix;
} else if (!opt.nofn && !opt.noAggregate && field.aggregate) {

@@ -115,3 +117,3 @@ return f + field.aggregate + '_' + name;

vlfield.isOrdinalScale = function(field) {
return isTypes(field, [N, O]) || field.bin ||
return isTypes(field, [N, O]) ||
( isType(field, T) && field.timeUnit && time.isOrdinalFn(field.timeUnit) );

@@ -118,0 +120,0 @@ };

@@ -112,3 +112,3 @@ // Package of defining Vega-lite Specification's json schema

description: 'Include zero',
default: true,
default: undefined,
supportedTypes: toMap([Q, T])

@@ -115,0 +115,0 @@ },

@@ -123,3 +123,3 @@ 'use strict';

field: 'Acceleration',
output: {start: 'bin_Acceleration'},
output: {start: 'bin_Acceleration_start', end: 'bin_Acceleration_end'},
maxbins: 15

@@ -190,3 +190,4 @@ });

expect(transform[2].type).to.eql('bin');
expect(transform[3].type).to.eql('filter');
expect(transform[3].type).to.eql('formula'); // formula for bin_mid
expect(transform[4].type).to.eql('filter');
});

@@ -193,0 +194,0 @@

@@ -135,3 +135,3 @@ 'use strict';

it('should have scale for shape', function () {
expect(def.shape).to.eql({scale: SHAPE, field: "bin_yield"});
expect(def.shape).to.eql({scale: SHAPE, field: "bin_yield_start"});
});

@@ -138,0 +138,0 @@ });

@@ -67,3 +67,6 @@ 'use strict';

expect(domain).to.eql([-5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45]);
expect(domain).to.eql({
data: RAW,
field: ['bin_origin_start', 'bin_origin_end']
});
});

@@ -70,0 +73,0 @@

@@ -41,4 +41,4 @@ 'use strict';

})[0];
expect(tableAggrTransform.groupby.length).to.equal(2);
expect(tableAggrTransform.groupby.indexOf('bin_Cost__Total_$')).to.gt(-1);
expect(tableAggrTransform.groupby.length).to.equal(4);
expect(tableAggrTransform.groupby.indexOf('bin_Cost__Total_$_start')).to.gt(-1);

@@ -50,3 +50,3 @@ var stackedData = vgSpec.data.filter(function(data) {

var stackedAggrTransform = stackedData[0].transform[0];
expect(stackedAggrTransform.groupby[0]).to.equal('bin_Cost__Total_$');
expect(stackedAggrTransform.groupby[0]).to.equal('bin_Cost__Total_$_start');
});

@@ -68,4 +68,4 @@ });

})[0];
expect(tableAggrTransform.groupby.length).to.equal(2);
expect(tableAggrTransform.groupby.indexOf('bin_Cost__Total_$')).to.gt(-1);
expect(tableAggrTransform.groupby.length).to.equal(4);
expect(tableAggrTransform.groupby.indexOf('bin_Cost__Total_$_start')).to.gt(-1);

@@ -78,3 +78,3 @@ var stackedData = vgSpec.data.filter(function(data) {

var stackedAggrTransform = stackedData[0].transform[0];
expect(stackedAggrTransform.groupby[0]).to.equal('bin_Cost__Total_$');
expect(stackedAggrTransform.groupby[0]).to.equal('bin_Cost__Total_$_start');
});

@@ -81,0 +81,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc