Bar graph added.

This commit is contained in:
prabhatdev
2020-07-28 00:48:25 +05:30
parent d0a6e2667d
commit 194b41124d
3468 changed files with 640611 additions and 169 deletions

27
node_modules/vega-typings/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,27 @@
Copyright (c) 2015-2018, University of Washington Interactive Data Lab
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

5
node_modules/vega-typings/README.md generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# Vega-Typings
[![npm version](https://img.shields.io/npm/v/vega-typings.svg)](https://www.npmjs.com/package/vega-typings)
Typings for [Vega](https://github.com/vega/vega).

3
node_modules/vega-typings/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
// TypeScript Version: 3.4
export * from './types';

59
node_modules/vega-typings/package.json generated vendored Normal file
View File

@@ -0,0 +1,59 @@
{
"_from": "vega-typings@~0.18.0",
"_id": "vega-typings@0.18.0",
"_inBundle": false,
"_integrity": "sha512-uMSS7EEP8Q2gg4dN7D2xhi4S+dp/IQGTQp3VgieJx8ki8mrm0N43pdUC14nNYTtiUDxDdmup5nyj6JHuboKUmg==",
"_location": "/vega-typings",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "vega-typings@~0.18.0",
"name": "vega-typings",
"escapedName": "vega-typings",
"rawSpec": "~0.18.0",
"saveSpec": null,
"fetchSpec": "~0.18.0"
},
"_requiredBy": [
"/vega"
],
"_resolved": "https://registry.npmjs.org/vega-typings/-/vega-typings-0.18.0.tgz",
"_shasum": "c8f66406cae8418eafed6fbc4c7c63f88eee670d",
"_spec": "vega-typings@~0.18.0",
"_where": "/home/prabhatdev/Documents/opensource/gitHubStats/waka-readme-stats/node_modules/vega",
"author": {
"name": "Dominik Moritz",
"email": "domoritz@gmail.com"
},
"bugs": {
"url": "https://github.com/vega/vega/issues"
},
"bundleDependencies": false,
"dependencies": {
"vega-util": "^1.14.0"
},
"deprecated": false,
"description": "Typings for Vega.",
"gitHead": "62565bbe084a422c4a0cbc6e19c6f7c45a3e5137",
"homepage": "https://github.com/vega/vega#readme",
"keywords": [
"vega",
"typescript",
"typings"
],
"license": "BSD-3-Clause",
"name": "vega-typings",
"repository": {
"type": "git",
"url": "git+https://github.com/vega/vega.git"
},
"scripts": {
"build-tests": "./build-tests.sh",
"format": "prettier $([ \"$CI\" = true ] && echo --check || echo --write) './**/*.{ts,tsx,js,json,css}'",
"pretest": "yarn build-tests",
"test": "yarn format && dtslint ."
},
"types": "types",
"version": "0.18.0"
}

15
node_modules/vega-typings/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"baseUrl": ".",
"paths": { "vega": ["."] }
},
"include": ["types/**/*", "tests/**/*"]
}

2
node_modules/vega-typings/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './spec';
export * from './runtime';

28
node_modules/vega-typings/types/runtime/dataflow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,28 @@
export interface Changeset {
insert(tuples: any): this;
remove(tuples: any): this;
modify(tuple: any, field?: string, value?: any): this;
}
export function changeset(): Changeset;
export class Operator {
constructor(init?: any, update?: (obj: any, pulse: any) => any, params?: any, react?: boolean);
targets(): any;
set(value: any): 1 | 0;
skip(): (state: any) => any;
modified(): (state: any) => any;
parameters(params: object, react?: boolean, initonly?: boolean): Operator[];
marshall(stamp: number): any;
evaluate(pulse: any): any;
run(pulse: any): any;
}
export class Transform extends Operator {
constructor(init?: any, params?: any);
transform(pulse: any, params?: any): any;
}
export function isTuple(t: any): boolean;
export function tupleid(t: any): number;
export function ingest(datum: any): any;

219
node_modules/vega-typings/types/runtime/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,219 @@
import {
Color,
Config,
DataType,
EncodeEntryName,
Format,
NumberLocale,
Padding,
SignalValue,
Spec,
TimeLocale,
} from '../spec';
import { Renderers } from './renderer';
import { Changeset, Transform } from './dataflow';
import { Scene } from './scene';
import { LoggerInterface } from 'vega-util';
// TODO
export type Runtime = any;
export const version: string;
// Locale API
export function formatLocale(definition: object): void;
export function timeFormatLocale(definition: object): void;
// Parser
export function parse(spec: Spec, config?: Config, opt?: { ast?: boolean }): Runtime;
export interface Loader {
load: (uri: string, options?: any) => Promise<string>;
sanitize: (uri: string, options: any) => Promise<{ href: string }>;
http: (uri: string, options: any) => Promise<string>;
file: (filename: string) => Promise<string>;
}
export type NumberFormat = (number: number) => string;
export type TimeFormat = (date: Date | number) => string;
export type TimeParse = (dateString: string) => Date;
export interface LocaleFormatters {
format: (spec: string) => NumberFormat;
formatPrefix: (spec: string, value: number) => NumberFormat;
formatFloat: (spec: string) => NumberFormat;
formatSpan: (start: number, stop: number, count: number, spec: string) => NumberFormat;
timeFormat: (spec: string) => TimeFormat;
utcFormat: (spec: string) => TimeFormat;
timeParse: (spec: string) => TimeParse;
utcParse: (spec: string) => TimeParse;
}
export interface ToCanvasOptions {
type?: string;
context?: any;
externalContext?: any;
}
export class View {
constructor(
runtime: Runtime,
opt?: {
background?: Color;
bind?: Element | string;
container?: Element | string;
hover?: boolean;
loader?: Loader;
logger?: LoggerInterface;
logLevel?: number;
renderer?: Renderers;
tooltip?: TooltipHandler;
locale?: LocaleFormatters;
expr?: any;
},
);
initialize(container?: Element | string, bindContainer?: Element | string): this;
finalize(): this;
logLevel(level: number): this;
logLevel(): number;
logger(logger: LoggerInterface): this;
logger(): LoggerInterface;
renderer(renderer: Renderers): this;
renderer(): Renderers;
loader(loader: Loader): this;
loader(): Loader;
locale(locale: LocaleFormatters): this;
locale(): LocaleFormatters;
hover(hoverSet?: EncodeEntryName, leaveSet?: EncodeEntryName): this;
run(encode?: string): this;
runAfter(callback: (view: this) => void, enqueue?: boolean, priority?: number): this;
runAsync(): Promise<View>;
insert(name: string, tuples: any): this;
remove(name: string, tuples: any): this;
change(name: string, changeset: Changeset): this;
changeset(): any;
data(name: string): any[];
data(name: string, tuples: any): this;
description(s: string): this;
description(): string;
width(w: number): this;
width(): number;
height(h: number): this;
height(): number;
origin(): [number, number];
padding(p: Padding): this;
padding(): Padding;
resize(): this;
toImageURL(type: string, scaleFactor?: number): Promise<string>;
toSVG(scaleFactor?: number): Promise<string>;
toCanvas(scaleFactor?: number, options?: ToCanvasOptions): Promise<HTMLCanvasElement>;
signal(name: string, value: SignalValue): this;
signal(name: string): SignalValue;
container(): HTMLElement | null;
scenegraph(): Scene;
addEventListener(type: string, handler: EventListenerHandler): this;
removeEventListener(type: string, handler: EventListenerHandler): this;
addSignalListener(name: string, handler: SignalListenerHandler): this;
removeSignalListener(name: string, handler: SignalListenerHandler): this;
addDataListener(name: string, handler: DataListenerHandler): this;
removeDataListener(name: string, handler: DataListenerHandler): this;
addResizeListener(handler: ResizeHandler): this;
removeResizeListener(handler: ResizeHandler): this;
tooltip(handler: TooltipHandler): this;
getState(options?: {
signals?: (name?: string, operator?: any) => boolean;
data?: (name?: string, object?: any) => boolean;
recurse?: boolean;
}): { signals?: any; data?: any };
setState(state: { signals?: any; data?: any }): this;
}
export type ScenegraphEvent = MouseEvent | TouchEvent | KeyboardEvent;
export interface LoaderOptions {
baseURL?: string;
mode?: 'file' | 'http';
defaultProtocol?: 'http' | 'https' | string;
target?: string;
http?: RequestInit;
}
export function loader(opt?: LoaderOptions): Loader;
export function read(
data: string,
schema: Format,
dateParse?: (dateString: string) => Date,
): object[];
export type TypeInference = DataType | 'integer';
export function inferType(values: readonly any[], field?: string): TypeInference;
export function inferTypes(
values: readonly any[],
fields: readonly string[],
): { [field: string]: TypeInference };
export type EventListenerHandler = (event: ScenegraphEvent, item?: Item) => void;
export type SignalListenerHandler = (name: string, value: SignalValue) => void;
export type DataListenerHandler = (name: string, value: any) => void;
export type ResizeHandler = (width: number, height: number) => void;
export type TooltipHandler = (handler: any, event: MouseEvent, item: Item, value: any) => void;
export interface Item<T = any> {
/**
* The underlying data element to which this item corresponds.
*/
datum: T;
/**
* The mark to which this item belongs.
*/
mark: RuntimeMark;
}
export type RuntimeMark =
| DefineMark<'group'>
| DefineMark<'rect', { x: number; y: number; width: number; height: number; fill: number }>
| DefineMark<'symbol', {}, 'legend-symbol'>
| DefineMark<'path'>
| DefineMark<'arc'>
| DefineMark<'area'>
| DefineMark<'line'>
| DefineMark<'image'>
| DefineMark<'text', {}, 'axis-label' | 'legend-label'>;
export interface DefineMark<T extends string, I = {}, R extends string = never> {
marktype: T;
role: 'mark' | R;
items: Item<I>[];
group: any;
}
// Extensibility: https://vega.github.io/vega/docs/api/extensibility/
export function projection(type: string, projection: any): View;
export function scale(type: string, scale?: any): any;
export function scheme(name: string, scheme?: any): any;
export function schemeDiscretized(name: string, scheme?: any, interpolator?: any): any;
export function expressionFunction(name: string, fn?: any, visitor?: any): any;
export const transforms: { [name: string]: Transform };
export * from 'vega-util';
export * from './dataflow';
export * from './renderer';
export * from './scene';

22
node_modules/vega-typings/types/runtime/renderer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import { Scene, SceneItem } from './scene';
import { Loader } from '.';
export type Renderers = 'canvas' | 'svg' | 'none';
export class Renderer {
constructor(loader: Loader);
initialize(el: HTMLElement, width: number, height: number, origin: readonly number[]): this;
resize(width: number, height: number, origin: readonly number[]): this;
}
export interface RenderModule {
renderer: typeof Renderer;
headless?: Renderer;
handler: Handler;
}
export function renderModule(moduleName: string, renderModule: RenderModule): RenderModule;
export class Handler {}
export class CanvasHandler extends Handler {}

110
node_modules/vega-typings/types/runtime/scene.d.ts generated vendored Normal file
View File

@@ -0,0 +1,110 @@
export interface Scene {
bounds: Bounds;
clip: boolean;
interactive: boolean;
items: SceneGroup[];
marktype: string;
name: string;
role: string;
}
export class Bounds {
x1: number;
y1: number;
x2: number;
y2: number;
clone: () => Bounds;
clear: () => Bounds;
empty: () => void;
equals: (b: Bounds) => boolean;
set: (x1: number, y1: number, x2: number, y2: number) => Bounds;
add: (x: number, y: number) => Bounds;
expand: (d: number) => Bounds;
round: () => Bounds;
translate: (dx: number, dy: number) => Bounds;
rotate: (angle: number, x: number, y: number) => Bounds;
rotatedPoints: (angle: number, x: number, y: number) => number[];
union: (b: Bounds) => Bounds;
encloses: (b: Bounds) => boolean;
alignsWith: (b: Bounds) => boolean;
intersects: (b: Bounds) => boolean;
contains: (x: number, y: number) => boolean;
width: () => number;
height: () => number;
}
export interface SceneItem {
bounds: Bounds;
datum?: object;
mark: { role: string };
x: number;
y: number;
}
export type SceneRect = SceneItem & {
fill: string;
height: number;
width: number;
};
export type SceneLine = SceneItem & {
opacity: number;
stroke: string;
strokeWidth: number;
x2: number;
y2: number;
};
export interface SceneContext {
background?: string;
}
export type SceneGroup = SceneItem & {
context: SceneContext;
items: SceneItem[];
height: number;
width: number;
stroke?: string;
};
export type SceneSymbol = SceneItem & {
fill: string;
shape: string;
size: number;
strokeWidth: number;
};
export type SceneTextBaseline = 'top' | 'middle' | 'bottom';
export type SceneTextAlign = 'left' | 'center' | 'right';
export type SceneText = SceneItem & {
align?: SceneTextAlign;
angle?: number;
baseline: SceneTextBaseline;
dir?: 'rtl' | 'ltr';
dx?: number;
dy: number;
ellipsis?: string;
fill: string;
font: string;
fontSize: number;
fontStyle?: string;
fontWeight?: number | string;
limit?: number;
lineBreak?: string;
lineHeight?: number;
radius?: number;
text: string;
theta?: number;
};
export interface SceneLegendItem {
datum: {
index: number;
};
}
export function sceneVisit(
scene: Scene | SceneGroup,
itemCallback: (item: Scene | SceneGroup | SceneItem) => void,
): void;

8
node_modules/vega-typings/types/spec/autosize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export type AutoSizeType = 'pad' | 'fit' | 'fit-x' | 'fit-y' | 'none';
export type AutoSize =
| AutoSizeType
| {
type: AutoSizeType;
resize?: boolean;
contains?: 'content' | 'padding';
};

559
node_modules/vega-typings/types/spec/axis.d.ts generated vendored Normal file
View File

