Code coverage report for src/schema/schema.js

Statements: 98.44% (63 / 64)      Branches: 100% (0 / 0)      Functions: 50% (1 / 2)      Lines: 98.44% (63 / 64)      Ignored: none     

All files » src/schema/ » schema.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791      1 1 1 1 1 1 1 1 1 1 1       1                       1     1   1 1 1         1           1               1 1 1 1                         1                                         1                                             1                                                                                       1 1 1                         1                                       1                                                                                                                             1                                                                   1                                         1                                                                                                                   1                       1                                                                                                                     1                                           1                                 1       1                 1                                     1                       1     1           1           1         1 1 1 1 1 1 1 1 1 1 1                                                                                           1                                                                                                                                                                                                                                                                                                                             1                                                 1 1 93   1    
// Package of defining Vega-lite Specification's json schema
/// <reference path="../../typings/vega.d.ts"/>
/// <reference path="../../typings/colorbrewer.d.ts"/>
var colorbrewer = require('colorbrewer');
var util = require('../util');
var util_1 = require('../util');
var schemaUtil = require('./schemautil');
var consts_1 = require('../consts');
var Q = consts_1.Type.Q;
var O = consts_1.Type.O;
var N = consts_1.Type.N;
var T = consts_1.Type.T;
var Aggregate_1 = require('vega/src/transforms/Aggregate');
exports.marktype = {
    type: 'string',
    enum: ['point', 'tick', 'bar', 'line', 'area', 'circle', 'square', 'text']
};
exports.aggregate = {
    type: 'string',
    enum: Aggregate_1.VALID_OPS,
    supportedEnums: {
        Q: Aggregate_1.VALID_OPS,
        O: ['median', 'min', 'max'],
        N: [],
        T: ['mean', 'median', 'min', 'max'],
        '': ['count']
    },
    supportedTypes: util_1.toMap([Q, N, O, T, ''])
};
function getSupportedRole(encType) {
    return exports.schema.properties.encoding.properties[encType].supportedRole;
}
exports.getSupportedRole = getSupportedRole;
;
exports.timeUnits = ['year', 'month', 'day', 'date', 'hours', 'minutes', 'seconds'];
exports.defaultTimeFn = 'month';
exports.timeUnit = {
    type: 'string',
    enum: exports.timeUnits,
    supportedTypes: util_1.toMap([T])
};
exports.scale_type = {
    type: 'string',
    enum: ['linear', 'log', 'pow', 'sqrt', 'quantile'],
    default: 'linear',
    supportedTypes: util_1.toMap([Q])
};
exports.field = {
    type: 'object',
    properties: {
        name: {
            type: 'string'
        }
    }
};
var clone = util.duplicate;
var merge = schemaUtil.merge;
exports.MAXBINS_DEFAULT = 15;
var bin = {
    type: ['boolean', 'object'],
    default: false,
    properties: {
        maxbins: {
            type: 'integer',
            default: exports.MAXBINS_DEFAULT,
            minimum: 2,
            description: 'Maximum number of bins.'
        }
    },
    supportedTypes: util_1.toMap([Q])
};
var scale = {
    type: 'object',
    properties: {
        type: exports.scale_type,
        domain: {
            default: undefined,
            type: ['array', 'object'],
            description: 'The domain of the scale, representing the set of data values. For quantitative data, this can take the form of a two-element array with minimum and maximum values. For ordinal/categorical data, this may be an array of valid input values. The domain may also be specified by a reference to a data source.'
        },
        range: {
            default: undefined,
            type: ['array', 'object'],
            description: 'The range of the scale, representing the set of visual values. For numeric values, the range can take the form of a two-element array with minimum and maximum values. For ordinal or quantized data, the range may by an array of desired output values, which are mapped to elements in the specified domain. For ordinal scales only, the range can be defined using a DataRef: the range values are then drawn dynamically from a backing data set.'
        },
        round: {
            default: undefined,
            type: 'boolean',
            description: 'If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.'
        }
    }
};
var ordinalScaleMixin = {
    properties: {
        bandWidth: {
            type: 'integer',
            minimum: 0,
            default: undefined
        },
        outerPadding: {
            type: 'number',
            default: undefined
        },
        padding: {
            type: 'number',
            default: undefined,
            description: 'Applies spacing among ordinal elements in the scale range. The actual effect depends on how the scale is configured. If the __points__ parameter is `true`, the padding value is interpreted as a multiple of the spacing between points. A reasonable value is 1.0, such that the first and last point will be offset from the minimum and maximum value by half the distance between points. Otherwise, padding is typically in the range [0, 1] and corresponds to the fraction of space in the range interval to allocate to padding. A value of 0.5 means that the range band width will be equal to the padding width. For more, see the [D3 ordinal scale documentation](https://github.com/mbostock/d3/wiki/Ordinal-Scales).'
        },
        points: {
            type: 'boolean',
            default: undefined,
            description: 'If true, distributes the ordinal values over a quantitative range at uniformly spaced points. The spacing of the points can be adjusted using the padding property. If false, the ordinal scale will construct evenly-spaced bands, rather than points.'
        }
    }
};
var typicalScaleMixin = {
    properties: {
        clamp: {
            type: 'boolean',
            default: true,
            description: 'If true, values that exceed the data domain are clamped to either the minimum or maximum range value'
        },
        nice: {
            default: undefined,
            oneOf: [
                {
                    type: 'boolean',
                    description: 'If true, modifies the scale domain to use a more human-friendly number range (e.g., 7 instead of 6.96).'
                }, {
                    type: 'string',
                    enum: ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'],
                    description: 'If specified, modifies the scale domain to use a more human-friendly value range. For time and utc scale types only, the nice value should be a string indicating the desired time interval; legal values are "second", "minute", "hour", "day", "week", "month", or "year".'
                }
            ],
            supportedTypes: util_1.toMap([Q, T]),
            description: ''
        },
        exponent: {
            type: 'number',
            default: undefined,
            description: 'Sets the exponent of the scale transformation. For pow scale types only, otherwise ignored.'
        },
        zero: {
            type: 'boolean',
            description: 'If true, ensures that a zero baseline value is included in the scale domain. This option is ignored for non-quantitative scales.',
            default: undefined,
            supportedTypes: util_1.toMap([Q, T])
        },
        useRawDomain: {
            type: 'boolean',
            default: undefined,
            description: 'Uses the source data range as scale domain instead of ' +
                'aggregated data for aggregate axis. ' +
                'This option does not work with sum or count aggregate' +
                'as they might have a substantially larger scale range.' +
                'By default, use value from config.useRawDomain.'
        }
    }
};
var ordinalOnlyScale = merge(clone(scale), ordinalScaleMixin);
var typicalScale = merge(clone(scale), ordinalScaleMixin, typicalScaleMixin);
var typicalField = merge(clone(exports.field), {
    type: 'object',
    properties: {
        type: {
            type: 'string',
            enum: [N, O, Q, T]
        },
        aggregate: exports.aggregate,
        timeUnit: exports.timeUnit,
        bin: bin,
        scale: typicalScale
    }
});
var onlyOrdinalField = merge(clone(exports.field), {
    type: 'object',
    supportedRole: {
        dimension: true
    },
    properties: {
        type: {
            type: 'string',
            enum: [N, O, Q, T]
        },
        timeUnit: exports.timeUnit,
        bin: bin,
        aggregate: {
            type: 'string',
            enum: ['count'],
            supportedTypes: util_1.toMap([N, O])
        },
        scale: ordinalOnlyScale
    }
});
var axisMixin = {
    type: 'object',
    supportedMarktypes: { point: true, tick: true, bar: true, line: true, area: true, circle: true, square: true },
    properties: {
        axis: {
            type: 'object',
            properties: {
                format: {
                    type: 'string',
                    default: undefined,
                    description: 'The formatting pattern for axis labels. ' +
                        'If not undefined, this will be determined by ' +
                        'the max value ' +
                        'of the field.'
                },
                grid: {
                    type: 'boolean',
                    default: undefined,
                    description: 'A flag indicate if gridlines should be created in addition to ticks. 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.'
                },
                layer: {
                    type: 'string',
                    default: 'back',
                    description: 'A string indicating if the axis (and any gridlines) should be placed above or below the data marks. One of "front" (default) or "back".'
                },
                orient: {
                    type: 'string',
                    default: undefined,
                    enum: ['top', 'right', 'left', 'bottom'],
                    description: 'The orientation of the axis. One of top, bottom, left or right. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).'
                },
                ticks: {
                    type: 'integer',
                    default: undefined,
                    minimum: 0,
                    description: 'A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of 2, 5, 10) and lie within the underlying scale\'s range.'
                },
                title: {
                    type: 'string',
                    default: undefined,
                    description: 'A title for the axis. (Shows field name and its function by default.)'
                },
                labelMaxLength: {
                    type: 'integer',
                    default: 25,
                    minimum: 0,
                    description: 'Truncate labels that are too long.'
                },
                titleMaxLength: {
                    type: 'integer',
                    default: undefined,
                    minimum: 0,
                    description: 'Max length for axis title if the title is automatically generated from the field\'s description'
                },
                titleOffset: {
                    type: 'integer',
                    default: undefined,
                    description: 'A title offset value for the axis.'
                },
            }
        }
    }
};
var sortMixin = {
    type: 'object',
    properties: {
        sort: {
            default: 'ascending',
            supportedTypes: util_1.toMap([N, O]),
            oneOf: [
                {
                    type: 'string',
                    enum: ['ascending', 'descending', 'unsorted']
                },
                {
                    type: 'object',
                    required: ['field', 'op'],
                    properties: {
                        field: {
                            type: 'string',
                            description: 'The field name to aggregate over.'
                        },
                        op: {
                            type: 'string',
                            enum: Aggregate_1.VALID_OPS,
                            description: 'The field name to aggregate over.'
                        },
                        order: {
                            type: 'string',
                            enum: ['ascending', 'descending']
                        }
                    }
                }
            ]
        }
    }
};
var legendMixin = {
    type: 'object',
    properties: {
        legend: {
            type: 'object',
            description: 'Properties of a legend.',
            properties: {
                title: {
                    type: 'string',
                    default: undefined,
                    description: 'A title for the legend. (Shows field name and its function by default.)'
                },
                orient: {
                    type: 'string',
                    default: 'right',
                    description: 'The orientation of the legend. One of "left" or "right". This determines how the legend is positioned within the scene. The default is "right".'
                }
            }
        }
    }
};
var textMixin = {
    type: 'object',
    supportedMarktypes: { 'text': true },
    properties: {
        align: {
            type: 'string',
            default: 'right'
        },
        baseline: {
            type: 'string',
            default: 'middle'
        },
        color: {
            type: 'string',
            role: 'color',
            default: '#000000'
        },
        margin: {
            type: 'integer',
            default: 4,
            minimum: 0
        },
        placeholder: {
            type: 'string',
            default: 'Abc'
        },
        font: {
            type: 'object',
            properties: {
                weight: {
                    type: 'string',
                    enum: ['normal', 'bold'],
                    default: 'normal'
                },
                size: {
                    type: 'integer',
                    default: 10,
                    minimum: 0
                },
                family: {
                    type: 'string',
                    default: 'Helvetica Neue'
                },
                style: {
                    type: 'string',
                    default: 'normal',
                    enum: ['normal', 'italic']
                }
            }
        },
        format: {
            type: 'string',
            default: undefined,
            description: 'The formatting pattern for text value.' +
                'If not defined, this will be determined automatically'
        },
    }
};
var sizeMixin = {
    type: 'object',
    supportedMarktypes: { point: true, bar: true, circle: true, square: true, text: true },
    properties: {
        value: {
            type: 'integer',
            default: 30,
            minimum: 0,
            description: 'Size of marks.'
        }
    }
};
var colorMixin = {
    type: 'object',
    supportedMarktypes: { point: true, tick: true, bar: true, line: true, area: true, circle: true, square: true, 'text': true },
    properties: {
        value: {
            type: 'string',
            role: 'color',
            default: '#4682b4',
            description: 'Color to be used for marks.'
        },
        opacity: {
            type: 'number',
            default: undefined,
            minimum: 0,
            maximum: 1
        },
        scale: {
            type: 'object',
            properties: {
                range: {
                    type: ['string', 'array'],
                    default: undefined,
                    description: 'Color palette, if undefined vega-lite will use data property' +
                        'to pick one from c10palette, c20palette, or ordinalPalette.'
                },
                c10palette: {
                    type: 'string',
                    default: 'category10',
                    enum: [
                        'category10', 'category10k',
                        'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3'
                    ]
                },
                c20palette: {
                    type: 'string',
                    default: 'category20',
                    enum: ['category20', 'category20b', 'category20c']
                },
                ordinalPalette: {
                    type: 'string',
                    default: undefined,
                    description: 'Color palette to encode ordinal variables.',
                    enum: util.keys(colorbrewer)
                },
                quantitativeRange: {
                    type: 'array',
                    default: ['#AFC6A3', '#09622A'],
                    description: 'Color range to encode quantitative variables.',
                    minItems: 2,
                    maxItems: 2,
                    items: {
                        type: 'string',
                        role: 'color'
                    }
                }
            }
        }
    }
};
var stackMixin = {
    type: 'object',
    properties: {
        stack: {
            type: ['boolean', 'object'],
            default: true,
            description: 'Enable stacking (for bar and area marks only).',
            properties: {
                reverse: {
                    type: 'boolean',
                    default: false,
                    description: 'Whether to reverse the stack\'s sortby.'
                },
                offset: {
                    type: 'string',
                    default: undefined,
                    enum: ['zero', 'center', 'normalize']
                }
            }
        }
    }
};
var shapeMixin = {
    type: 'object',
    supportedMarktypes: { point: true, circle: true, square: true },
    properties: {
        value: {
            type: 'string',
            enum: ['circle', 'square', 'cross', 'diamond', 'triangle-up', 'triangle-down'],
            default: 'circle',
            description: 'Mark to be used.'
        },
        filled: {
            type: 'boolean',
            default: false,
            description: 'Whether the shape\'s color should be used as fill color instead of stroke color.'
        }
    }
};
var detailMixin = {
    type: 'object',
    supportedMarktypes: { point: true, tick: true, line: true, circle: true, square: true }
};
var rowMixin = {
    properties: {
        height: {
            type: 'number',
            minimum: 0,
            default: 150
        }
    }
};
var colMixin = {
    properties: {
        width: {
            type: 'number',
            minimum: 0,
            default: 150
        },
        axis: {
            properties: {
                labelMaxLength: {
                    type: 'integer',
                    default: 12,
                    minimum: 0,
                    description: 'Truncate labels that are too long.'
                }
            }
        }
    }
};
var facetMixin = {
    type: 'object',
    supportedMarktypes: { point: true, tick: true, bar: true, line: true, area: true, circle: true, square: true, text: true },
    properties: {
        padding: {
            type: 'number',
            minimum: 0,
            maximum: 1,
            default: 0.1
        }
    }
};
var requiredNameType = {
    required: ['name', 'type']
};
var multiRoleField = merge(clone(typicalField), {
    supportedRole: {
        measure: true,
        dimension: true
    }
});
var quantitativeField = merge(clone(typicalField), {
    supportedRole: {
        measure: true,
        dimension: 'ordinal-only'
    }
});
var onlyQuantitativeField = merge(clone(typicalField), {
    supportedRole: {
        measure: true
    }
});
var x = merge(clone(multiRoleField), axisMixin, requiredNameType, sortMixin);
var y = clone(x);
var facet = merge(clone(onlyOrdinalField), requiredNameType, facetMixin, sortMixin);
var row = merge(clone(facet), axisMixin, rowMixin);
var col = merge(clone(facet), axisMixin, colMixin);
var size = merge(clone(quantitativeField), legendMixin, sizeMixin, sortMixin);
var color = merge(clone(multiRoleField), legendMixin, colorMixin, stackMixin, sortMixin);
var shape = merge(clone(onlyOrdinalField), legendMixin, shapeMixin, sortMixin);
var detail = merge(clone(onlyOrdinalField), detailMixin, stackMixin, sortMixin);
var text = merge(clone(onlyQuantitativeField), textMixin, sortMixin);
var data = {
    type: 'object',
    properties: {
        formatType: {
            type: 'string',
            enum: ['json', 'csv', 'tsv'],
            default: 'json'
        },
        url: {
            type: 'string',
            default: undefined
        },
        values: {
            type: 'array',
            default: undefined,
            description: 'Pass array of objects instead of a url to a file.',
            items: {
                type: 'object',
                additionalProperties: true
            }
        },
        filter: {
            type: 'string',
            default: undefined,
            description: 'A string containing the filter Vega expression. Use `datum` to refer to the current data object.'
        },
        formulas: {
            type: 'array',
            default: undefined,
            description: 'Array of formula transforms. Formulas are applied before filter.',
            items: {
                type: 'object',
                properties: {
                    field: {
                        type: 'string',
                        description: 'The property name in which to store the computed formula value.'
                    },
                    expr: {
                        type: 'string',
                        description: 'A string containing an expression for the formula. Use the variable `datum` to to refer to the current data object.'
                    }
                }
            }
        }
    }
};
var config = {
    type: 'object',
    properties: {
        width: {
            type: 'integer',
            default: undefined
        },
        height: {
            type: 'integer',
            default: undefined
        },
        viewport: {
            type: 'array',
            items: {
                type: 'integer'
            },
            default: undefined
        },
        gridColor: {
            type: 'string',
            role: 'color',
            default: '#000000'
        },
        gridOpacity: {
            type: 'number',
            minimum: 0,
            maximum: 1,
            default: 0.08
        },
        filterNull: {
            type: 'object',
            properties: {
                N: { type: 'boolean', default: false },
                O: { type: 'boolean', default: false },
                Q: { type: 'boolean', default: true },
                T: { type: 'boolean', default: true }
            }
        },
        autoSortLine: {
            type: 'boolean',
            default: true
        },
        singleHeight: {
            type: 'integer',
            default: 200,
            minimum: 0
        },
        singleWidth: {
            type: 'integer',
            default: 200,
            minimum: 0
        },
        largeBandWidth: {
            type: 'integer',
            default: 21,
            minimum: 0
        },
        smallBandWidth: {
            type: 'integer',
            default: 12,
            minimum: 0
        },
        largeBandMaxCardinality: {
            type: 'integer',
            default: 10
        },
        padding: {
            type: 'number',
            default: 1,
            description: 'default scale padding for ordinal x/y scales.'
        },
        cellPadding: {
            type: 'number',
            default: 0.1,
            description: 'default scale padding for row/column scales.'
        },
        cellGridColor: {
            type: 'string',
            role: 'color',
            default: '#000000'
        },
        cellGridOpacity: {
            type: 'number',
            minimum: 0,
            maximum: 1,
            default: 0.25
        },
        cellGridOffset: {
            type: 'number',
            default: 6
        },
        cellBackgroundColor: {
            type: 'string',
            role: 'color',
            default: 'rgba(0,0,0,0)'
        },
        textCellWidth: {
            type: 'integer',
            default: 90,
            minimum: 0
        },
        strokeWidth: {
            type: 'integer',
            default: 2,
            minimum: 0
        },
        singleBarOffset: {
            type: 'integer',
            default: 5,
            minimum: 0
        },
        timeScaleLabelLength: {
            type: 'integer',
            default: 3,
            minimum: 0,
            description: 'Max length for values in dayScaleLabel and monthScaleLabel.  Zero means using full names in dayScaleLabel/monthScaleLabel.'
        },
        dayScaleLabel: {
            type: 'array',
            items: {
                type: 'string'
            },
            default: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
            description: 'Axis labels for day of week, starting from Sunday.' +
                '(Consistent with Javascript -- See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay.'
        },
        monthScaleLabel: {
            type: 'array',
            items: {
                type: 'string'
            },
            default: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
            description: 'Axis labels for month.'
        },
        characterWidth: {
            type: 'integer',
            default: 6
        },
        numberFormat: {
            type: 'string',
            default: 's',
            description: 'D3 Number format for axis labels and text tables.'
        },
        timeFormat: {
            type: 'string',
            default: '%Y-%m-%d',
            description: 'Date format for axis labels.'
        },
        useRawDomain: {
            type: 'boolean',
            default: false,
            description: 'Use the source data range as scale domain instead of ' +
                'aggregated data for aggregate axis. ' +
                'This option does not work with sum or count aggregate' +
                'as they might have a substantially larger scale range.' +
                'By default, use value from config.useRawDomain.'
        }
    }
};
exports.schema = {
    $schema: 'http://json-schema.org/draft-04/schema#',
    description: 'Schema for Vega-lite specification',
    type: 'object',
    required: ['marktype', 'encoding', 'data'],
    properties: {
        data: data,
        marktype: exports.marktype,
        encoding: {
            type: 'object',
            properties: {
                x: x,
                y: y,
                row: row,
                col: col,
                size: size,
                color: color,
                shape: shape,
                text: text,
                detail: detail
            }
        },
        config: config
    }
};
exports.encTypes = util.keys(exports.schema.properties.encoding.properties);
function instantiate() {
    return schemaUtil.instantiate(exports.schema);
}
exports.instantiate = instantiate;
;
//# sourceMappingURL=schema.js.map