@@ -0,0 +1,559 @@
import {
GroupEncodeEntry,
GuideEncodeEntry,
RuleEncodeEntry,
SignalRef,
TextEncodeEntry,
TimeInterval,
} from '.';
import { Text } from './encode';
import { TimeIntervalStep } from './scale';
import {
AlignValue,
AnchorValue,
BooleanValue,
ColorValue,
DashArrayValue,
FontStyleValue,
FontWeightValue,
NumberValue,
StringValue,
StrokeCapValue,
TextBaselineValue,
} from './values';
export type AxisOrient = 'top' | 'bottom' | 'left' | 'right';
export type LabelOverlap = boolean | 'parity' | 'greedy';
export type TickCount = number | TimeInterval | TimeIntervalStep | SignalRef;
export type FormatType = 'number' | 'time' | 'utc';
export interface TimeFormatSpecifier {
year?: string;
quarter?: string;
month?: string;
date?: string;
week?: string;
day?: string;
hours?: string;
minutes?: string;
seconds?: string;
milliseconds?: string;
}
export interface Axis extends BaseAxis {
/**
* 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).
*
* __Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.
*/
orient: AxisOrient | SignalRef;
/**
* The name of the scale backing the axis component.
*/
scale: string;
/**
* The name of the scale to use for including grid lines. By default grid lines are driven by the same scale as the ticks and labels.
*/
gridScale?: string;
/**
* The format specifier pattern for axis labels. For numerical values, must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier. For date-time values, must be a legal [d3-time-format](https://github.com/d3/d3-time-format#locale_format) specifier or multi-format object.
*/
format?: string | TimeFormatSpecifier | SignalRef;
/**
* The format type for axis labels (number, time, or utc).
*/
formatType?: FormatType | SignalRef;
/**
* A title for the axis (none by default).
*/
title?: Text | SignalRef;
/**
* The orthogonal offset in pixels by which to displace the axis from its position along the edge of the chart.
*/
offset?: NumberValue;
/**
* The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.
*
* __Default value__: `0`
*/
position?: NumberValue;
/**
* 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.
*
* For scales of type `"time"` or `"utc"`, the tick count can instead be a time interval specifier. Legal string values are `"millisecond"`, `"second"`, `"minute"`, `"hour"`, `"day"`, `"week"`, `"month"`, and "year". Alternatively, an object-valued interval specifier of the form `{"interval": "month", "step": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.
*
* @minimum 0
*/
tickCount?: TickCount;
/**
* The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.
*/
tickMinStep?: number | SignalRef;
/**
* Explicitly set the visible axis tick and label values.
*/
values?: any[] | SignalRef;
/**
* Mark definitions for custom axis encoding.
*/
encode?: AxisEncode;
}
export interface AxisEncode {
/**
* Custom encoding for the axis container.
*/
axis?: GuideEncodeEntry<GroupEncodeEntry>;
/**
* Custom encoding for axis tick rule marks.
*/
ticks?: GuideEncodeEntry<GroupEncodeEntry>;
/**
* Custom encoding for axis label text marks.
*/
labels?: GuideEncodeEntry<TextEncodeEntry>;
/**
* Custom encoding for the axis title text mark.
*/
title?: GuideEncodeEntry<TextEncodeEntry>;
/**
* Custom encoding for axis gridline rule marks.
*/
grid?: GuideEncodeEntry<RuleEncodeEntry>;
/**
* Custom encoding for the axis domain rule mark.
*/
domain?: GuideEncodeEntry<RuleEncodeEntry>;
}
export interface BaseAxis {
/**
* Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).
*
* __Default value:__ `0.5`
*/
translate?: NumberValue;
/**
* The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.
*
* __Default value:__ `30` for y-axis; `undefined` for x-axis.
*/
minExtent?: NumberValue;
/**
* The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.
*
* __Default value:__ `undefined`.
*/
maxExtent?: NumberValue;
/**
* An interpolation fraction indicating where, for `band` scales, axis ticks should be positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5` places ticks in the middle of their bands.
*
* __Default value:__ `0.5`
*/
bandPosition?: NumberValue;
// ---------- ARIA ----------
/**
* A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only).
* If `false`, the "aria-hidden" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree.
*
* __Default value:__ `true`
*/
aria?: boolean;
/**
* A text description of this axis for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If the `aria` property is true, for SVG output the ["aria-label" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description.
* If the description is unspecified it will be automatically generated.
*/
description?: string;
// ---------- Title ----------
/**
* The padding, in pixels, between title and axis.
*/
titlePadding?: NumberValue;
/**
* Horizontal text alignment of axis titles.
*/
titleAlign?: AlignValue;
/**
* Text anchor position for placing axis titles.
*/
titleAnchor?: AnchorValue;
/**
* Angle in degrees of axis titles.
*/
titleAngle?: NumberValue;
/**
* X-coordinate of the axis title relative to the axis group.
*/
titleX?: NumberValue;
/**
* Y-coordinate of the axis title relative to the axis group.
*/
titleY?: NumberValue;
/**
* Vertical text baseline for axis titles. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`, `"line-top"`, or `"line-bottom"`. The `"line-top"` and `"line-bottom"` values operate similarly to `"top"` and `"bottom"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.
*/
titleBaseline?: TextBaselineValue;
/**
* Color of the title, can be in hex color code or regular color name.
*/
titleColor?: ColorValue;
/**
* Font of the title. (e.g., `"Helvetica Neue"`).
*/
titleFont?: StringValue;
/**
* Font size of the title.
*
* @minimum 0
*/
titleFontSize?: NumberValue;
/**
* Font style of the title.
*/
titleFontStyle?: FontStyleValue;
/**
* Font weight of the title.
* This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
*/
titleFontWeight?: FontWeightValue;
/**
* Maximum allowed pixel width of axis titles.
*
* @minimum 0
*/
titleLimit?: NumberValue;
/**
* Line height in pixels for multi-line title text or title text with `"line-top"` or `"line-bottom"` baseline.
*/
titleLineHeight?: NumberValue;
/**
* Opacity of the axis title.
*/
titleOpacity?: NumberValue;
// ---------- Domain ----------
/**
* A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.
*
* __Default value:__ `true`
*/
domain?: boolean;
/**
* The stroke cap for the domain line's ending style. One of `"butt"`, `"round"` or `"square"`.
*
* __Default value:__ `"butt"`
*/
domainCap?: StrokeCapValue;
/**
* An array of alternating [stroke, space] lengths for dashed domain lines.
*/
domainDash?: DashArrayValue;
/**
* The pixel offset at which to start drawing with the domain dash array.
*/
domainDashOffset?: NumberValue;
/**
* Color of axis domain line.
*
* __Default value:__ `"gray"`.
*/
domainColor?: ColorValue;
/**
* Opacity of the axis domain line.
*/
domainOpacity?: NumberValue;
/**
* Stroke width of axis domain line
*
* __Default value:__ `1`
*/
domainWidth?: NumberValue;
// ---------- Ticks ----------
/**
* Boolean value that determines whether the axis should include ticks.
*
* __Default value:__ `true`
*/
ticks?: BooleanValue;
/**
* For band scales, indicates if ticks and grid lines should be placed at the `"center"` of a band (default) or at the band `"extent"`s to indicate intervals
*/
tickBand?: 'center' | 'extent' | SignalRef;
/**
* The stroke cap for the tick lines' ending style. One of `"butt"`, `"round"` or `"square"`.
*
* __Default value:__ `"butt"`
*/
tickCap?: StrokeCapValue;
/**
* The color of the axis's tick.
*
* __Default value:__ `"gray"`
*/
tickColor?: ColorValue;
/**
* An array of alternating [stroke, space] lengths for dashed tick mark lines.
*/
tickDash?: DashArrayValue;
/**
* The pixel offset at which to start drawing with the tick mark dash array.
*/
tickDashOffset?: NumberValue;
/**
* Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `"bandPosition": 1` and an axis `"padding"` value of `0`.
*/
tickExtra?: BooleanValue;
/**
* Position offset in pixels to apply to ticks, labels, and gridlines.
*/
tickOffset?: NumberValue;
/**
* Opacity of the ticks.
*/
tickOpacity?: NumberValue;
/**
* Boolean flag indicating if pixel position values should be rounded to the nearest integer.
*
* __Default value:__ `true`
*/
tickRound?: BooleanValue;
/**
* The size in pixels of axis ticks.
*
* __Default value:__ `5`
* @minimum 0
*/
tickSize?: NumberValue;
/**
* The width, in pixels, of ticks.
*
* __Default value:__ `1`
* @minimum 0
*/
tickWidth?: NumberValue;
// ---------- Grid ----------
/**
* A boolean flag indicating if grid lines should be included as part of the axis.
*/
grid?: boolean;
/**
* The stroke cap for grid lines' ending style. One of `"butt"`, `"round"` or `"square"`.
*
* __Default value:__ `"butt"`
*/
gridCap?: StrokeCapValue;
/**
* Color of gridlines.
*
* __Default value:__ `"lightGray"`.
*/
gridColor?: ColorValue;
/**
* An array of alternating [stroke, space] lengths for dashed grid lines.
*/
gridDash?: DashArrayValue;
/**
* The pixel offset at which to start drawing with the grid dash array.
*/
gridDashOffset?: NumberValue;
/**
* The stroke opacity of grid (value between [0,1])
*
* __Default value:__ `1`
* @minimum 0
* @maximum 1
*/
gridOpacity?: NumberValue;
/**
* The grid width, in pixels.
*
* __Default value:__ `1`
* @minimum 0
*/
gridWidth?: NumberValue;
// ---------- Labels ----------
/**
* A boolean flag indicating if labels should be included as part of the axis.
*
* __Default value:__ `true`.
*/
labels?: boolean;
/**
* Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation.
*/
labelAlign?: AlignValue;
/**
* Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation.
* One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`, `"line-top"`, or `"line-bottom"`. The `"line-top"` and `"line-bottom"` values operate similarly to `"top"` and `"bottom"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.
*/
labelBaseline?: TextBaselineValue;
/**
* Indicates if labels should be hidden if they exceed the axis range. If `false` (the default) no bounds overlap analysis is performed. If `true`, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.
*
* __Default value:__ `false`.
*/
labelBound?: number | boolean | SignalRef;
/**
* Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.
*/
labelFlush?: number | boolean | SignalRef;
/**
* Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of `2` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.
*
* __Default value:__ `0`.
*/
labelFlushOffset?: number | SignalRef;
/**
* Line height in pixels for multi-line label text or label text with `"line-top"` or `"line-bottom"` baseline.
*/
labelLineHeight?: NumberValue;
/**
* The strategy to use for resolving overlap of axis labels. If `false` (the default), no overlap reduction is attempted. If set to `true` or `"parity"`, a strategy of removing every other label is used (this works well for standard linear axes). If set to `"greedy"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).
*/
labelOverlap?: LabelOverlap | SignalRef;
/**
* The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.
*/
labelSeparation?: number | SignalRef;
/**
* The rotation angle of the axis labels.
*
* __Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.
*
* @minimum -360
* @maximum 360
*/
labelAngle?: NumberValue;
/**
* The color of the tick label, can be in hex color code or regular color name.
*/
labelColor?: ColorValue;
/**
* The font of the tick label.
*/
labelFont?: StringValue;
/**
* The font size of the label, in pixels.
*
* @minimum 0
*/
labelFontSize?: NumberValue;
/**
* Font style of the title.
*/
labelFontStyle?: FontStyleValue;
/**
* Font weight of axis tick labels.
*/
labelFontWeight?: FontWeightValue;
/**
* Maximum allowed pixel width of axis tick labels.
*
* __Default value:__ `180`
*/
labelLimit?: NumberValue;
/**
* The opacity of the labels.
*/
labelOpacity?: NumberValue;
/**
* Position offset in pixels to apply to labels, in addition to tickOffset.
*
* __Default value:__ `0`
*/
labelOffset?: NumberValue;
/**
* The padding in pixels between labels and ticks.
*
* __Default value:__ `2`
*/
labelPadding?: NumberValue;
/**
* The integer z-index indicating the layering of the axis group relative to other axis, mark, and legend groups.
*
* @TJS-type integer
* @minimum 0
*/
zindex?: number;
}

27
node_modules/vega-typings/types/spec/bind.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export type Element = string;
export interface BaseBinding {
type?: string;
element?: Element;
debounce?: number;
name?: string;
}
export interface InputBinding extends BaseBinding {
input?: string;
placeholder?: string;
autocomplete?: string;
}
export interface BindCheckbox extends BaseBinding {
input: 'checkbox';
}
export interface BindRadioSelect extends BaseBinding {
input: 'radio' | 'select';
options: any[];
labels?: string[];
}
export interface BindRange extends BaseBinding {
input: 'range';
min?: number;
max?: number;
step?: number;
}
export type Binding = BindCheckbox | BindRadioSelect | BindRange | InputBinding;

162
node_modules/vega-typings/types/spec/color.d.ts generated vendored Normal file
View File

@@ -0,0 +1,162 @@
/**
* @format color-hex
*/
export type HexColor = string;
export type ColorName =
| 'black'
| 'silver'
| 'gray'
| 'white'
| 'maroon'
| 'red'
| 'purple'
| 'fuchsia'
| 'green'
| 'lime'
| 'olive'
| 'yellow'
| 'navy'
| 'blue'
| 'teal'
| 'aqua'
| 'orange'
| 'aliceblue'
| 'antiquewhite'
| 'aquamarine'
| 'azure'
| 'beige'
| 'bisque'
| 'blanchedalmond'
| 'blueviolet'
| 'brown'
| 'burlywood'
| 'cadetblue'
| 'chartreuse'
| 'chocolate'
| 'coral'
| 'cornflowerblue'
| 'cornsilk'
| 'crimson'
| 'cyan'
| 'aqua'
| 'darkblue'
| 'darkcyan'
| 'darkgoldenrod'
| 'darkgray'
| 'darkgreen'
| 'darkgrey'
| 'darkkhaki'
| 'darkmagenta'
| 'darkolivegreen'
| 'darkorange'
| 'darkorchid'
| 'darkred'
| 'darksalmon'
| 'darkseagreen'
| 'darkslateblue'
| 'darkslategray'
| 'darkslategrey'
| 'darkturquoise'
| 'darkviolet'
| 'deeppink'
| 'deepskyblue'
| 'dimgray'
| 'dimgrey'
| 'dodgerblue'
| 'firebrick'
| 'floralwhite'
| 'forestgreen'
| 'gainsboro'
| 'ghostwhite'
| 'gold'
| 'goldenrod'
| 'greenyellow'
| 'grey'
| 'honeydew'
| 'hotpink'
| 'indianred'
| 'indigo'
| 'ivory'
| 'khaki'
| 'lavender'
| 'lavenderblush'
| 'lawngreen'
| 'lemonchiffon'
| 'lightblue'
| 'lightcoral'
| 'lightcyan'
| 'lightgoldenrodyellow'
| 'lightgray'
| 'lightgreen'
| 'lightgrey'
| 'lightpink'
| 'lightsalmon'
| 'lightseagreen'
| 'lightskyblue'
| 'lightslategray'
| 'lightslategrey'
| 'lightsteelblue'
| 'lightyellow'
| 'limegreen'
| 'linen'
| 'magenta'
| 'fuchsia'
| 'mediumaquamarine'
| 'mediumblue'
| 'mediumorchid'
| 'mediumpurple'
| 'mediumseagreen'
| 'mediumslateblue'
| 'mediumspringgreen'
| 'mediumturquoise'
| 'mediumvioletred'
| 'midnightblue'
| 'mintcream'
| 'mistyrose'
| 'moccasin'
| 'navajowhite'
| 'oldlace'
| 'olivedrab'
| 'orangered'
| 'orchid'
| 'palegoldenrod'
| 'palegreen'
| 'paleturquoise'
| 'palevioletred'
| 'papayawhip'
| 'peachpuff'
| 'peru'
| 'pink'
| 'plum'
| 'powderblue'
| 'rosybrown'
| 'royalblue'
| 'saddlebrown'
| 'salmon'
| 'sandybrown'
| 'seagreen'
| 'seashell'
| 'sienna'
| 'skyblue'
| 'slateblue'
| 'slategray'
| 'slategrey'
| 'snow'
| 'springgreen'
| 'steelblue'
| 'tan'
| 'thistle'
| 'tomato'
| 'turquoise'
| 'violet'
| 'wheat'
| 'whitesmoke'
| 'yellowgreen'
| 'rebeccapurple';
export type Color =
| ColorName
| HexColor
// RGB, HSL, HSV, HWB, CMYK colors
| string;

651
node_modules/vega-typings/types/spec/config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,651 @@
import {
Align,
AutoSize,
EventType,
FontStyle,
FontWeight,
Interpolate,
Mark,
Orientation,
Padding,
RangeScheme,
SymbolShape,
TextBaseline,
} from '.';
import { BaseAxis } from './axis';
import { Color } from './color';
import {
Blend,
ColorValueRef,
Gradient,
NumericValueRef,
ScaledValueRef,
Text,
TextDirection,
} from './encode.d';
import { LayoutBounds } from './layout';
import { BaseLegend } from './legend';
import { Locale } from './locale';
import { BaseProjection } from './projection';
import { InitSignal, NewSignal, SignalRef } from './signal';
import { BaseTitle, TitleAnchor } from './title';
export type KeepSignal<T> = T extends SignalRef ? SignalRef : never;
/**
* Config properties cannot be scaled or reference fields but they can reference signals.
*/
export type ExcludeMappedValueRef<T> = {
[P in keyof T]:
| Exclude<T[P], ScaledValueRef<any> | NumericValueRef | ColorValueRef>
| KeepSignal<T[P]>;
};
export interface Config
extends Partial<Record<MarkConfigKeys, MarkConfig>>,
Partial<Record<AxisConfigKeys, AxisConfig>> {
autosize?: AutoSize | SignalRef;
background?: null | Color | SignalRef;
padding?: Padding | SignalRef;
group?: any; // TODO
events?: {
bind?: 'any' | 'container' | 'none';
defaults?: DefaultsConfig;
globalCursor?: boolean;
selector?: boolean | string[];
timer?: boolean;
view?: boolean | string[];
window?: boolean | string[];
};
locale?: Locale;
/**
* A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the "lineBreak" mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid.
*/
lineBreak?: string | SignalRef;
style?: {
[style: string]: MarkConfig;
};
legend?: LegendConfig;
title?: TitleConfig;
projection?: ProjectionConfig;
range?: RangeConfig;
signals?: (InitSignal | NewSignal)[];
}
/**
* The defaults object should have a single property: either "prevent" (to indicate which events should have default behavior suppressed) or "allow" (to indicate only those events whose default behavior should be allowed).
*/
export type DefaultsConfig =
| Record<'prevent', boolean | EventType[]>
| Record<'allow', boolean | EventType[]>;
export type MarkConfigKeys = 'mark' | Mark['type'];
export type StrokeCap = 'butt' | 'round' | 'square';
export type StrokeJoin = 'miter' | 'round' | 'bevel';
export interface MarkConfig {
/**
* A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only).
* If `false`, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.
*/
aria?: boolean | SignalRef;
/**
* Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the "role" attribute.
* Warning: this property is experimental and may be changed in the future.
*/
ariaRole?: string | SignalRef;
/**
* A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the "aria-roledescription" attribute.
* Warning: this property is experimental and may be changed in the future.
*/
ariaRoleDescription?: string | SignalRef;
/**
* A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the ["aria-label" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).
*/
description?: string | SignalRef;
/**
* Width of the marks.
*/
width?: number | SignalRef;
/**
* Height of the marks.
*/
height?: number | SignalRef;
/**
* Whether to keep aspect ratio of image marks.
*/
aspect?: boolean;
/**
* Default fill color.
*
* __Default value:__ (None)
*
*/
fill?: Color | Gradient | null | SignalRef;
/**
* Default stroke color.
*
* __Default value:__ (None)
*
*/
stroke?: Color | Gradient | null | SignalRef;
// ---------- Opacity ----------
/**
* The overall opacity (value between [0,1]).
*
* @minimum 0
* @maximum 1
*/
opacity?: number | SignalRef;
/**
* The fill opacity (value between [0,1]).
*
* __Default value:__ `1`
*
* @minimum 0
* @maximum 1
*/
fillOpacity?: number | SignalRef;
/**
* The stroke opacity (value between [0,1]).
*
* __Default value:__ `1`
*
* @minimum 0
* @maximum 1
*/
strokeOpacity?: number | SignalRef;
/**
* The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.
*
* __Default value: `"source-over"`
*/
blend?: Blend;
// ---------- Stroke Style ----------
/**
* The stroke width, in pixels.
*
* @minimum 0
*/
strokeWidth?: number | SignalRef;
/**
* An array of alternating stroke, space lengths for creating dashed or dotted lines.
*/
strokeDash?: number[] | SignalRef;
/**
* The offset (in pixels) into which to begin drawing with the stroke dash array.
*/
strokeDashOffset?: number | SignalRef;
/**
* The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.
*/
strokeOffset?: number | SignalRef;
/**
* The stroke cap for line ending style. One of `"butt"`, `"round"`, or `"square"`.
*
* __Default value:__ `"butt"`
*
*/
strokeCap?: StrokeCap | SignalRef;
/**
* The stroke line join method. One of `"miter"`, `"round"` or `"bevel"`.
*
* __Default value:__ `"miter"`
*
*/
strokeJoin?: StrokeJoin | SignalRef;
/**
* The miter limit at which to bevel a line join.
*/
strokeMiterLimit?: number | SignalRef;
/**
* The orientation of the area mark. One of `horizontal` or `vertical` (the default). With a vertical orientation, an area mark is defined by the `x`, `y`, and (`y2` or `height`) properties; with a horizontal orientation, the `y`, `x` and (`x2` or `width`) properties must be specified instead.
*/
orient?: Orientation | SignalRef;
// ---------- Interpolation: Line / area ----------
/**
* The line interpolation method to use for line and area marks. One of the following:
* - `"linear"`: piecewise linear segments, as in a polyline.
* - `"linear-closed"`: close the linear segments to form a polygon.
* - `"step"`: alternate between horizontal and vertical segments, as in a step function.
* - `"step-before"`: alternate between vertical and horizontal segments, as in a step function.
* - `"step-after"`: alternate between horizontal and vertical segments, as in a step function.
* - `"basis"`: a B-spline, with control point duplication on the ends.
* - `"basis-open"`: an open B-spline; may not intersect the start or end.
* - `"basis-closed"`: a closed B-spline, as in a loop.
* - `"cardinal"`: a Cardinal spline, with control point duplication on the ends.
* - `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.
* - `"cardinal-closed"`: a closed Cardinal spline, as in a loop.
* - `"bundle"`: equivalent to basis, except the tension parameter is used to straighten the spline.
* - `"monotone"`: cubic interpolation that preserves monotonicity in y.
*/
interpolate?: Interpolate | SignalRef;
/**
* Depending on the interpolation type, sets the tension parameter (for line and area marks).
*/
tension?: number | SignalRef;
/**
* Shape of the point marks. Supported values include:
* - plotting shapes: `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.
* - the line symbol `"stroke"`
* - centered directional shapes `"arrow"`, `"wedge"`, or `"triangle"`
* - a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)
*
* __Default value:__ `"circle"`
*/
shape?: SymbolShape | string | SignalRef;
/**
* The area in pixels of the symbols bounding box. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.
*
* __Default value:__ `30`
*
* @minimum 0
*/
size?: number | SignalRef;
// Text / Label Mark Config
/**
* The horizontal alignment of the text. One of `"left"`, `"right"`, `"center"`.
*/
align?: Align | SignalRef;
/**
* The rotation angle of the text, in degrees.
*
* @minimum 0
* @maximum 360
*/
angle?: number | SignalRef;
/**
* The start angle in radians for arc marks.
* A value of `0` indicates up (north), increasing values proceed clockwise.
*/
startAngle?: number | SignalRef;
/**
* The end angle in radians for arc marks.
* A value of `0` indicates up (north), increasing values proceed clockwise.
*/
endAngle?: number | SignalRef;
/**
* The angular padding applied to sides of the arc, in radians.
*/
padAngle?: number | SignalRef;
/**
* The inner radius in pixels of arc marks.
*
* @minimum 0
* __Default value:__ `0`
*/
innerRadius?: number | SignalRef;
/**
* The outer radius in pixels of arc marks.
*
* @minimum 0
* __Default value:__ `0`
*/
outerRadius?: number | SignalRef;
/**
* The vertical alignment of the text. One of `"top"`, `"bottom"`, `"middle"`, `"alphabetic"`.
*
* __Default value:__ `"middle"`
*
*/
baseline?: TextBaseline | SignalRef;
/**
* The direction of the text. One of `"ltr"` (left-to-right) or `"rtl"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.
*
* __Default value:__ `"ltr"`
*/
dir?: TextDirection | SignalRef;
/**
* The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.
*/
dx?: number | SignalRef;
/**
* The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.
*/
dy?: number | SignalRef;
/**
* The ellipsis string for text truncated in response to the limit parameter.
*
* __Default value:__ `"…"`
*/
ellipsis?: string;
/**
* Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.
*
* @minimum 0
*/
radius?: number | SignalRef;
/**
* The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.
*
* __Default value:__ `0` -- indicating no limit
*/
limit?: number | SignalRef;
/**
* A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.
*/
lineBreak?: string | SignalRef;
/**
* The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.
*/
lineHeight?: number | SignalRef;
/**
* Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating "north".
*/
theta?: number | SignalRef;
/**
* The typeface to set the text in (e.g., `"Helvetica Neue"`).
*/
font?: string | SignalRef;
/**
* The font size, in pixels.
*
* __Default value:__ `11`
*
* @minimum 0
*/
fontSize?: number | SignalRef;
/**
* The font style (e.g., `"italic"`).
*/
fontStyle?: FontStyle | SignalRef;
/**
* The font weight.
* This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
*/
fontWeight?: FontWeight | SignalRef;
/**
* Placeholder text if the `text` channel is not specified
*/
text?: Text | SignalRef;
/**
* A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
*
* @format uri
*/
href?: string | SignalRef;
/**
* The tooltip text to show upon mouse hover.
*/
tooltip?: string | SignalRef;
/**
* The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.
*/
cursor?: Cursor | SignalRef;
// ---------- Corner Radius: Bar, Tick, Rect ----------
/**
* The radius in pixels of rounded rectangles or arcs' corners.
*
* __Default value:__ `0`
*/
cornerRadius?: number | SignalRef;
/**
* The radius in pixels of rounded rectangles' top right corner.
*
* __Default value:__ `0`
*/
cornerRadiusTopLeft?: number | SignalRef;
/**
* The radius in pixels of rounded rectangles' top left corner.
*
* __Default value:__ `0`
*/
cornerRadiusTopRight?: number | SignalRef;
/**
* The radius in pixels of rounded rectangles' bottom right corner.
*
* __Default value:__ `0`
*/
cornerRadiusBottomRight?: number | SignalRef;
/**
* The radius in pixels of rounded rectangles' bottom left corner.
*
* __Default value:__ `0`
*/
cornerRadiusBottomLeft?: number | SignalRef;
}
export type Cursor =
| 'auto'
| 'default'
| 'none'
| 'context-menu'
| 'help'
| 'pointer'
| 'progress'
| 'wait'
| 'cell'
| 'crosshair'
| 'text'
| 'vertical-text'
| 'alias'
| 'copy'
| 'move'
| 'no-drop'
| 'not-allowed'
| 'e-resize'
| 'n-resize'
| 'ne-resize'
| 'nw-resize'
| 's-resize'
| 'se-resize'
| 'sw-resize'
| 'w-resize'
| 'ew-resize'
| 'ns-resize'
| 'nesw-resize'
| 'nwse-resize'
| 'col-resize'
| 'row-resize'
| 'all-scroll'
| 'zoom-in'
| 'zoom-out'
| 'grab'
| 'grabbing';
export type AxisConfigKeys =
| 'axis'
| 'axisX'
| 'axisY'
| 'axisTop'
| 'axisRight'
| 'axisBottom'
| 'axisLeft'
| 'axisBand';
export type AxisConfig = ExcludeMappedValueRef<BaseAxis>;
/**
* Legend config without signals so we can use it in Vega-Lite.
*/
export interface LegendConfig extends ExcludeMappedValueRef<BaseLegend> {
/**
* The default direction (`"horizontal"` or `"vertical"`) for gradient legends.
*
* __Default value:__ `"vertical"`.
*/
gradientDirection?: Orientation;
/**
* The maximum allowed length in pixels of color ramp gradient labels.
*/
gradientLabelLimit?: number | SignalRef;
/**
* Vertical offset in pixels for color ramp gradient labels.
*
* __Default value:__ `2`.
*/
gradientLabelOffset?: number | SignalRef;
/**
* Default fill color for legend symbols. Only applied if there is no `"fill"` scale color encoding for the legend.
*
* __Default value:__ `"transparent"`.
*/
symbolBaseFillColor?: null | Color | SignalRef;
/**
* Default stroke color for legend symbols. Only applied if there is no `"fill"` scale color encoding for the legend.
*
* __Default value:__ `"gray"`.
*/
symbolBaseStrokeColor?: null | Color | SignalRef;
/**
* The default direction (`"horizontal"` or `"vertical"`) for symbol legends.
*
* __Default value:__ `"vertical"`.
*/
symbolDirection?: Orientation;
/**
* Border stroke dash pattern for the full legend.
*/
strokeDash?: number[] | SignalRef;
/**
* Border stroke width for the full legend.
*/
strokeWidth?: number | SignalRef;
/**
* Legend orient group layout parameters.
*/
layout?: LegendLayout;
}
export interface BaseLegendLayout {
/**
* The anchor point for legend orient group layout.
*/
anchor?: TitleAnchor | SignalRef;
/**
* The bounds calculation to use for legend orient group layout.
*/
bounds?: LayoutBounds;
/**
* A flag to center legends within a shared orient group.
*/
center?: boolean | SignalRef;
/**
* The layout direction for legend orient group layout.
*/
direction?: Orientation | SignalRef;
/**
* The pixel margin between legends within a orient group.
*/
margin?: number | SignalRef;
/**
* The pixel offset from the chart body for a legend orient group.
*/
offset?: number | SignalRef;
}
export interface LegendLayout extends BaseLegendLayout {
left?: BaseLegendLayout;
right?: BaseLegendLayout;
top?: BaseLegendLayout;
bottom?: BaseLegendLayout;
'top-left'?: BaseLegendLayout;
'top-right'?: BaseLegendLayout;
'bottom-left'?: BaseLegendLayout;
'bottom-right'?: BaseLegendLayout;
}
export type TitleConfig = ExcludeMappedValueRef<BaseTitle>;
export type ProjectionConfig = ExcludeMappedValueRef<BaseProjection>;
export type RangeConfig = {
/**
* Default [color scheme](https://vega.github.io/vega/docs/schemes/) for categorical data.
*/
category?: RangeScheme | string[];
/**
* Default [color scheme](https://vega.github.io/vega/docs/schemes/) for diverging quantitative ramps.
*/
diverging?: RangeScheme | string[];
/**
* Default [color scheme](https://vega.github.io/vega/docs/schemes/) for quantitative heatmaps.
*/
heatmap?: RangeScheme | string[];
/**
* Default [color scheme](https://vega.github.io/vega/docs/schemes/) for rank-ordered data.
*/
ordinal?: RangeScheme | string[];
/**
* Default [color scheme](https://vega.github.io/vega/docs/schemes/) for sequential quantitative ramps.
*/
ramp?: RangeScheme | string[];
/**
* Array of [symbol](https://vega.github.io/vega/docs/marks/symbol/) names or paths for the default shape palette.
*/
symbol?: SymbolShape[];
} & {
[name: string]: RangeScheme | number[] | boolean[] | string[] | SymbolShape[];
};

63
node_modules/vega-typings/types/spec/data.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import { OnTrigger, Transforms, SignalRef } from '.';
export type DataType = 'boolean' | 'number' | 'date' | 'string';
export type Parse =
| 'auto'
| {
[f: string]: DataType | string;
};
export interface FormatJSON {
type: 'json';
parse?: Parse;
property?: string | SignalRef;
copy?: boolean;
}
export interface FormatSV {
type: 'csv' | 'tsv';
header?: string[];
parse?: Parse;
}
export interface FormatDSV {
type: 'dsv';
header?: string[];
parse?: Parse;
delimiter: string;
}
export type FormatTopoJSON = {
type: 'topojson';
property?: string;
} & (
| {
feature: string;
}
| {
mesh: string;
filter: 'interior' | 'exterior' | null;
}
);
export type Format = FormatJSON | FormatSV | FormatDSV | FormatTopoJSON | { parse: Parse };
export interface BaseData {
name: string;
on?: OnTrigger[];
transform?: Transforms[];
}
export type SourceData = {
source: string | string[];
} & BaseData;
export type ValuesData = {
values: Datum[] | object;
format?: Format | SignalRef;
async?: boolean | SignalRef;
} & BaseData;
export type UrlData = {
url: string | SignalRef;
format?: Format | SignalRef;
async?: boolean | SignalRef;
} & BaseData;
export type Data = SourceData | ValuesData | UrlData | BaseData;
export type Datum = any;

459
node_modules/vega-typings/types/spec/encode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,459 @@
import { SignalRef } from '.';
import { Color } from './color';
import { Cursor, StrokeCap, StrokeJoin } from './config.d';
import { TitleAnchor } from './title';
export type Field = string | SignalRef | DatumFieldRef | GroupFieldRef | ParentFieldRef;
export interface DatumFieldRef {
datum: Field;
}
export interface GroupFieldRef {
group: Field;
level?: number;
}
export interface ParentFieldRef {
parent: Field;
level?: number;
}
export type BaseValueRef<T> =
| SignalRef
| {
value: T | null;
}
| {
field: Field;
};
export type ScaledValueRef<T> =
| BaseValueRef<T>
| {
scale: Field;
value: boolean | number | string | null;
}
| {
scale: Field;
field: Field;
}
| {
scale: Field;
band: boolean | number;
}
| {
scale: Field;
range: number | boolean;
};
export type NumericValueRef = (ScaledValueRef<number> | {}) & {
exponent?: number | NumericValueRef;
mult?: number | NumericValueRef;
offset?: number | NumericValueRef;
round?: boolean;
extra?: boolean;
};
export type StringValueRef = ScaledValueRef<string>;
export type SymbolShapeValueRef = ScaledValueRef<SymbolShape>;
export type FontWeightValueRef = ScaledValueRef<FontWeight>;
export type FontStyleValueRef = ScaledValueRef<FontStyle>;
export type AlignValueRef = ScaledValueRef<Align>;
export type StrokeCapValueRef = ScaledValueRef<StrokeCap>;
export type AnchorValueRef = ScaledValueRef<TitleAnchor>;
export type OrientValueRef = ScaledValueRef<Orient>;
export type TextBaselineValueRef = ScaledValueRef<TextBaseline>;
export type TextValueRef = ScaledValueRef<Text>;
export type BooleanValueRef = ScaledValueRef<boolean>;
export type ArrayValueRef = ScaledValueRef<any[]>;
export type ArbitraryValueRef = NumericValueRef | ColorValueRef | ScaledValueRef<any>;
export interface ColorRGB {
r: NumericValueRef;
g: NumericValueRef;
b: NumericValueRef;
}
export interface ColorHSL {
h: NumericValueRef;
s: NumericValueRef;
l: NumericValueRef;
}
export interface ColorLAB {
l: NumericValueRef;
a: NumericValueRef;
b: NumericValueRef;
}
export interface ColorHCL {
h: NumericValueRef;
c: NumericValueRef;
l: NumericValueRef;
}
export interface BaseGradient {
/**
* The type of gradient.
*/
gradient: 'linear' | 'radial';
}
export interface GradientStop {
/**
* The offset fraction for the color stop, indicating its position within the gradient.
*/
offset: number;
/**
* The color value at this point in the gradient.
*/
color: Color;
}
export type Gradient = LinearGradient | RadialGradient;
export interface LinearGradient extends BaseGradient {
/**
* The type of gradient. Use `"linear"` for a linear gradient.
*/
gradient: 'linear';
/**
* An array of gradient stops defining the gradient color sequence.
*/
stops: GradientStop[];
id?: string;
/**
* The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.
*
* __Default value:__ `0`
*/
x1?: number;
/**
* The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.
*
* __Default value:__ `0`
*/
y1?: number;
/**
* The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.
*
* __Default value:__ `1`
*/
x2?: number;
/**
* The ending y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.
*
* __Default value:__ `0`
*/
y2?: number;
}
export interface RadialGradient extends BaseGradient {
/**
* The type of gradient. Use `"radial"` for a radial gradient.
*/
gradient: 'radial';
/**
* An array of gradient stops defining the gradient color sequence.
*/
stops: GradientStop[];
id?: string;
/**
* The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.
*
* __Default value:__ `0.5`
*/
x1?: number;
/**
* The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.
*
* __Default value:__ `0.5`
*/
y1?: number;
/**
* The radius length, in normalized [0, 1] coordinates, of the inner circle for the gradient.
*
* __Default value:__ `0`
*/
r1?: number;
/**
* The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.
*
* __Default value:__ `0.5`
*/
x2?: number;
/**
* The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.
*
* __Default value:__ `0.5`
*/
y2?: number;
/**
* The radius length, in normalized [0, 1] coordinates, of the outer circle for the gradient.
*
* __Default value:__ `0.5`
*/
r2?: number;
}
export type ColorValueRef =
| ScaledValueRef<Color>
| { value: LinearGradient | RadialGradient }
| {
gradient: Field;
start?: number[];
stop?: number[];
count?: number;
}
| {
color: ColorRGB | ColorHSL | ColorLAB | ColorHCL;
};
export type ProductionRule<T> =
| T
| ({
test?: string;
} & T)[];
export type Blend =
| null
| 'multiply'
| 'screen'
| 'overlay'
| 'darken'
| 'lighten'
| 'color-dodge'
| 'color-burn'
| 'hard-light'
| 'soft-light'
| 'difference'
| 'exclusion'
| 'hue'
| 'saturation'
| 'color'
| 'luminosity';
export interface EncodeEntry {
x?: ProductionRule<NumericValueRef>;
x2?: ProductionRule<NumericValueRef>;
xc?: ProductionRule<NumericValueRef>;
width?: ProductionRule<NumericValueRef>;
y?: ProductionRule<NumericValueRef>;
y2?: ProductionRule<NumericValueRef>;
yc?: ProductionRule<NumericValueRef>;
height?: ProductionRule<NumericValueRef>;
opacity?: ProductionRule<NumericValueRef>;
fill?: ProductionRule<ColorValueRef>;
fillOpacity?: ProductionRule<NumericValueRef>;
stroke?: ProductionRule<ColorValueRef>;
strokeWidth?: ProductionRule<NumericValueRef>;
strokeOpacity?: ProductionRule<NumericValueRef>;
strokeDash?: ProductionRule<ScaledValueRef<number[]>>;
strokeDashOffset?: ProductionRule<NumericValueRef>;
strokeCap?: ProductionRule<ScaledValueRef<StrokeCap>>;
strokeJoin?: ProductionRule<ScaledValueRef<StrokeJoin>>;
strokeMiterLimit?: ProductionRule<NumericValueRef>;
blend?: ProductionRule<ScaledValueRef<Blend>>;
cursor?: ProductionRule<ScaledValueRef<Cursor>>;
tooltip?: ProductionRule<StringValueRef>;
zindex?: ProductionRule<NumericValueRef>;
/**
* A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only).
* If `false`, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.
*/
aria?: ProductionRule<BooleanValueRef>;
/**
* Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the "role" attribute.
* Warning: this property is experimental and may be changed in the future.
*/
ariaRole?: ProductionRule<StringValueRef>;
/**
* A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the "aria-roledescription" attribute.
* Warning: this property is experimental and may be changed in the future.
*/
ariaRoleDescription?: ProductionRule<StringValueRef>;
/**
* A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If specified, this property determines the ["aria-label" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).
*/
description?: ProductionRule<StringValueRef>;
[k: string]: ProductionRule<ArbitraryValueRef> | undefined;
}
export type Align = 'left' | 'center' | 'right';
export interface AlignProperty {
align?: ProductionRule<ScaledValueRef<Align>>;
}
export type Orient = 'left' | 'right' | 'top' | 'bottom';
export interface DefinedProperty {
defined?: ProductionRule<BooleanValueRef>;
}
export interface ThetaProperty {
theta?: ProductionRule<NumericValueRef>;
}
export interface ArcEncodeEntry extends EncodeEntry {
startAngle?: ProductionRule<NumericValueRef>;
endAngle?: ProductionRule<NumericValueRef>;
padAngle?: ProductionRule<NumericValueRef>;
innerRadius?: ProductionRule<NumericValueRef>;
outerRadius?: ProductionRule<NumericValueRef>;
cornerRadius?: ProductionRule<NumericValueRef>;
}
export type Orientation = 'horizontal' | 'vertical';
export interface AreaEncodeEntry extends LineEncodeEntry {
orient?: ProductionRule<ScaledValueRef<Orientation>>;
}
export interface GroupEncodeEntry extends RectEncodeEntry {
clip?: ProductionRule<BooleanValueRef>;
strokeForeground?: ProductionRule<BooleanValueRef>;
strokeOffset?: ProductionRule<NumericValueRef>;
}
export type Baseline = 'top' | 'middle' | 'bottom';
export interface ImageEncodeEntry extends EncodeEntry, AlignProperty {
url?: ProductionRule<StringValueRef>;
aspect?: ProductionRule<BooleanValueRef>;
baseline?: ProductionRule<ScaledValueRef<Baseline>>;
smooth?: ProductionRule<BooleanValueRef>;
}
/**
* @TJS-type integer
* @minimum 100
* @maximum 900
*/
export type Interpolate =
| 'basis'
| 'basis-open'
| 'basis-closed'
| 'bundle'
| 'cardinal'
| 'cardinal-open'
| 'cardinal-closed'
| 'catmull-rom'
| 'linear'
| 'linear-closed'
| 'monotone'
| 'natural'
| 'step'
| 'step-before'
| 'step-after';
export interface LineEncodeEntry extends EncodeEntry, DefinedProperty {
interpolate?: ProductionRule<ScaledValueRef<Interpolate>>;
tension?: ProductionRule<NumericValueRef>;
}
export interface PathEncodeEntry extends EncodeEntry {
path?: ProductionRule<StringValueRef>;
angle?: ProductionRule<NumericValueRef>;
scaleX?: ProductionRule<NumericValueRef>;
scaleY?: ProductionRule<NumericValueRef>;
}
export interface RectEncodeEntry extends EncodeEntry {
cornerRadius?: ProductionRule<NumericValueRef>;
cornerRadiusTopLeft?: ProductionRule<NumericValueRef>;
cornerRadiusTopRight?: ProductionRule<NumericValueRef>;
cornerRadiusBottomRight?: ProductionRule<NumericValueRef>;
cornerRadiusBottomLeft?: ProductionRule<NumericValueRef>;
}
export type RuleEncodeEntry = EncodeEntry;
export interface ShapeEncodeEntry extends EncodeEntry {
shape?: ProductionRule<StringValueRef>;
}
export type SymbolShape =
| 'circle'
| 'square'
| 'cross'
| 'diamond'
| 'triangle-up'
| 'triangle-down'
| 'triangle-right'
| 'triangle-left'
| 'arrow'
| 'triangle'
| 'wedge'
| 'stroke'
| string;
export interface SymbolEncodeEntry extends EncodeEntry {
size?: ProductionRule<NumericValueRef>;
shape?: ProductionRule<ScaledValueRef<SymbolShape>>;
angle?: ProductionRule<NumericValueRef>;
}
export type Text = string | string[];
export type TextBaseline = 'alphabetic' | Baseline | 'line-top' | 'line-bottom';
export type TextDirection = 'ltr' | 'rtl';
export type FontWeight =
| 'normal'
| 'bold'
| 'lighter'
| 'bolder'
| 100
| 200
| 300
| 400
| 500
| 600
| 700
| 800
| 900;
// see https://developer.mozilla.org/en-US/docs/Web/CSS/font-style#Values
export type FontStyle = 'normal' | 'italic' | 'oblique' | string;
export interface TextEncodeEntry extends EncodeEntry, AlignProperty, ThetaProperty {
text?: ProductionRule<TextValueRef>;
angle?: ProductionRule<NumericValueRef>;
baseline?: ProductionRule<TextBaselineValueRef>;
dir?: ProductionRule<ScaledValueRef<TextDirection>>;
dx?: ProductionRule<NumericValueRef>;
dy?: ProductionRule<NumericValueRef>;
ellipsis?: ProductionRule<StringValueRef>;
font?: ProductionRule<StringValueRef>;
fontSize?: ProductionRule<NumericValueRef>;
fontWeight?: ProductionRule<FontWeightValueRef>;
fontStyle?: ProductionRule<FontStyleValueRef>;
limit?: ProductionRule<NumericValueRef>;
lineBreak?: ProductionRule<StringValueRef>;
/**
* The height, in pixels, of each line of text in a multi-line text mark or a text mark with `"line-top"` or `"line-bottom"` baseline.
*/
lineHeight?: ProductionRule<NumericValueRef>;
radius?: ProductionRule<NumericValueRef>;
}
export interface TrailEncodeEntry extends EncodeEntry, DefinedProperty {}
export interface Encodable<T> {
encode?: Encode<T>;
}
export type Encode<T> = Partial<Record<EncodeEntryName, T>>;
export type EncodeEntryName =
| 'enter'
| 'update'
| 'exit'
| 'hover'
| 'leave'
| 'select'
| 'release';

4
node_modules/vega-typings/types/spec/expr.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type Expr = string;
export interface ExprRef {
expr: Expr;
}

47
node_modules/vega-typings/types/spec/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
import { AutoSize } from './autosize';
import { Color } from './color';
import { Config } from './config';
import { Encodable, EncodeEntry } from './encode';
import { Padding } from './padding';
import { Scope } from './scope';
import { SignalRef } from './signal';
export interface Spec extends Scope, Encodable<EncodeEntry> {
$schema?: string;
config?: Config;
description?: string;
width?: number | SignalRef;
height?: number | SignalRef;
padding?: Padding | SignalRef;
autosize?: AutoSize | SignalRef;
background?: Color | SignalRef;
style?: string | string[];
}
export * from './autosize';
export * from './axis';
export * from './bind';
export * from './color';
export * from './config';
export * from './data';
export * from './encode';
export * from './expr';
export * from './layout';
export * from './legend';
export * from './locale';
export * from './mark';
export * from './marktype';
export * from './on-events';
export * from './on-trigger';
export * from './padding';
export * from './projection';
export * from './scale';
export * from './scheme';
export * from './scope';
export * from './selector';
export * from './signal';
export * from './stream';
export * from './title';
export * from './transform';
export * from './util';
export * from './values';

37
node_modules/vega-typings/types/spec/layout.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import { SignalRef } from '.';
export type LayoutAlign = 'all' | 'each' | 'none';
export type LayoutTitleAnchor = 'start' | 'end';
export type LayoutBounds = 'full' | 'flush' | SignalRef;
export type LayoutOffset =
| number
| SignalRef
| {
rowHeader?: number | SignalRef;
rowFooter?: number | SignalRef;
rowTitle?: number | SignalRef;
columnHeader?: number | SignalRef;
columnFooter?: number | SignalRef;
columnTitle?: number | SignalRef;
};
export interface RowColumn<T> {
row?: T | SignalRef;
column?: T | SignalRef;
}
export interface LayoutParams {
align?: LayoutAlign | SignalRef | RowColumn<LayoutAlign>;
bounds?: LayoutBounds;
columns?: number | SignalRef;
padding?: number | SignalRef | RowColumn<number>;
offset?: LayoutOffset;
headerBand?: number | SignalRef | RowColumn<number>;
footerBand?: number | SignalRef | RowColumn<number>;
titleAnchor?: LayoutTitleAnchor | SignalRef | RowColumn<LayoutTitleAnchor>;
titleBand?: number | SignalRef | RowColumn<number>;
}
export type Layout = SignalRef | LayoutParams;

483
node_modules/vega-typings/types/spec/legend.d.ts generated vendored Normal file
View File

@@ -0,0 +1,483 @@
import {
GroupEncodeEntry,
Orientation,
RectEncodeEntry,
SignalRef,
SymbolEncodeEntry,
TextEncodeEntry,
} from '.';
import { FormatType, LabelOverlap, TickCount, TimeFormatSpecifier } from './axis';
import { Text } from './encode';
import { LayoutAlign } from './layout';
import {
AlignValue,
AnchorValue,
BooleanValue,
ColorValue,
DashArrayValue,
FontStyleValue,
FontWeightValue,
NumberValue,
OrientValue,
StringValue,
SymbolShapeValue,
TextBaselineValue,
} from './values';
export interface GuideEncodeEntry<T> {
name?: string;
/**
* A boolean flag indicating if the guide element should respond to input events such as mouse hover.
*/
interactive?: boolean;
/**
* A mark style property to apply to the guide group mark.
*/
style?: string | string[];
enter?: T;
update?: T;
exit?: T;
hover?: T;
}
export type LegendType = 'gradient' | 'symbol';
export type LegendOrient =
| 'none'
| 'left'
| 'right'
| 'top'
| 'bottom'
| 'top-left'
| 'top-right'
| 'bottom-left'
| 'bottom-right';
export interface Legend extends BaseLegend {
size?: string;
shape?: string;
fill?: string;
stroke?: string;
strokeDash?: string;
strokeWidth?: string;
opacity?: string;
/**
* The type of legend to include. One of `"symbol"` for discrete symbol legends, or `"gradient"` for a continuous color gradient. If gradient is used only the fill or stroke scale parameters are considered. If unspecified, the type will be inferred based on the scale parameters used and their backing scale types.
*/
type?: LegendType;
/**
* The direction of the legend, one of `"vertical"` (default) or `"horizontal"`.
*
* __Default value:__ `"vertical"`
*/
direction?: Orientation;
/**
* The format specifier pattern for legend labels. For numerical values, must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier. For date-time values, must be a legal [d3-time-format](https://github.com/d3/d3-time-format#locale_format) specifier or multi-format object.
*/
format?: string | TimeFormatSpecifier | SignalRef;
/**
* The format type for legend labels (number, time, or utc).
*/
formatType?: FormatType | SignalRef;
/**
* The title for the legend.
*/
title?: Text | SignalRef;
/**
* The minimum desired step between tick values for quantitative legends, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.
*/
tickMinStep?: number | SignalRef;
/**
* Explicitly set the visible legend values.
*/
values?: any[] | SignalRef;
/**
* Mark definitions for custom legend encoding.
*/
encode?: LegendEncode;
}
export interface LegendEncode {
title?: GuideEncodeEntry<TextEncodeEntry>;
labels?: GuideEncodeEntry<TextEncodeEntry>;
legend?: GuideEncodeEntry<GroupEncodeEntry>;
entries?: GuideEncodeEntry<GroupEncodeEntry>;
symbols?: GuideEncodeEntry<SymbolEncodeEntry>;
gradient?: GuideEncodeEntry<RectEncodeEntry>;
}
/**
* Properties shared between legends and legend configs.
*/
export interface BaseLegend {
/**
* The orientation of the legend, which determines how the legend is positioned within the scene. One of "left", "right", "top-left", "top-right", "bottom-left", "bottom-right", "none".
*
* __Default value:__ `"right"`
*/
orient?: LegendOrient | SignalRef;
/**
* The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.
*/
symbolLimit?: NumberValue;
/**
* The desired number of tick values for quantitative legends.
*/
tickCount?: TickCount;
// ---------- ARIA ----------
/**
* A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only).
* If `false`, the "aria-hidden" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree.
*
* __Default value:__ `true`
*/
aria?: boolean;
/**
* A text description of this legend for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only).
* If the `aria` property is true, for SVG output the ["aria-label" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description.
* If the description is unspecified it will be automatically generated.
*/
description?: string;
// ---------- Legend Group ----------
/**
* Corner radius for the full legend.
*/
cornerRadius?: NumberValue;
/**
* Background fill color for the full legend.
*/
fillColor?: ColorValue;
/**
* The offset in pixels by which to displace the legend from the data rectangle and axes.
*
* __Default value:__ `18`.
*/
offset?: NumberValue;
/**
* The padding between the border and content of the legend group.
*
* __Default value:__ `0`.
*/
padding?: NumberValue;
/**
* Border stroke color for the full legend.
*/
strokeColor?: ColorValue;
/**
* Custom x-position for legend with orient "none".
*/
legendX?: NumberValue;
/**
* Custom y-position for legend with orient "none".
*/
legendY?: NumberValue;
// ---------- Title ----------
/**
* Horizontal text alignment for legend titles.
*
* __Default value:__ `"left"`.
*/
titleAlign?: AlignValue;
/**
* Text anchor position for placing legend titles.
*/
titleAnchor?: AnchorValue;
/**
* Vertical text baseline for legend titles. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`, `"line-top"`, or `"line-bottom"`. The `"line-top"` and `"line-bottom"` values operate similarly to `"top"` and `"bottom"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.
*
* __Default value:__ `"top"`.
*/
titleBaseline?: TextBaselineValue;
/**
* The color of the legend title, can be in hex color code or regular color name.
*/
titleColor?: ColorValue;
/**
* The font of the legend title.
*/
titleFont?: StringValue;
/**
* The font size of the legend title.
*/
titleFontSize?: NumberValue;
/**
* The font style of the legend title.
*/
titleFontStyle?: FontStyleValue;
/**
* The font weight of the legend title.
* This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
*/
titleFontWeight?: FontWeightValue;
/**
* Maximum allowed pixel width of legend titles.
*
* __Default value:__ `180`.
* @minimum 0
*/
titleLimit?: NumberValue;
/**
* Line height in pixels for multi-line title text or title text with `"line-top"` or `"line-bottom"` baseline.
*/
titleLineHeight?: NumberValue;
/**
* Opacity of the legend title.
*/
titleOpacity?: NumberValue;
/**
* Orientation of the legend title.
*/
titleOrient?: OrientValue;
/**
* The padding, in pixels, between title and legend.
*
* __Default value:__ `5`.
*/
titlePadding?: NumberValue;
// ---------- Gradient ----------
/**
* The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.
*
* __Default value:__ `200`.
* @minimum 0
*/
gradientLength?: number | SignalRef;
/**
* Opacity of the color gradient.
*/
gradientOpacity?: NumberValue;
/**
* The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.
*
* __Default value:__ `16`.
* @minimum 0
*/
gradientThickness?: number | SignalRef;
/**
* The color of the gradient stroke, can be in hex color code or regular color name.
*
* __Default value:__ `"lightGray"`.
*/
gradientStrokeColor?: ColorValue;
/**
* The width of the gradient stroke, in pixels.
*
* __Default value:__ `0`.
* @minimum 0
*/
gradientStrokeWidth?: NumberValue;
// ---------- Symbol Layout ----------
/**
* The height in pixels to clip symbol legend entries and limit their size.
*/
clipHeight?: number | SignalRef;
/**
* The number of columns in which to arrange symbol legend entries. A value of `0` or lower indicates a single row with one column per entry.
*/
columns?: number | SignalRef;
/**
* The horizontal padding in pixels between symbol legend entries.
*
* __Default value:__ `10`.
*/
columnPadding?: number | SignalRef;
/**
* The vertical padding in pixels between symbol legend entries.
*
* __Default value:__ `2`.
*/
rowPadding?: number | SignalRef;
/**
* The alignment to apply to symbol legends rows and columns. The supported string values are `"all"`, `"each"` (the default), and `none`. For more information, see the [grid layout documentation](https://vega.github.io/vega/docs/layout).
*
* __Default value:__ `"each"`.
*/
gridAlign?: LayoutAlign | SignalRef;
// ---------- Symbols ----------
/**
* An array of alternating [stroke, space] lengths for dashed symbol strokes.
*/
symbolDash?: DashArrayValue;
/**
* The pixel offset at which to start drawing with the symbol stroke dash array.
*/
symbolDashOffset?: NumberValue;
/**
* The color of the legend symbol,
*/
symbolFillColor?: ColorValue;
/**
* Horizontal pixel offset for legend symbols.
*
* __Default value:__ `0`.
*/
symbolOffset?: NumberValue;
/**
* Opacity of the legend symbols.
*/
symbolOpacity?: NumberValue;
/**
* The size of the legend symbol, in pixels.
*
* __Default value:__ `100`.
* @minimum 0
*/
symbolSize?: NumberValue;
/**
* Stroke color for legend symbols.
*/
symbolStrokeColor?: ColorValue;
/**
* The width of the symbol's stroke.
*
* __Default value:__ `1.5`.
* @minimum 0
*/
symbolStrokeWidth?: NumberValue;
/**
* The symbol shape. One of the plotting shapes `circle` (default), `square`, `cross`, `diamond`, `triangle-up`, `triangle-down`, `triangle-right`, or `triangle-left`, the line symbol `stroke`, or one of the centered directional shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.
*
* __Default value:__ `"circle"`.
*/
symbolType?: SymbolShapeValue | SignalRef;
// ---------- Label ----------
/**
* The alignment of the legend label, can be left, center, or right.
*/
labelAlign?: AlignValue;
/**
* The position of the baseline of legend label, can be `"top"`, `"middle"`, `"bottom"`, or `"alphabetic"`.
*
* __Default value:__ `"middle"`.
*/
labelBaseline?: TextBaselineValue;
/**
* The color of the legend label, can be in hex color code or regular color name.
*/
labelColor?: ColorValue;
/**
* The font of the legend label.
*/
labelFont?: StringValue;
/**
* The font size of legend label.
*
* __Default value:__ `10`.
*
* @minimum 0
*/
labelFontSize?: NumberValue;
/**
* The font style of legend label.
*/
labelFontStyle?: FontStyleValue;
/**
* The font weight of legend label.
*/
labelFontWeight?: FontWeightValue;
/**
* Maximum allowed pixel width of legend tick labels.
*
* __Default value:__ `160`.
*/
labelLimit?: NumberValue;
/**
* Opacity of labels.
*/
labelOpacity?: NumberValue;
/**
* Padding in pixels between the legend and legend labels.
*/
labelPadding?: NumberValue;
/**
* The offset of the legend label.
* @minimum 0
*
* __Default value:__ `4`.
*/
labelOffset?: NumberValue;
/**
* The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` (default) or `"parity"`, a strategy of removing every other label is used. If set to `"greedy"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).
*
* __Default value:__ `true`.
*/
labelOverlap?: LabelOverlap | SignalRef;
/**
* The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.
*/
labelSeparation?: number | SignalRef;
/**
* The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.
*
* @TJS-type integer
* @minimum 0
*/
zindex?: number;
}

82
node_modules/vega-typings/types/spec/locale.d.ts generated vendored Normal file
View File

@@ -0,0 +1,82 @@
import { Vector2, Vector7, Vector10, Vector12 } from '.';
export interface Locale {
number?: NumberLocale;
time?: TimeLocale;
}
/**
* Locale definition for formatting numbers.
*/
export interface NumberLocale {
/**
* The decimal point (e.g., ".").
*/
decimal: string;
/**
* The group separator (e.g., ",").
*/
thousands: string;
/**
* The array of group sizes (e.g., [3]), cycled as needed.
*/
grouping: number[];
/**
* The currency prefix and suffix (e.g., ["$", ""]).
*/
currency: Vector2<string>;
/**
* An array of ten strings to replace the numerals 0-9.
*/
numerals?: Vector10<string>;
/**
* The percent sign (defaults to "%").
*/
percent?: string;
/**
* The minus sign (defaults to hyphen-minus, "-").
*/
minus?: string;
/**
* The not-a-number value (defaults to "NaN").
*/
nan?: string;
}
/**
* Locale definition for formatting dates and times.
*/
export interface TimeLocale {
/**
* The date and time (%c) format specifier (e.g., "%a %b %e %X %Y").
*/
dateTime: string;
/**
* The date (%x) format specifier (e.g., "%m/%d/%Y").
*/
date: string;
/**
* The time (%X) format specifier (e.g., "%H:%M:%S").
*/
time: string;
/**
* The A.M. and P.M. equivalents (e.g., ["AM", "PM"]).
*/
periods: Vector2<string>;
/**
* The full names of the weekdays, starting with Sunday.
*/
days: Vector7<string>;
/**
* The abbreviated names of the weekdays, starting with Sunday.
*/
shortDays: Vector7<string>;
/**
* The full names of the months (starting with January).
*/
months: Vector12<string>;
/**
* The abbreviated names of the months (starting with January).
*/
shortMonths: Vector12<string>;
}

111
node_modules/vega-typings/types/spec/mark.d.ts generated vendored Normal file
View File

@@ -0,0 +1,111 @@
import * as Encode from './encode';
import { ExprRef } from './expr';
import { SortOrder, Scope, SignalRef, Transforms, OnMarkTrigger } from '.';
export type Facet =
| {
name: string;
data: string;
field: string;
}
| {
name: string;
data: string;
groupby: string | string[];
aggregate?: {
cross?: boolean;
fields: string[];
ops: string[];
as: string[];
};
};
export interface From {
data?: string;
}
export type FromFacet =
| From
| (From & {
facet: Facet;
});
export type Clip =
| boolean
| {
path: string | SignalRef;
}
| {
sphere: string | SignalRef;
};
export type Compare =
| {
field: string | ExprRef | SignalRef;
order?: SortOrder;
}
| {
field: (string | ExprRef | SignalRef)[];
order?: SortOrder[];
};
export interface BaseMark {
role?: string;
name?: string;
description?: string;
aria?: boolean;
key?: string;
clip?: Clip;
sort?: Compare;
interactive?: boolean | SignalRef;
from?: From;
transform?: Transforms[];
zindex?: number;
on?: OnMarkTrigger[];
style?: string | string[];
}
export interface ArcMark extends BaseMark, Encode.Encodable<Encode.ArcEncodeEntry> {
type: 'arc';
}
export interface AreaMark extends BaseMark, Encode.Encodable<Encode.AreaEncodeEntry> {
type: 'area';
}
export interface ImageMark extends BaseMark, Encode.Encodable<Encode.ImageEncodeEntry> {
type: 'image';
}
export interface GroupMark extends BaseMark, Scope, Encode.Encodable<Encode.GroupEncodeEntry> {
type: 'group';
from?: FromFacet;
}
export interface LineMark extends BaseMark, Encode.Encodable<Encode.LineEncodeEntry> {
type: 'line';
}
export interface PathMark extends BaseMark, Encode.Encodable<Encode.PathEncodeEntry> {
type: 'path';
}
export interface RectMark extends BaseMark, Encode.Encodable<Encode.RectEncodeEntry> {
type: 'rect';
}
export interface RuleMark extends BaseMark, Encode.Encodable<Encode.RuleEncodeEntry> {
type: 'rule';
}
export interface ShapeMark extends BaseMark, Encode.Encodable<Encode.ShapeEncodeEntry> {
type: 'shape';
}
export interface SymbolMark extends BaseMark, Encode.Encodable<Encode.SymbolEncodeEntry> {
type: 'symbol';
}
export interface TextMark extends BaseMark, Encode.Encodable<Encode.TextEncodeEntry> {
type: 'text';
}
export interface TrailMark extends BaseMark, Encode.Encodable<Encode.TrailEncodeEntry> {
type: 'trail';
}
export type Mark =
| ArcMark
| AreaMark
| ImageMark
| GroupMark
| LineMark
| PathMark
| RectMark
| RuleMark
| ShapeMark
| SymbolMark
| TextMark
| TrailMark;

13
node_modules/vega-typings/types/spec/marktype.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export type MarkType =
| 'arc'
| 'area'
| 'image'
| 'group'
| 'line'
| 'path'
| 'rect'
| 'rule'
| 'shape'
| 'symbol'
| 'text'
| 'trail';

28
node_modules/vega-typings/types/spec/on-events.d.ts generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { Expr, ExprRef, EventSelector, SignalRef, SignalValue, Stream } from '.';
export type EventListener =
| SignalRef
| {
scale: string;
}
| Stream;
export type Events = EventSelector | EventListener;
export type Update =
| Expr
| ExprRef
| SignalRef
| {
value: SignalValue;
};
export type OnEvent = (
| {
encode: string;
}
| {
update: Update;
}
) & {
events: Events | EventListener[];
force?: boolean;
};

15
node_modules/vega-typings/types/spec/on-trigger.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import { Expr } from '.';
export interface OnTrigger {
trigger: Expr;
insert?: Expr;
remove?: boolean | Expr;
toggle?: Expr;
modify?: Expr;
values?: Expr;
}
export interface OnMarkTrigger {
trigger: Expr;
modify?: Expr;
values?: Expr;
}

8
node_modules/vega-typings/types/spec/padding.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export type Padding =
| number
| {
top?: number;
bottom?: number;
left?: number;
right?: number;
};

122
node_modules/vega-typings/types/spec/projection.d.ts generated vendored Normal file
View File

@@ -0,0 +1,122 @@
import { SignalRef, Vector2, Vector3 } from '.';
export type GeoJsonFeature = any; // TODO
export type GeoJsonFeatureCollection = any; // TODO
export type Fit = GeoJsonFeature | GeoJsonFeatureCollection | GeoJsonFeature[];
export type ProjectionType =
| 'albers'
| 'albersUsa'
| 'azimuthalEqualArea'
| 'azimuthalEquidistant'
| 'conicConformal'
| 'conicEqualArea'
| 'conicEquidistant'
| 'equalEarth'
| 'equirectangular'
| 'gnomonic'
| 'identity'
| 'mercator'
| 'naturalEarth1'
| 'orthographic'
| 'stereographic'
| 'transverseMercator';
export interface BaseProjection {
/*
* The cartographic projection to use. This value is case-insensitive, for example `"albers"` and `"Albers"` indicate the same projection type.
*
* __Default value:__ `mercator`
*/
type?: ProjectionType | SignalRef;
/**
* The projection's clipping circle radius to the specified angle in degrees. If `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather than small-circle clipping.
*/
clipAngle?: number | SignalRef;
/**
* The projection's viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no viewport clipping is performed.
*/
clipExtent?: Vector2<Vector2<number | SignalRef>> | SignalRef;
/**
* The projections scale factor. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections.
*/
scale?: number | SignalRef;
/*
* The projection's translation offset as a two-element array `[tx, ty]`, defaults to `[480, 250]`. The translation offset determines the pixel coordinates of the projection's center. The default translation offset places (0°,0°) at the center of a 960×500 area.
*/
translate?: Vector2<number | SignalRef> | SignalRef;
/**
* The projection's center, a two-element array of longitude and latitude in degrees.
*
* __Default value:__ `[0, 0]`
*/
center?: Vector2<number | SignalRef> | SignalRef;
/**
* The projection's three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)
*
* __Default value:__ `[0, 0, 0]`
*/
rotate?: Vector2<number | SignalRef> | Vector3<number | SignalRef> | SignalRef;
/**
* For conic projections, the [two standard parallels](https://en.wikipedia.org/wiki/Map_projection#Conic) that define the map layout. The default depends on the specific conic projection used.
*/
parallels?: (number | SignalRef)[] | SignalRef;
/**
* The default radius (in pixels) to use when drawing GeoJSON `Point` and `MultiPoint` geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms.
*
* __Default value:__ `4.5`
*/
pointRadius?: number | SignalRef;
/**
* The threshold for the projection's [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [DouglasPeucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection's current resampling precision which defaults to `√0.5 ≅ 0.70710…`.
*/
precision?: number | SignalRef;
/*
* GeoJSON data to which the projection should attempt to automatically fit the `translate` and `scale` parameters. If object-valued, this parameter should be a GeoJSON Feature or FeatureCollection. If array-valued, each array member may be a GeoJSON Feature, FeatureCollection, or a sub-array of GeoJSON Features.
*/
fit?: Fit | Fit[] | SignalRef;
/*
* Used in conjunction with fit, provides the pixel area to which the projection should be automatically fit.
*/
extent?: Vector2<Vector2<number | SignalRef>> | SignalRef;
/*
* Used in conjunction with fit, provides the width and height in pixels of the area to which the projection should be automatically fit.
*/
size?: Vector2<number | SignalRef> | SignalRef;
// TODO: use a union tagged by the projection type to determine which of the following is applicable
/* The following properties are all supported for specific types of projections. Consult the d3-geo-projection library for more information: https://github.com/d3/d3-geo-projection */
coefficient?: number | SignalRef;
distance?: number | SignalRef;
fraction?: number | SignalRef;
lobes?: number | SignalRef;
parallel?: number | SignalRef;
radius?: number | SignalRef;
ratio?: number | SignalRef;
spacing?: number | SignalRef;
tilt?: number | SignalRef;
/*
* Sets whether or not the x-dimension is reflected (negated) in the output.
*/
reflectX?: boolean | SignalRef;
/*
* Sets whether or not the y-dimension is reflected (negated) in the output.
*/
reflectY?: boolean | SignalRef;
}
export interface Projection extends BaseProjection {
/*
* The name of the projection.
*/
name: string;
}

260
node_modules/vega-typings/types/spec/scale.d.ts generated vendored Normal file
View File

@@ -0,0 +1,260 @@
import { SignalRef } from '.';
import { ColorScheme } from './scheme';
export type RangeEnum =
| 'width'
| 'height'
| 'symbol'
| 'category'
| 'ordinal'
| 'ramp'
| 'diverging'
| 'heatmap';
export type RangeRawArray = (number | SignalRef)[];
export type RangeRaw = (null | boolean | string | number | SignalRef | RangeRawArray)[];
export type RangeScheme =
| RangeEnum
| RangeRaw
| SignalRef
| {
scheme: string | string[] | SignalRef | ColorScheme;
count?: number | SignalRef;
extent?: (number | SignalRef)[] | SignalRef;
};
export type RangeBand =
| RangeEnum
| RangeRaw
| {
step: number | SignalRef;
};
export type SortOrder = 'ascending' | 'descending' | SignalRef;
export type SortField =
| boolean
| {
order: SortOrder;
}
| {
field?: ScaleField;
op: ScaleField;
order?: SortOrder;
};
/**
* Unioned domains can only be sorted by count, min, or max aggregates.
*/
export type UnionSortField =
| boolean
| {
op: 'count';
order?: SortOrder;
}
| {
field: ScaleField;
op: 'count' | 'min' | 'max';
order?: SortOrder;
};
export type ScaleField = string | SignalRef;
export interface ScaleBinParams {
/**
* The step size defining the bin interval width.
*/
step: number | SignalRef;
/**
* The starting (lowest-valued) bin boundary.
*
* __Default value:__ The lowest value of the scale domain will be used.
*/
start?: number | SignalRef;
/**
* The stopping (highest-valued) bin boundary.
*
* __Default value:__ The highest value of the scale domain will be used.
*
*/
stop?: number | SignalRef;
}
export type ScaleBins = (number | SignalRef)[] | SignalRef | ScaleBinParams;
export type ScaleInterpolateEnum =
| 'rgb'
| 'lab'
| 'hcl'
| 'hsl'
| 'hsl-long'
| 'hcl-long'
| 'cubehelix'
| 'cubehelix-long';
export interface ScaleInterpolateParams {
type: 'rgb' | 'cubehelix' | 'cubehelix-long' | SignalRef;
gamma?: number | SignalRef;
}
export type ScaleInterpolate = ScaleInterpolateEnum | SignalRef | ScaleInterpolateParams;
export interface ScaleDataRef {
data: string;
field: ScaleField;
}
export interface ScaleMultiDataRef {
fields: ((string | number | boolean)[] | ScaleDataRef | SignalRef)[];
}
export interface ScaleMultiFieldsRef {
data: string;
fields: ScaleField[];
}
export type ScaleData = (ScaleDataRef | ScaleMultiDataRef | ScaleMultiFieldsRef) & {
sort?: SortField;
};
export type QuantScaleType =
| 'linear'
| 'pow'
| 'sqrt'
| 'log'
| 'symlog'
| 'time'
| 'utc'
| 'sequential';
export type DiscreteScaleType = 'ordinal' | 'band' | 'point';
export type DiscretizingScaleType = 'quantile' | 'quantize' | 'threshold' | 'bin-ordinal';
export type ScaleType = QuantScaleType | DiscreteScaleType | DiscretizingScaleType | 'identity';
export interface BaseScale {
name: string;
type?: ScaleType;
domain?: (null | string | number | boolean | SignalRef)[] | ScaleData | SignalRef;
domainMin?: number | SignalRef;
domainMax?: number | SignalRef;
domainMid?: number | SignalRef;
domainRaw?: null | any[] | SignalRef;
reverse?: boolean | SignalRef;
round?: boolean | SignalRef;
}
export interface ContinuousScale extends BaseScale {
range?: RangeScheme;
bins?: ScaleBins;
interpolate?: ScaleInterpolate;
clamp?: boolean | SignalRef;
padding?: number | SignalRef;
}
export interface NumericScale extends ContinuousScale {
nice?: boolean | number | SignalRef;
zero?: boolean | SignalRef;
}
export interface BaseBandScale extends BaseScale {
range?: RangeBand;
padding?: number | SignalRef;
paddingOuter?: number | SignalRef;
align?: number | SignalRef;
}
// concrete scales
export interface OrdinalScale extends BaseScale {
type: 'ordinal';
range?: RangeScheme | ScaleData;
interpolate?: ScaleInterpolate;
domainImplicit?: boolean | SignalRef;
}
export interface BandScale extends BaseBandScale {
type: 'band';
paddingInner?: number | SignalRef;
}
export interface PointScale extends BaseBandScale {
type: 'point';
}
// note: deprecated
export interface SequentialScale extends NumericScale {
type: 'sequential';
}
export type TimeInterval =
| 'millisecond'
| 'second'
| 'minute'
| 'hour'
| 'day'
| 'week'
| 'month'
| 'year';
export interface TimeIntervalStep {
interval: TimeInterval;
step: number;
}
export interface TimeScale extends ContinuousScale {
type: 'time' | 'utc';
nice?: boolean | TimeInterval | TimeIntervalStep | SignalRef;
}
export interface IdentityScale extends BaseScale {
type: 'identity';
nice?: boolean | SignalRef;
}
export interface LinearScale extends NumericScale {
type?: 'linear'; // optional because it's the default
}
export interface LogScale extends ContinuousScale {
type: 'log';
base?: number | SignalRef;
nice?: boolean | number | SignalRef;
zero?: false; // zero has to be false or undefined
}
export interface SymLogScale extends NumericScale {
type: 'symlog';
constant?: number | SignalRef;
}
export interface PowScale extends NumericScale {
type: 'pow';
exponent: number | SignalRef;
}
export interface SqrtScale extends NumericScale {
type: 'sqrt';
}
export interface QuantizeScale extends BaseScale {
type?: 'quantize';
range?: RangeScheme;
padding?: number | SignalRef;
nice?: boolean | number | SignalRef;
zero?: boolean | SignalRef;
}
export interface ThresholdScale extends BaseScale {
type?: 'threshold';
range?: RangeScheme;
padding?: number | SignalRef;
nice?: boolean | number | SignalRef;
zero?: boolean | SignalRef;
}
export interface QuantileScale extends BaseScale {
type?: 'quantile';
range?: RangeScheme;
interpolate?: ScaleInterpolate;
}
export interface BinOrdinalScale extends BaseScale {
type: 'bin-ordinal';
bins?: ScaleBins;
range?: RangeScheme | ScaleData;
interpolate?: ScaleInterpolate;
}
export type Scale =
| OrdinalScale
| BandScale
| PointScale
| SequentialScale
| TimeScale
| IdentityScale
| LinearScale
| LogScale
| SymLogScale
| PowScale
| SqrtScale
| QuantileScale
| QuantizeScale
| ThresholdScale
| BinOrdinalScale;

344
node_modules/vega-typings/types/spec/scheme.d.ts generated vendored Normal file
View File

@@ -0,0 +1,344 @@
export type Categorical =
| 'accent'
| 'category10'
| 'category20'
| 'category20b'
| 'category20c'
| 'dark2'
| 'paired'
| 'pastel1'
| 'pastel2'
| 'set1'
| 'set2'
| 'set3'
| 'tableau10'
| 'tableau20';
export type SequentialSingleHue =
| 'blues'
| 'tealblues'
| 'teals'
| 'greens'
| 'browns'
| 'greys'
| 'purples'
| 'warmgreys'
| 'reds'
| 'oranges';
export type SequentialMultiHue =
| 'viridis'
| 'inferno'
| 'magma'
| 'plasma'
| 'bluegreen'
| 'bluegreen-3'
| 'bluegreen-4'
| 'bluegreen-5'
| 'bluegreen-6'
| 'bluegreen-7'
| 'bluegreen-8'
| 'bluegreen-9'
| 'bluepurple'
| 'bluepurple-3'
| 'bluepurple-4'
| 'bluepurple-5'
| 'bluepurple-6'
| 'bluepurple-7'
| 'bluepurple-8'
| 'bluepurple-9'
| 'goldgreen'
| 'goldgreen-3'
| 'goldgreen-4'
| 'goldgreen-5'
| 'goldgreen-6'
| 'goldgreen-7'
| 'goldgreen-8'
| 'goldgreen-9'
| 'goldorange'
| 'goldorange-3'
| 'goldorange-4'
| 'goldorange-5'
| 'goldorange-6'
| 'goldorange-7'
| 'goldorange-8'
| 'goldorange-9'
| 'goldred'
| 'goldred-3'
| 'goldred-4'
| 'goldred-5'
| 'goldred-6'
| 'goldred-7'
| 'goldred-8'
| 'goldred-9'
| 'greenblue'
| 'greenblue-3'
| 'greenblue-4'
| 'greenblue-5'
| 'greenblue-6'
| 'greenblue-7'
| 'greenblue-8'
| 'greenblue-9'
| 'orangered'
| 'orangered-3'
| 'orangered-4'
| 'orangered-5'
| 'orangered-6'
| 'orangered-7'
| 'orangered-8'
| 'orangered-9'
| 'purplebluegreen'
| 'purplebluegreen-3'
| 'purplebluegreen-4'
| 'purplebluegreen-5'
| 'purplebluegreen-6'
| 'purplebluegreen-7'
| 'purplebluegreen-8'
| 'purplebluegreen-9'
| 'purpleblue'
| 'purpleblue-3'
| 'purpleblue-4'
| 'purpleblue-5'
| 'purpleblue-6'
| 'purpleblue-7'
| 'purpleblue-8'
| 'purpleblue-9'
| 'purplered'
| 'purplered-3'
| 'purplered-4'
| 'purplered-5'
| 'purplered-6'
| 'purplered-7'
| 'purplered-8'
| 'purplered-9'
| 'redpurple'
| 'redpurple-3'
| 'redpurple-4'
| 'redpurple-5'
| 'redpurple-6'
| 'redpurple-7'
| 'redpurple-8'
| 'redpurple-9'
| 'yellowgreenblue'
| 'yellowgreenblue-3'
| 'yellowgreenblue-4'
| 'yellowgreenblue-5'
| 'yellowgreenblue-6'
| 'yellowgreenblue-7'
| 'yellowgreenblue-8'
| 'yellowgreenblue-9'
| 'yellowgreen'
| 'yellowgreen-3'
| 'yellowgreen-4'
| 'yellowgreen-5'
| 'yellowgreen-6'
| 'yellowgreen-7'
| 'yellowgreen-8'
| 'yellowgreen-9'
| 'yelloworangebrown'
| 'yelloworangebrown-3'
| 'yelloworangebrown-4'
| 'yelloworangebrown-5'
| 'yelloworangebrown-6'
| 'yelloworangebrown-7'
| 'yelloworangebrown-8'
| 'yelloworangebrown-9'
| 'yelloworangered'
| 'yelloworangered-3'
| 'yelloworangered-4'
| 'yelloworangered-5'
| 'yelloworangered-6'
| 'yelloworangered-7'
| 'yelloworangered-8'
| 'yelloworangered-9'
| 'darkblue'
| 'darkblue-3'
| 'darkblue-4'
| 'darkblue-5'
| 'darkblue-6'
| 'darkblue-7'
| 'darkblue-8'
| 'darkblue-9'
| 'darkgold'
| 'darkgold-3'
| 'darkgold-4'
| 'darkgold-5'
| 'darkgold-6'
| 'darkgold-7'
| 'darkgold-8'
| 'darkgold-9'
| 'darkgreen'
| 'darkgreen-3'
| 'darkgreen-4'
| 'darkgreen-5'
| 'darkgreen-6'
| 'darkgreen-7'
| 'darkgreen-8'
| 'darkgreen-9'
| 'darkmulti'
| 'darkmulti-3'
| 'darkmulti-4'
| 'darkmulti-5'
| 'darkmulti-6'
| 'darkmulti-7'
| 'darkmulti-8'
| 'darkmulti-9'
| 'darkred'
| 'darkred-3'
| 'darkred-4'
| 'darkred-5'
| 'darkred-6'
| 'darkred-7'
| 'darkred-8'
| 'darkred-9'
| 'lightgreyred'
| 'lightgreyred-3'
| 'lightgreyred-4'
| 'lightgreyred-5'
| 'lightgreyred-6'
| 'lightgreyred-7'
| 'lightgreyred-8'
| 'lightgreyred-9'
| 'lightgreyteal'
| 'lightgreyteal-3'
| 'lightgreyteal-4'
| 'lightgreyteal-5'
| 'lightgreyteal-6'
| 'lightgreyteal-7'
| 'lightgreyteal-8'
| 'lightgreyteal-9'
| 'lightmulti'
| 'lightmulti-3'
| 'lightmulti-4'
| 'lightmulti-5'
| 'lightmulti-6'
| 'lightmulti-7'
| 'lightmulti-8'
| 'lightmulti-9'
| 'lightorange'
| 'lightorange-3'
| 'lightorange-4'
| 'lightorange-5'
| 'lightorange-6'
| 'lightorange-7'
| 'lightorange-8'
| 'lightorange-9'
| 'lighttealblue'
| 'lighttealblue-3'
| 'lighttealblue-4'
| 'lighttealblue-5'
| 'lighttealblue-6'
| 'lighttealblue-7'
| 'lighttealblue-8'
| 'lighttealblue-9';
export type Diverging =
| 'blueorange'
| 'blueorange-3'
| 'blueorange-4'
| 'blueorange-5'
| 'blueorange-6'
| 'blueorange-7'
| 'blueorange-8'
| 'blueorange-9'
| 'blueorange-10'
| 'blueorange-11'
| 'brownbluegreen'
| 'brownbluegreen-3'
| 'brownbluegreen-4'
| 'brownbluegreen-5'
| 'brownbluegreen-6'
| 'brownbluegreen-7'
| 'brownbluegreen-8'
| 'brownbluegreen-9'
| 'brownbluegreen-10'
| 'brownbluegreen-11'
| 'purplegreen'
| 'purplegreen-3'
| 'purplegreen-4'
| 'purplegreen-5'
| 'purplegreen-6'
| 'purplegreen-7'
| 'purplegreen-8'
| 'purplegreen-9'
| 'purplegreen-10'
| 'purplegreen-11'
| 'pinkyellowgreen'
| 'pinkyellowgreen-3'
| 'pinkyellowgreen-4'
| 'pinkyellowgreen-5'
| 'pinkyellowgreen-6'
| 'pinkyellowgreen-7'
| 'pinkyellowgreen-8'
| 'pinkyellowgreen-9'
| 'pinkyellowgreen-10'
| 'pinkyellowgreen-11'
| 'purpleorange'
| 'purpleorange-3'
| 'purpleorange-4'
| 'purpleorange-5'
| 'purpleorange-6'
| 'purpleorange-7'
| 'purpleorange-8'
| 'purpleorange-9'
| 'purpleorange-10'
| 'purpleorange-11'
| 'redblue'
| 'redblue-3'
| 'redblue-4'
| 'redblue-5'
| 'redblue-6'
| 'redblue-7'
| 'redblue-8'
| 'redblue-9'
| 'redblue-10'
| 'redblue-11'
| 'redgrey'
| 'redgrey-3'
| 'redgrey-4'
| 'redgrey-5'
| 'redgrey-6'
| 'redgrey-7'
| 'redgrey-8'
| 'redgrey-9'
| 'redgrey-10'
| 'redgrey-11'
| 'redyellowblue'
| 'redyellowblue-3'
| 'redyellowblue-4'
| 'redyellowblue-5'
| 'redyellowblue-6'
| 'redyellowblue-7'
| 'redyellowblue-8'
| 'redyellowblue-9'
| 'redyellowblue-10'
| 'redyellowblue-11'
| 'redyellowgreen'
| 'redyellowgreen-3'
| 'redyellowgreen-4'
| 'redyellowgreen-5'
| 'redyellowgreen-6'
| 'redyellowgreen-7'
| 'redyellowgreen-8'
| 'redyellowgreen-9'
| 'redyellowgreen-10'
| 'redyellowgreen-11'
| 'spectral'
| 'spectral-3'
| 'spectral-4'
| 'spectral-5'
| 'spectral-6'
| 'spectral-7'
| 'spectral-8'
| 'spectral-9'
| 'spectral-10'
| 'spectral-11';
export type Cyclical = 'rainbow' | 'sinebow';
export type ColorScheme =
| Categorical
| SequentialSingleHue
| SequentialMultiHue
| Diverging
| Cyclical;

14
node_modules/vega-typings/types/spec/scope.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { Axis, Data, Layout, Legend, Mark, Projection, Scale, Signal, Title } from '.';
export interface Scope {
title?: string | Title;
layout?: Layout;
signals?: Signal[];
projections?: Projection[];
data?: Data[];
scales?: Scale[];
axes?: Axis[];
legends?: Legend[];
marks?: Mark[];
usermeta?: object;
}

1
node_modules/vega-typings/types/spec/selector.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export type EventSelector = string;

30
node_modules/vega-typings/types/spec/signal.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { Binding, Expr, OnEvent } from '.';
// Hide from Vega-Lite schema (Since @hidden isn't used by Vega, we can just add it here for now.)
/**
* @hidden
*/
export interface SignalRef {
signal: string;
}
export interface BaseSignal {
name: string;
description?: string;
on?: OnEvent[];
}
export interface PushSignal extends BaseSignal {
push: 'outer';
}
export interface NewSignal extends BaseSignal {
value?: SignalValue;
react?: boolean;
update?: Expr;
bind?: Binding;
}
export interface InitSignal extends BaseSignal {
value?: SignalValue;
init: Expr;
bind?: Binding;
}
export type Signal = NewSignal | InitSignal | PushSignal;
export type SignalValue = any;

54
node_modules/vega-typings/types/spec/stream.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import { Expr, MarkType } from '.';
export type EventSource = EventStream['source'] & {};
export type EventType =
| 'click'
| 'dblclick'
| 'dragenter'
| 'dragleave'
| 'dragover'
| 'keydown'
| 'keypress'
| 'keyup'
| 'mousedown'
| 'mousemove'
| 'mouseout'
| 'mouseover'
| 'mouseup'
| 'mousewheel'
| 'timer'
| 'touchend'
| 'touchmove'
| 'touchstart'
| 'wheel';
export type WindowEventType =
| EventType
// TODO: change to `keyof HTMLBodyElementEventMap` after vega/ts-json-schema-generator#192
| string;
export interface StreamParameters {
between?: Stream[];
marktype?: MarkType;
markname?: string;
filter?: Expr | Expr[];
throttle?: number;
debounce?: number;
consume?: boolean;
}
export type EventStream = StreamParameters &
(
| {
source?: 'view' | 'scope';
type: EventType;
}
| {
source: 'window';
type: WindowEventType;
}
);
export interface DerivedStream extends StreamParameters {
stream: Stream;
}
export interface MergedStream extends StreamParameters {
merge: Stream[];
}
export type Stream = EventStream | DerivedStream | MergedStream;

211
node_modules/vega-typings/types/spec/title.d.ts generated vendored Normal file
View File

@@ -0,0 +1,211 @@
import { GroupEncodeEntry, GuideEncodeEntry, SignalRef, TextEncodeEntry } from '.';
import { Encode, Text } from './encode';
import {
AlignValue,
AnchorValue,
BooleanValue,
ColorValue,
FontStyleValue,
FontWeightValue,
NumberValue,
StringValue,
TextBaselineValue,
} from './values';
export type TitleOrient = 'none' | 'left' | 'right' | 'top' | 'bottom';
export type TitleAnchor = null | 'start' | 'middle' | 'end';
export type TitleFrame = 'bounds' | 'group';
export interface Title extends BaseTitle {
/**
* The title text.
*/
text: Text | SignalRef;
/**
* The subtitle text.
*/
subtitle?: Text | SignalRef;
/**
* A mark name property to apply to the title text mark. (**Deprecated.**)
*/
name?: string;
/**
* A boolean flag indicating if the title element should respond to input events such as mouse hover. (**Deprecated.**)
*/
interactive?: boolean;
/**
* A mark style property to apply to the title text mark. If not specified, a default style of `"group-title"` is applied. (**Deprecated**)
*/
style?: string | string[];
/**
* Mark definitions for custom title encoding.
*/
encode?: TitleEncode | Encode<TextEncodeEntry>; // second entry is **deprecated**
}
export interface TitleEncode {
/**
* Custom encoding for the title container group.
*/
group?: GuideEncodeEntry<GroupEncodeEntry>;
/**
* Custom encoding for the title text.
*/
title?: GuideEncodeEntry<TextEncodeEntry>;
/**
* Custom encoding for the subtitle text.
*/
subtitle?: GuideEncodeEntry<TextEncodeEntry>;
}
export interface BaseTitle {
/**
* The anchor position for placing the title and subtitle text. One of `"start"`, `"middle"`, or `"end"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.
*/
anchor?: AnchorValue;
/**
* The reference frame for the anchor position, one of `"bounds"` (to anchor relative to the full bounding box) or `"group"` (to anchor relative to the group width or height).
*/
frame?: TitleFrame | StringValue;
/**
* The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.
*/
offset?: NumberValue;
/**
* Default title orientation (`"top"`, `"bottom"`, `"left"`, or `"right"`)
*/
orient?: TitleOrient | SignalRef;
// ---------- ARIA ----------
/**
* A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only).
* If `false`, the "aria-hidden" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree.
*
* __Default value:__ `true`
*/
aria?: boolean;
// ---------- Shared Text Properties ----------
/**
* Horizontal text alignment for title text. One of `"left"`, `"center"`, or `"right"`.
*/
align?: AlignValue;
/**
* Angle in degrees of title and subtitle text.
*/
angle?: NumberValue;
/**
* Vertical text baseline for title and subtitle text. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`, `"line-top"`, or `"line-bottom"`. The `"line-top"` and `"line-bottom"` values operate similarly to `"top"` and `"bottom"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.
*/
baseline?: TextBaselineValue;
/**
* Delta offset for title and subtitle text x-coordinate.
*/
dx?: NumberValue;
/**
* Delta offset for title and subtitle text y-coordinate.
*/
dy?: NumberValue;
/**
* The maximum allowed length in pixels of title and subtitle text.
*
* @minimum 0
*/
limit?: NumberValue;
// ---------- Title Text ----------
/**
* Text color for title text.
*/
color?: ColorValue;
/**
* Font name for title text.
*/
font?: StringValue;
/**
* Font size in pixels for title text.
*
* @minimum 0
*/
fontSize?: NumberValue;
/**
* Font style for title text.
*/
fontStyle?: FontStyleValue;
/**
* Font weight for title text.
* This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
*/
fontWeight?: FontWeightValue;
/**
* Line height in pixels for multi-line title text or title text with `"line-top"` or `"line-bottom"` baseline.
*/
lineHeight?: NumberValue;
// ---------- Subtitle Text ----------
/**
* Text color for subtitle text.
*/
subtitleColor?: ColorValue;
/**
* Font name for subtitle text.
*/
subtitleFont?: StringValue;
/**
* Font size in pixels for subtitle text.
*
* @minimum 0
*/
subtitleFontSize?: NumberValue;
/**
* Font style for subtitle text.
*/
subtitleFontStyle?: FontStyleValue;
/**
* Font weight for subtitle text.
* This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
*/
subtitleFontWeight?: FontWeightValue;
/**
* Line height in pixels for multi-line subtitle text.
*/
subtitleLineHeight?: NumberValue;
/**
* The padding in pixels between title and subtitle text.
*/
subtitlePadding?: NumberValue;
/**
* The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups.
*
* __Default value:__ `0`.
*
* @TJS-type integer
* @minimum 0
*/
zindex?: number;
}

738
node_modules/vega-typings/types/spec/transform.d.ts generated vendored Normal file
View File

@@ -0,0 +1,738 @@
import {
Compare,
ExprRef,
FontStyle,
FontWeight,
SignalRef,
Vector2,
Vector4,
Vector5,
Vector6,
Vector7,
} from '.';
export type DataName = string;
export type ProjectionName = string;
export type SignalName = string;
export type ExprString = string;
export interface FieldParam {
field: string;
}
export type TransformField = SignalRef | FieldParam | ExprRef;
export type FieldRef = string | TransformField;
export type Transforms =
| AggregateTransform
| BinTransform
| CollectTransform
| CountPatternTransform
| ContourTransform
| CrossTransform
| CrossFilterTransform
| DensityTransform
| DotBinTransform
| ExtentTransform
| FilterTransform
| FlattenTransform
| FoldTransform
| ForceTransform
| FormulaTransform
| HeatmapTransform
| GeoJSONTransform
| GeoPathTransform
| GeoPointTransform
| GeoShapeTransform
| GraticuleTransform
| IdentifierTransform
| ImputeTransform
| IsocontourTransform
| JoinAggregateTransform
| KDETransform
| KDE2DTransform
| LabelTransform
| LinkPathTransform
| LoessTransform
| LookupTransform
| NestTransform
| PackTransform
| PartitionTransform
| PieTransform
| PivotTransform
| ProjectTransform
| QuantileTransform
| RegressionTransform
| ResolveFilterTransform
| SampleTransform
| SequenceTransform
| StackTransform
| StratifyTransform
| TimeUnitTransform
| TreeTransform
| TreeLinksTransform
| TreemapTransform
| VoronoiTransform
| WindowTransform
| WordcloudTransform;
export interface AggregateTransform {
type: 'aggregate';
signal?: string;
groupby?: FieldRef[] | SignalRef;
fields?: (FieldRef | null)[] | SignalRef;
ops?: (AggregateOp | SignalRef)[] | SignalRef;
as?: (string | SignalRef | null)[] | SignalRef;
drop?: boolean | SignalRef;
cross?: boolean | SignalRef;
key?: string | TransformField;
}
export type AggregateOp =
| 'argmax'
| 'argmin'
| 'average'
| 'count'
| 'distinct'
| 'max'
| 'mean'
| 'median'
| 'min'
| 'missing'
| 'product'
| 'q1'
| 'q3'
| 'ci0'
| 'ci1'
| 'stderr'
| 'stdev'
| 'stdevp'
| 'sum'
| 'valid'
| 'values'
| 'variance'
| 'variancep';
export interface BinTransform extends BaseBin {
type: 'bin';
field: FieldRef;
interval?: boolean | SignalRef;
anchor?: number | SignalRef;
extent: Vector2<number | SignalRef> | SignalRef;
span?: number | SignalRef;
signal?: SignalName;
name?: string | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface BaseBin {
/**
* The number base to use for automatic bin determination (default is base 10).
*
* __Default value:__ `10`
*
*/
base?: number | SignalRef;
/**
* An exact step size to use between bins.
*
* __Note:__ If provided, options such as maxbins will be ignored.
*/
step?: number | SignalRef;
/**
* An array of allowable step sizes to choose from.
* @minItems 1
*/
steps?: (number | SignalRef)[] | SignalRef;
/**
* A minimum allowable step size (particularly useful for integer values).
*/
minstep?: number | SignalRef;
/**
* Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.
*
* __Default value:__ `[5, 2]`
*
* @minItems 1
*/
divide?: Vector2<number | SignalRef> | SignalRef;
/**
* Maximum number of bins.
*
* __Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels
*
* @minimum 2
*/
maxbins?: number | SignalRef;
/**
* If true (the default), attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.
*/
nice?: boolean | SignalRef;
}
export interface CollectTransform {
type: 'collect';
sort: Compare;
}
export interface CountPatternTransform {
type: 'countpattern';
field: FieldRef;
case?: string | SignalRef;
pattern?: string | SignalRef;
stopwords?: string | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export type ContourTransform = {
type: 'contour';
signal?: string;
size: (number | SignalRef)[] | SignalRef; // TODO: change to Vector2<number | SignalRef> after https://github.com/Microsoft/TypeScript/issues/28017 has been fixed
values?: (number | SignalRef)[] | SignalRef;
x?: FieldRef;
y?: FieldRef;
cellSize?: number | SignalRef;
bandwidth?: number | SignalRef;
} & (
| {
count?: number | SignalRef;
nice?: number | SignalRef;
}
| {
thresholds?: (number | SignalRef)[] | SignalRef;
}
);
export interface CrossTransform {
type: 'cross';
filter?: ExprString;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface CrossFilterTransform {
type: 'crossfilter';
fields: (string | TransformField)[] | SignalRef;
query: (Vector2<number | SignalRef> | SignalRef)[] | SignalRef;
signal?: SignalName;
}
export interface DensityTransform {
type: 'density';
extent?: Vector2<number | SignalRef> | SignalRef;
steps?: number | SignalRef;
minsteps?: number | SignalRef;
maxsteps?: number | SignalRef;
method?: DensityMethod | SignalRef;
distribution?: Distribution | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export type DensityMethod = 'pdf' | 'cdf';
export interface DistributionNormal {
function: 'normal';
mean?: number | SignalRef;
stdev?: number | SignalRef;
}
export interface DistributionLogNormal {
function: 'lognormal';
mean?: number | SignalRef;
stdev?: number | SignalRef;
}
export interface DistributionUniform {
function: 'uniform';
min?: number | SignalRef;
max?: number | SignalRef;
}
export interface DistributionKDE {
function: 'kde';
field: string | TransformField;
from?: DataName;
bandwidth?: number | SignalRef;
}
export interface DistributionMixture {
function: 'mixture';
field: string | TransformField;
distributions?: (Distribution | SignalRef)[] | SignalRef;
weights?: (number | SignalRef)[] | SignalRef;
}
export type Distribution =
| DistributionNormal
| DistributionLogNormal
| DistributionUniform
| DistributionKDE
| DistributionMixture;
export interface DotBinTransform {
type: 'dotbin';
field: FieldRef;
groupby?: FieldRef[] | SignalRef;
step?: number | SignalRef;
smooth?: boolean | SignalRef;
as?: string | SignalRef;
signal?: SignalName;
}
export interface ExtentTransform {
type: 'extent';
field: FieldRef;
signal?: string;
}
export interface FilterTransform {
type: 'filter';
expr: ExprString;
}
export interface FlattenTransform {
type: 'flatten';
fields: FieldRef[] | SignalRef;
index?: string | SignalRef;
as?: (string | SignalRef)[] | SignalRef;
}
export interface FoldTransform {
type: 'fold';
fields: FieldRef[] | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface ForceTransform {
type: 'force';
static?: boolean | SignalRef;
restart?: boolean | SignalRef;
iterations?: number | SignalRef;
alpha?: number | SignalRef;
alphaMin?: number | SignalRef;
alphaTarget?: number | SignalRef;
velocityDecay?: number | SignalRef;
forces?: (Force | SignalRef)[] | SignalRef;
signal?: SignalName;
}
export interface ForceCenter {
force: 'center';
x?: number | SignalRef;
y?: number | SignalRef;
}
export interface ForceCollide {
force: 'collide';
radius?: number | SignalRef | ExprRef;
strength?: number | SignalRef;
iterations?: number | SignalRef;
}
export interface ForceLink {
force: 'link';
links?: DataName;
id?: FieldRef;
distance?: number | SignalRef | ExprRef;
strength?: number | SignalRef | ExprRef;
iterations?: number | SignalRef;
}
export interface ForceNBody {
force: 'nbody';
strength?: number | SignalRef;
theta?: number | SignalRef;
distanceMin?: number | SignalRef;
distanceMax?: number | SignalRef;
}
export interface ForceX {
force: 'x';
strength?: number | SignalRef;
x?: FieldRef;
}
export interface ForceY {
force: 'y';
strength?: number | SignalRef;
y?: FieldRef;
}
export type Force = ForceCenter | ForceCollide | ForceLink | ForceNBody | ForceX | ForceY;
export interface FormulaTransform {
type: 'formula';
expr: ExprString;
initonly?: boolean;
as: string | SignalRef;
}
export interface GeoJSONTransform {
type: 'geojson';
fields?: Vector2<FieldRef> | SignalRef;
geojson?: FieldRef;
signal?: SignalName;
}
export interface GeoPointTransform {
type: 'geopoint';
projection: ProjectionName;
fields: Vector2<FieldRef> | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface GeoPathTransform {
type: 'geopath';
projection?: ProjectionName;
field?: FieldRef;
pointRadius?: number | SignalRef | ExprRef;
as?: string | SignalRef;
}
export interface GeoShapeTransform {
type: 'geoshape';
projection?: ProjectionName;
field?: FieldRef;
pointRadius?: number | SignalRef | ExprRef;
as?: string | SignalRef;
}
export interface GraticuleTransform {
type: 'graticule';
signal?: SignalName;
extent?: Vector2<Vector2<number | SignalRef> | SignalRef> | SignalRef;
extentMajor?: Vector2<Vector2<number | SignalRef> | SignalRef> | SignalRef;
extentMinor?: Vector2<Vector2<number | SignalRef> | SignalRef> | SignalRef;
step?: Vector2<number | SignalRef> | SignalRef;
stepMajor?: Vector2<number | SignalRef> | SignalRef;
stepMinor?: Vector2<number | SignalRef> | SignalRef;
precision?: number | SignalRef;
}
export interface HeatmapTransform {
type: 'heatmap';
field?: string | TransformField;
color?: string | TransformField;
opacity?: number | TransformField;
resolve?: 'independent' | 'shared' | SignalRef;
as?: string | SignalRef;
}
export interface IdentifierTransform {
type: 'identifier';
as: string | SignalRef;
}
export interface ImputeTransform {
type: 'impute';
field: FieldRef;
key: FieldRef;
keyvals?: any[] | SignalRef;
groupby?: FieldRef[] | SignalRef;
method?: ImputeMethod | SignalRef;
value?: any; // includes SignalRef
}
export type ImputeMethod = 'value' | 'median' | 'max' | 'min' | 'mean';
export interface IsocontourTransform {
type: 'isocontour';
field?: string | TransformField;
scale?: number | TransformField;
translate?: number[] | TransformField;
levels?: number | SignalRef;
smooth?: boolean | SignalRef;
nice?: boolean | SignalRef;
zero?: boolean | SignalRef;
resolve?: 'shared' | 'independent' | SignalRef;
thresholds?: (number | SignalRef)[] | SignalRef;
as?: string | null | SignalRef;
}
export interface JoinAggregateTransform {
type: 'joinaggregate';
groupby?: FieldRef[] | SignalRef;
ops?: (AggregateOp | SignalRef)[] | SignalRef;
fields?: (FieldRef | null)[] | SignalRef;
as?: (string | SignalRef | null)[] | SignalRef;
}
export interface KDETransform {
type: 'kde';
field: FieldRef;
groupby?: FieldRef[] | SignalRef;
cumulative?: boolean | SignalRef;
counts?: boolean | SignalRef;
bandwidth?: number | SignalRef;
extent?: Vector2<number | SignalRef> | SignalRef;
resolve?: KDEResolve | SignalRef;
steps?: number | SignalRef;
minsteps?: number | SignalRef;
maxsteps?: number | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export type KDEResolve = 'shared' | 'independent';
export interface LinkPathTransform {
type: 'linkpath';
sourceX?: FieldRef;
sourceY?: FieldRef;
targetX?: FieldRef;
targetY?: FieldRef;
orient?: LinkPathOrient | SignalRef;
shape?: LinkPathShape | SignalRef;
require?: SignalRef;
as?: string | SignalRef;
}
export type LinkPathOrient = 'horizontal' | 'vertical' | 'radial';
export type LinkPathShape = 'line' | 'arc' | 'curve' | 'diagonal' | 'orthogonal';
export interface KDE2DTransform {
type: 'kde2d';
size: (number | SignalRef)[] | SignalRef; // TODO: change to Vector2<number | SignalRef> after https://github.com/Microsoft/TypeScript/issues/28017 has been fixed
x: string | TransformField;
y: string | TransformField;
groupby?: (string | TransformField)[] | SignalRef;
weight?: string | TransformField;
cellSize?: number | SignalRef;
bandwidth?: (number | SignalRef)[] | SignalRef; // TODO: change to Vector2<number | SignalRef> after https://github.com/Microsoft/TypeScript/issues/28017 has been fixed
counts?: boolean | SignalRef;
as?: string | SignalRef;
}
export interface LoessTransform {
type: 'loess';
x: FieldRef;
y: FieldRef;
groupby?: FieldRef[] | SignalRef;
bandwidth?: number | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface LabelTransform {
type: 'label';
size: Vector2<number | SignalRef> | SignalRef;
sort?: Compare;
offset?: number[] | number | SignalRef;
anchor?: string[] | string | SignalRef;
padding?: number | SignalRef;
markIndex?: number;
lineAnchor?: 'begin' | 'end' | SignalRef;
avoidBaseMark?: boolean | SignalRef;
avoidMarks?: string[];
as?: Vector7<string | SignalRef> | SignalRef;
}
export interface LookupTransform {
type: 'lookup';
from: DataName;
key: FieldRef;
fields: FieldRef[] | SignalRef;
values?: FieldRef[] | SignalRef;
as?: (string | SignalRef)[] | SignalRef;
default?: any; // includes SignalRef
}
export interface NestTransform {
type: 'nest';
keys?: FieldRef[] | SignalRef;
generate?: boolean | SignalRef;
}
export interface PackTransform {
type: 'pack';
field?: FieldRef;
sort?: Compare;
padding?: number | SignalRef;
radius?: FieldRef;
size?: Vector2<number | SignalRef> | SignalRef;
as?: Vector5<string | SignalRef> | SignalRef;
}
export interface PartitionTransform {
type: 'partition';
field?: FieldRef;
sort?: Compare;
padding?: number | SignalRef;
round?: boolean | SignalRef;
size?: Vector2<number | SignalRef> | SignalRef;
as?: Vector6<string | SignalRef> | SignalRef;
}
export interface PieTransform {
type: 'pie';
field?: FieldRef;
startAngle?: number | SignalRef;
endAngle?: number | SignalRef;
sort?: boolean | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export interface PivotTransform {
type: 'pivot';
field: FieldRef;
value: FieldRef;
groupby?: FieldRef[] | SignalRef;
limit?: number | SignalRef;
op?: string | SignalRef;
key?: string | TransformField;
}
export interface ProjectTransform {
type: 'project';
fields?: FieldRef[] | SignalRef;
as?: (string | SignalRef | null)[] | SignalRef;
}
export interface QuantileTransform {
type: 'quantile';
field: FieldRef;
groupby?: FieldRef[] | SignalRef;
step?: number | SignalRef;
probs?: number[] | SignalRef;
as?: (string | SignalRef)[] | SignalRef;
}
export interface RegressionTransform {
type: 'regression';
x: FieldRef;
y: FieldRef;
groupby?: FieldRef[] | SignalRef;
method?: RegressionMethod | SignalRef;
order?: number | SignalRef;
extent?: [number, number] | SignalRef;
params?: boolean | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export type RegressionMethod = 'linear' | 'exp' | 'log' | 'quad' | 'poly' | 'pow';
export interface ResolveFilterTransform {
type: 'resolvefilter';
ignore: number | SignalRef;
filter: SignalRef;
}
export interface SampleTransform {
type: 'sample';
size: number | SignalRef;
}
export interface SequenceTransform {
type: 'sequence';
start: number | SignalRef;
stop: number | SignalRef;
step?: number | SignalRef;
as?: string | SignalRef;
}
export interface StackTransform {
type: 'stack';
field?: FieldRef;
groupby?: FieldRef[];
sort?: Compare;
offset?: StackOffset | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
}
export type StackOffset = 'zero' | 'center' | 'normalize';
export interface StratifyTransform {
type: 'stratify';
key: FieldRef;
parentKey: FieldRef;
}
export interface TimeUnitTransform {
type: 'timeunit';
field: FieldRef;
interval?: boolean | SignalRef;
units?: (TimeUnit | SignalRef)[] | SignalRef;
step?: number | SignalRef;
timezone?: TimeZone | SignalRef;
as?: Vector2<string | SignalRef> | SignalRef;
signal?: SignalName;
}
export type TimeZone = 'local' | 'utc';
export type TimeUnit =
| 'year'
| 'quarter'
| 'month'
| 'week'
| 'day'
| 'date'
| 'dayofyear'
| 'hours'
| 'minutes'
| 'seconds'
| 'milliseconds';
export interface TreeTransform {
type: 'tree';
field?: FieldRef;
sort?: Compare;
method?: TreeMethod | SignalRef;
size?: Vector2<number | SignalRef> | SignalRef;
nodeSize?: Vector2<number | SignalRef> | SignalRef;
separation?: boolean | SignalRef;
as?: Vector4<string | SignalRef> | SignalRef;
}
export type TreeMethod = 'tidy' | 'cluster';
export interface TreeLinksTransform {
type: 'treelinks';
}
export interface TreemapTransform {
type: 'treemap';
field?: FieldRef;
sort?: Compare;
method?: TreemapMethod | SignalRef;
padding?: number | SignalRef;
paddingInner?: number | SignalRef;
paddingOuter?: number | SignalRef;
paddingTop?: number | SignalRef;
paddingRight?: number | SignalRef;
paddingBottom?: number | SignalRef;
paddingLeft?: number | SignalRef;
ratio?: number | SignalRef;
round?: boolean | SignalRef;
size?: Vector2<number | SignalRef> | SignalRef;
as?: Vector6<string | SignalRef> | SignalRef;
}
export type TreemapMethod = 'squarify' | 'resquarify' | 'binary' | 'dice' | 'slice' | 'slicedice';
export interface VoronoiTransform {
type: 'voronoi';
x: FieldRef;
y: FieldRef;
size?: Vector2<number | SignalRef> | SignalRef;
extent?: Vector2<Vector2<number | SignalRef> | SignalRef> | SignalRef;
as?: string | SignalRef;
}
export interface WindowTransform {
type: 'window';
sort?: Compare;
groupby?: FieldRef[] | SignalRef;
ops?: (AggregateOp | WindowOnlyOp | SignalRef)[];
params?: (number | SignalRef | null)[] | SignalRef;
fields?: (FieldRef | null)[] | SignalRef;
as?: (string | SignalRef | null)[] | SignalRef;
frame?: Vector2<number | SignalRef | null> | SignalRef;
ignorePeers?: boolean | SignalRef;
}
export type WindowOnlyOp =
| 'row_number'
| 'rank'
| 'dense_rank'
| 'percent_rank'
| 'cume_dist'
| 'ntile'
| 'lag'
| 'lead'
| 'first_value'
| 'last_value'
| 'nth_value'
| 'prev_value'
| 'next_value';
export interface WordcloudTransform {
type: 'wordcloud';
size?: Vector2<number | SignalRef> | SignalRef;
font?: string | TransformField;
fontStyle?: FontStyle | TransformField;
fontWeight?: FontWeight | TransformField;
fontSize?: number | TransformField;
fontSizeRange?: Vector2<number | SignalRef> | SignalRef;
rotate?: number | TransformField;
text?: string | TransformField;
spiral?: WordcloudSpiral | SignalRef;
padding?: number | TransformField;
as?: Vector7<string | SignalRef> | SignalRef;
}
export type WordcloudSpiral = 'archimedian' | 'rectangular';

8
node_modules/vega-typings/types/spec/util.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export type Vector2<T> = [T, T];
export type Vector3<T> = [T, T, T];
export type Vector4<T> = [T, T, T, T];
export type Vector5<T> = [T, T, T, T, T];
export type Vector6<T> = [T, T, T, T, T, T];
export type Vector7<T> = [T, T, T, T, T, T, T];
export type Vector10<T> = [T, T, T, T, T, T, T, T, T, T];
export type Vector12<T> = [T, T, T, T, T, T, T, T, T, T, T, T];

50
node_modules/vega-typings/types/spec/values.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
import { Color } from './color';
import { StrokeCap } from './config';
import {
Align,
AlignValueRef,
AnchorValueRef,
ArrayValueRef,
BooleanValueRef,
ColorValueRef,
FontStyle,
FontStyleValueRef,
FontWeight,
FontWeightValueRef,
NumericValueRef,
Orient,
OrientValueRef,
StringValueRef,
StrokeCapValueRef,
SymbolShape,
SymbolShapeValueRef,
TextBaseline,
TextBaselineValueRef,
} from './encode';
import { TitleAnchor } from './title';
export type NumberValue = number | NumericValueRef;
export type FontWeightValue = FontWeight | FontWeightValueRef;
export type FontStyleValue = FontStyle | FontStyleValueRef;
export type StringValue = string | StringValueRef;
export type ColorValue = null | Color | ColorValueRef;
export type AlignValue = Align | AlignValueRef;
export type StrokeCapValue = StrokeCap | StrokeCapValueRef;
export type TextBaselineValue = TextBaseline | TextBaselineValueRef;
export type SymbolShapeValue = SymbolShape | SymbolShapeValueRef;
export type BooleanValue = boolean | BooleanValueRef;
export type DashArrayValue = number[] | ArrayValueRef;
export type AnchorValue = TitleAnchor | AnchorValueRef;
export type OrientValue = Orient | OrientValueRef;