Socket
Socket
Sign inDemoInstall

@vx/scale

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vx/scale - npm Package Compare versions

Comparing version 0.0.198 to 0.0.199

esm/createScale.js

15

esm/index.js

@@ -13,3 +13,14 @@ export { default as scaleBand } from './scales/band';

export { default as scaleThreshold } from './scales/threshold';
export { default as updateScale } from './util/updateScale';
export { default as scaleSqrt } from './scales/squareRoot';
export { default as scaleSqrt } from './scales/squareRoot';
export { default as createScale } from './createScale';
export { default as updateScale } from './updateScale';
export { default as inferScaleType } from './utils/inferScaleType';
export { default as coerceNumber } from './utils/coerceNumber';
export { default as getTicks } from './utils/getTicks';
export { default as toString } from './utils/toString'; // export types
export * from './types/Base';
export * from './types/Nice';
export * from './types/Scale';
export * from './types/ScaleConfig';
export * from './types/ScaleInterpolate';

27

esm/scales/band.js
import { scaleBand } from 'd3-scale';
export default function bandScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
padding = _ref.padding,
paddingInner = _ref.paddingInner,
paddingOuter = _ref.paddingOuter,
align = _ref.align,
tickFormat = _ref.tickFormat;
var scale = scaleBand();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (padding) scale.padding(padding);
if (paddingInner) scale.paddingInner(paddingInner);
if (paddingOuter) scale.paddingOuter(paddingOuter);
if (align) scale.align(align); // @TODO should likely get rid of these.
// @ts-ignore
if (tickFormat) scale.tickFormat = tickFormat; // @ts-ignore
scale.type = 'band';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateBandScale = scaleOperator('domain', 'range', 'reverse', 'align', 'padding', 'round');
export default function createBandScale(config) {
return updateBandScale(scaleBand(), config);
}
import { scaleLinear } from 'd3-scale';
export default function linearScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = scaleLinear();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
scale.type = 'linear';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateLinearScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');
export default function createLinearScale(config) {
return updateLinearScale(scaleLinear(), config);
}
import { scaleLog } from 'd3-scale';
export default function logScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
base = _ref.base,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = scaleLog();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true);
if (base) scale.base(base); // @ts-ignore
scale.type = 'log';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateLogScale = scaleOperator('domain', 'range', 'reverse', 'base', 'clamp', 'interpolate', 'nice', 'round');
export default function createLogScale(config) {
return updateLogScale(scaleLog(), config);
}
import { scaleOrdinal } from 'd3-scale';
export default function ordinalScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
unknown = _ref.unknown;
var scale = scaleOrdinal();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (unknown) scale.unknown(unknown); // @ts-ignore
scale.type = 'ordinal';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateOrdinalScale = scaleOperator('domain', 'range', 'reverse', 'unknown');
export default function createOrdinalScale(config) {
return updateOrdinalScale(scaleOrdinal(), config);
}
import { scalePoint } from 'd3-scale';
export default function pointScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
padding = _ref.padding,
align = _ref.align;
var scale = scalePoint();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (padding) scale.padding(padding);
if (align) scale.align(align); // @ts-ignore
scale.type = 'point';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updatePointScale = scaleOperator('domain', 'range', 'reverse', 'align', 'padding', 'round');
export default function createPointScale(config) {
return updatePointScale(scalePoint(), config);
}
import { scalePow } from 'd3-scale';
export default function powerScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
exponent = _ref.exponent,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = scalePow();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true);
if (exponent) scale.exponent(exponent); // @ts-ignore
scale.type = 'power';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updatePowScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'exponent', 'interpolate', 'nice', 'round', 'zero');
export default function createPowScale(config) {
return updatePowScale(scalePow(), config);
}
import { scaleQuantile } from 'd3-scale';
export default function quantileScale(_ref) {
var range = _ref.range,
domain = _ref.domain;
var scale = scaleQuantile();
if (range) scale.range(range);
if (domain) scale.domain(domain); // @ts-ignore
scale.type = 'quantile';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateQuantileScale = scaleOperator('domain', 'range', 'reverse');
export default function createQuantileScale(config) {
return updateQuantileScale(scaleQuantile(), config);
}
import { scaleQuantize } from 'd3-scale';
export default function quantizeScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
ticks = _ref.ticks,
tickFormat = _ref.tickFormat,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice;
var scale = scaleQuantize();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (ticks) scale.ticks(ticks);
if (tickFormat) scale.tickFormat.apply(scale, tickFormat); // @ts-ignore
scale.type = 'quantize';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateQuantizeScale = scaleOperator('domain', 'range', 'reverse', 'nice', 'zero');
export default function createQuantizeScale(config) {
return updateQuantizeScale(scaleQuantize(), config);
}

@@ -1,11 +0,6 @@

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import powerScale from './power';
export default function squareRootScale(scaleConfig) {
var scale = powerScale(_extends({}, scaleConfig, {
exponent: 0.5
})); // @ts-ignore
scale.type = 'squareRoot';
return scale;
import { scaleSqrt } from 'd3-scale';
import scaleOperator from '../operators/scaleOperator';
export var updateSqrtScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');
export default function createSqrtScale(config) {
return updateSqrtScale(scaleSqrt(), config);
}

@@ -1,14 +0,6 @@

// @ts-ignore no type defs for symlog
import { scaleSymlog } from 'd3-scale';
export default function symLogScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
constant = _ref.constant;
var scale = scaleSymlog();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (constant) scale.constant(constant); // @ts-ignore
scale.type = 'symlog';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateSymlogScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'constant', 'nice', 'zero');
export default function createSymlogScale(config) {
return updateSymlogScale(scaleSymlog(), config);
}
import { scaleThreshold } from 'd3-scale';
export default function thresholdScale(_ref) {
var range = _ref.range,
domain = _ref.domain;
var scale = scaleThreshold();
if (range) scale.range(range);
if (domain) scale.domain(domain); // @ts-ignore
scale.type = 'threshold';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateThresholdScale = scaleOperator('domain', 'range', 'reverse');
export default function createThresholdScale(config) {
return updateThresholdScale(scaleThreshold(), config);
}
import { scaleTime } from 'd3-scale';
export default function timeScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = scaleTime();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
scale.type = 'time';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateTimeScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');
export default function createTimeScale(config) {
return updateTimeScale(scaleTime(), config);
}
import { scaleUtc } from 'd3-scale';
export default function timeScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = scaleUtc();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
scale.type = 'utc';
return scale;
import scaleOperator from '../operators/scaleOperator';
export var updateUtcScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');
export default function createUtcScale(config) {
return updateUtcScale(scaleUtc(), config);
}

@@ -13,3 +13,14 @@ export { default as scaleBand } from './scales/band';

export { default as scaleThreshold } from './scales/threshold';
export { default as updateScale } from './util/updateScale';
export { default as scaleSqrt } from './scales/squareRoot';
export { default as createScale } from './createScale';
export { default as updateScale } from './updateScale';
export { default as inferScaleType } from './utils/inferScaleType';
export { default as coerceNumber } from './utils/coerceNumber';
export { default as getTicks } from './utils/getTicks';
export { default as toString } from './utils/toString';
export * from './types/Base';
export * from './types/Nice';
export * from './types/Scale';
export * from './types/ScaleConfig';
export * from './types/ScaleInterpolate';
//# sourceMappingURL=index.d.ts.map
"use strict";
exports.__esModule = true;
exports.scaleSqrt = exports.updateScale = exports.scaleThreshold = exports.scaleSymlog = exports.scaleQuantile = exports.scaleQuantize = exports.scaleOrdinal = exports.scalePower = exports.scaleLog = exports.scaleUtc = exports.scaleTime = exports.scaleLinear = exports.scalePoint = exports.scaleBand = void 0;
var _exportNames = {
scaleBand: true,
scalePoint: true,
scaleLinear: true,
scaleTime: true,
scaleUtc: true,
scaleLog: true,
scalePower: true,
scaleOrdinal: true,
scaleQuantize: true,
scaleQuantile: true,
scaleSymlog: true,
scaleThreshold: true,
scaleSqrt: true,
createScale: true,
updateScale: true,
inferScaleType: true,
coerceNumber: true,
getTicks: true,
toString: true
};
exports.toString = exports.getTicks = exports.coerceNumber = exports.inferScaleType = exports.updateScale = exports.createScale = exports.scaleSqrt = exports.scaleThreshold = exports.scaleSymlog = exports.scaleQuantile = exports.scaleQuantize = exports.scaleOrdinal = exports.scalePower = exports.scaleLog = exports.scaleUtc = exports.scaleTime = exports.scaleLinear = exports.scalePoint = exports.scaleBand = void 0;

@@ -54,10 +75,70 @@ var _band = _interopRequireDefault(require("./scales/band"));

var _updateScale = _interopRequireDefault(require("./util/updateScale"));
var _squareRoot = _interopRequireDefault(require("./scales/squareRoot"));
exports.scaleSqrt = _squareRoot.default;
var _createScale = _interopRequireDefault(require("./createScale"));
exports.createScale = _createScale.default;
var _updateScale = _interopRequireDefault(require("./updateScale"));
exports.updateScale = _updateScale.default;
var _squareRoot = _interopRequireDefault(require("./scales/squareRoot"));
var _inferScaleType = _interopRequireDefault(require("./utils/inferScaleType"));
exports.scaleSqrt = _squareRoot.default;
exports.inferScaleType = _inferScaleType.default;
var _coerceNumber = _interopRequireDefault(require("./utils/coerceNumber"));
exports.coerceNumber = _coerceNumber.default;
var _getTicks = _interopRequireDefault(require("./utils/getTicks"));
exports.getTicks = _getTicks.default;
var _toString = _interopRequireDefault(require("./utils/toString"));
exports.toString = _toString.default;
var _Base = require("./types/Base");
Object.keys(_Base).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _Base[key];
});
var _Nice = require("./types/Nice");
Object.keys(_Nice).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _Nice[key];
});
var _Scale = require("./types/Scale");
Object.keys(_Scale).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _Scale[key];
});
var _ScaleConfig = require("./types/ScaleConfig");
Object.keys(_ScaleConfig).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _ScaleConfig[key];
});
var _ScaleInterpolate = require("./types/ScaleInterpolate");
Object.keys(_ScaleInterpolate).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _ScaleInterpolate[key];
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -1,25 +0,5 @@

declare type StringLike = string | {
toString(): string;
};
declare type Numeric = number | {
valueOf(): number;
};
export declare type BandConfig<Datum extends StringLike> = {
/** Sets the output values of the scale, which are numbers for band scales. */
range?: [Numeric, Numeric];
/** Sets the output values of the scale while setting its interpolator to round. If the elements are not numbers, they will be coerced to numbers. */
rangeRound?: [Numeric, Numeric];
/** Sets the input values of the scale, which are strings for band scales. */
domain?: Datum[];
/** 0-1, determines how any leftover unused space in the range is distributed. 0.5 distributes it equally left and right. */
align?: number;
/** 0-1, determines the ratio of the range that is reserved for blank space before the first point and after the last. */
padding?: number;
/** 0-1, determines the ratio of the range that is reserved for blank space _between_ bands. */
paddingInner?: number;
/** 0-1, determines the ratio of the range that is reserved for blank space before the first band and after the last band. */
paddingOuter?: number;
tickFormat?: unknown;
};
export default function bandScale<Datum extends StringLike = StringLike>({ range, rangeRound, domain, padding, paddingInner, paddingOuter, align, tickFormat, }: BandConfig<Datum>): import("d3-scale").ScaleBand<Datum>;
export {};
import { DefaultOutput, StringLike } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateBandScale: <Output = DefaultOutput, DiscreteInput extends StringLike = StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleBand<DiscreteInput>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"band", DiscreteInput[], [number | import("../types/Base").NumberLike, number | import("../types/Base").NumberLike]>, "reverse" | "type" | "domain" | "range" | "align" | "padding" | "paddingInner" | "paddingOuter" | "round">, "reverse" | "domain" | "range" | "align" | "padding" | "paddingInner" | "paddingOuter" | "round"> | undefined) => import("d3-scale").ScaleBand<DiscreteInput>;
export default function createBandScale<DiscreteInput extends StringLike = StringLike>(config?: PickScaleConfigWithoutType<'band', DefaultOutput, DiscreteInput>): import("d3-scale").ScaleBand<DiscreteInput>;
//# sourceMappingURL=band.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = bandScale;
exports.default = createBandScale;
exports.updateBandScale = void 0;
var _d3Scale = require("d3-scale");
function bandScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
padding = _ref.padding,
paddingInner = _ref.paddingInner,
paddingOuter = _ref.paddingOuter,
align = _ref.align,
tickFormat = _ref.tickFormat;
var scale = (0, _d3Scale.scaleBand)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (padding) scale.padding(padding);
if (paddingInner) scale.paddingInner(paddingInner);
if (paddingOuter) scale.paddingOuter(paddingOuter);
if (align) scale.align(align); // @TODO should likely get rid of these.
// @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
if (tickFormat) scale.tickFormat = tickFormat; // @ts-ignore
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
scale.type = 'band';
return scale;
var updateBandScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'align', 'padding', 'round');
exports.updateBandScale = updateBandScale;
function createBandScale(config) {
return updateBandScale((0, _d3Scale.scaleBand)(), config);
}

@@ -1,13 +0,5 @@

export declare type LinearConfig<Output> = {
/** Sets the input values of the scale, which are numbers for a linear scale. */
domain?: number[];
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output values of the scale while setting its interpolator to round. If the elements are not numbers, they will be coerced to numbers. */
rangeRound?: number[];
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Whether the scale should clamp values to within the range. */
clamp?: boolean;
};
export default function linearScale<Output>({ range, rangeRound, domain, nice, clamp, }: LinearConfig<Output>): import("d3-scale").ScaleLinear<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateLinearScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleLinear<Output, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"linear", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round" | "zero">, "reverse" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round" | "zero"> | undefined) => import("d3-scale").ScaleLinear<Output, Output>;
export default function createLinearScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'linear', Output>): import("d3-scale").ScaleLinear<Output, Output>;
//# sourceMappingURL=linear.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = linearScale;
exports.default = createLinearScale;
exports.updateLinearScale = void 0;
var _d3Scale = require("d3-scale");
function linearScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = (0, _d3Scale.scaleLinear)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'linear';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateLinearScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');
exports.updateLinearScale = updateLinearScale;
function createLinearScale(config) {
return updateLinearScale((0, _d3Scale.scaleLinear)(), config);
}

@@ -1,15 +0,5 @@

export declare type LogConfig<Output> = {
/** Sets the input values of the scale, which are numbers for a log scale. */
domain?: number[];
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output values of the scale while setting its interpolator to round. If the elements are not numbers, they will be coerced to numbers. */
rangeRound?: number[];
/** Sets the base for this logarithmic scale (defaults to 10). */
base?: number;
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Whether the scale should clamp values to within the range. */
clamp?: boolean;
};
export default function logScale<Output>({ range, rangeRound, domain, base, nice, clamp, }: LogConfig<Output>): import("d3-scale").ScaleLogarithmic<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateLogScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleLogarithmic<Output, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"log", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range" | "base" | "clamp" | "interpolate" | "nice" | "round">, "reverse" | "domain" | "range" | "base" | "clamp" | "interpolate" | "nice" | "round"> | undefined) => import("d3-scale").ScaleLogarithmic<Output, Output>;
export default function createLogScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'log', Output>): import("d3-scale").ScaleLogarithmic<Output, Output>;
//# sourceMappingURL=log.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = logScale;
exports.default = createLogScale;
exports.updateLogScale = void 0;
var _d3Scale = require("d3-scale");
function logScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
base = _ref.base,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = (0, _d3Scale.scaleLog)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true);
if (base) scale.base(base); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'log';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateLogScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'base', 'clamp', 'interpolate', 'nice', 'round');
exports.updateLogScale = updateLogScale;
function createLogScale(config) {
return updateLogScale((0, _d3Scale.scaleLog)(), config);
}

@@ -1,13 +0,5 @@

export declare type OrdinalConfig<Input, Output> = {
/** Sets the input values of the scale, which are strings for an ordinal scale. */
domain?: Input[];
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output value of the scale for unknown input values. */
unknown?: Output | {
name: 'implicit';
};
};
export default function ordinalScale<Input extends {
toString(): string;
}, Output>({ range, domain, unknown, }: OrdinalConfig<Input, Output>): import("d3-scale").ScaleOrdinal<Input, Output>;
import { DefaultOutput, StringLike } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateOrdinalScale: <Output = DefaultOutput, DiscreteInput extends StringLike = StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleOrdinal<DiscreteInput, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"ordinal", DiscreteInput[], Output[]>, "reverse" | "type" | "domain" | "range" | "unknown">, "reverse" | "domain" | "range" | "unknown"> | undefined) => import("d3-scale").ScaleOrdinal<DiscreteInput, Output>;
export default function createOrdinalScale<DiscreteInput extends StringLike = StringLike, Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'ordinal', Output, DiscreteInput>): import("d3-scale").ScaleOrdinal<DiscreteInput, Output>;
//# sourceMappingURL=ordinal.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = ordinalScale;
exports.default = createOrdinalScale;
exports.updateOrdinalScale = void 0;
var _d3Scale = require("d3-scale");
function ordinalScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
unknown = _ref.unknown;
var scale = (0, _d3Scale.scaleOrdinal)();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (unknown) scale.unknown(unknown); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'ordinal';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateOrdinalScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'unknown');
exports.updateOrdinalScale = updateOrdinalScale;
function createOrdinalScale(config) {
return updateOrdinalScale((0, _d3Scale.scaleOrdinal)(), config);
}

@@ -1,13 +0,5 @@

export declare type PointConfig<Input> = {
/** Sets the output values of the scale, which are numbers for point scales. */
range?: [number, number];
/** Sets the output values of the scale while setting its interpolator to round. */
rangeRound?: [number, number];
/** Sets the input values of the scale. */
domain?: Input[];
/** 0-1, determines the ratio of the range that is reserved for blank space before the first point and after the last. */
padding?: number;
/** 0-1, determines how any leftover unused space in the range is distributed. 0.5 distributes it equally left and right. */
align?: number;
};
export default function pointScale<Input>({ range, rangeRound, domain, padding, align, }: PointConfig<Input>): import("d3-scale").ScalePoint<Input>;
import { DefaultOutput, StringLike } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updatePointScale: <Output = DefaultOutput, DiscreteInput extends StringLike = StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScalePoint<DiscreteInput>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"point", DiscreteInput[], [number | import("../types/Base").NumberLike, number | import("../types/Base").NumberLike]>, "reverse" | "type" | "domain" | "range" | "align" | "padding" | "round">, "reverse" | "domain" | "range" | "align" | "padding" | "round"> | undefined) => import("d3-scale").ScalePoint<DiscreteInput>;
export default function createPointScale<DiscreteInput extends StringLike = StringLike>(config?: PickScaleConfigWithoutType<'point', DefaultOutput, DiscreteInput>): import("d3-scale").ScalePoint<DiscreteInput>;
//# sourceMappingURL=point.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = pointScale;
exports.default = createPointScale;
exports.updatePointScale = void 0;
var _d3Scale = require("d3-scale");
function pointScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
padding = _ref.padding,
align = _ref.align;
var scale = (0, _d3Scale.scalePoint)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (padding) scale.padding(padding);
if (align) scale.align(align); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'point';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updatePointScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'align', 'padding', 'round');
exports.updatePointScale = updatePointScale;
function createPointScale(config) {
return updatePointScale((0, _d3Scale.scalePoint)(), config);
}

@@ -1,15 +0,5 @@

export declare type PowerConfig<Output> = {
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output values of the scale while setting its interpolator to round. They need not be numbers, though numbers are required for invert. */
rangeRound?: number[];
/** Sets the input values of the scalem which are numbers for a power scale. */
domain?: number[];
/** Sets the scale's exponent to the given number, defaults to 1. This is effectively a linear scale until you set a different exponent. */
exponent?: number;
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Whether the scale should clamp values to within the range. */
clamp?: boolean;
};
export default function powerScale<Output>({ range, rangeRound, domain, exponent, nice, clamp, }: PowerConfig<Output>): import("d3-scale").ScalePower<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updatePowScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScalePower<Output, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"pow", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range" | "clamp" | "exponent" | "interpolate" | "nice" | "round" | "zero">, "reverse" | "domain" | "range" | "clamp" | "exponent" | "interpolate" | "nice" | "round" | "zero"> | undefined) => import("d3-scale").ScalePower<Output, Output>;
export default function createPowScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'pow', Output>): import("d3-scale").ScalePower<Output, Output>;
//# sourceMappingURL=power.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = powerScale;
exports.default = createPowScale;
exports.updatePowScale = void 0;
var _d3Scale = require("d3-scale");
function powerScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
exponent = _ref.exponent,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = (0, _d3Scale.scalePow)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true);
if (exponent) scale.exponent(exponent); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'power';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updatePowScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'exponent', 'interpolate', 'nice', 'round', 'zero');
exports.updatePowScale = updatePowScale;
function createPowScale(config) {
return updatePowScale((0, _d3Scale.scalePow)(), config);
}

@@ -1,7 +0,5 @@

export declare type QuantileConfig<Output> = {
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the input values of the scale. */
domain?: (number | null | undefined)[];
};
export default function quantileScale<Output>({ range, domain }: QuantileConfig<Output>): import("d3-scale").ScaleQuantile<Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateQuantileScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleQuantile<Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"quantile", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range">, "reverse" | "domain" | "range"> | undefined) => import("d3-scale").ScaleQuantile<Output>;
export default function createQuantileScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'quantile', Output>): import("d3-scale").ScaleQuantile<Output>;
//# sourceMappingURL=quantile.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = quantileScale;
exports.default = createQuantileScale;
exports.updateQuantileScale = void 0;
var _d3Scale = require("d3-scale");
function quantileScale(_ref) {
var range = _ref.range,
domain = _ref.domain;
var scale = (0, _d3Scale.scaleQuantile)();
if (range) scale.range(range);
if (domain) scale.domain(domain); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'quantile';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateQuantileScale = (0, _scaleOperator.default)('domain', 'range', 'reverse');
exports.updateQuantileScale = updateQuantileScale;
function createQuantileScale(config) {
return updateQuantileScale((0, _d3Scale.scaleQuantile)(), config);
}

@@ -1,13 +0,5 @@

export declare type QuantizeConfig<Output> = {
/** Sets the output values of the scale, which are numbers for point scales. */
range?: Output[];
/** Sets the input values of the scale. */
domain?: [number, number];
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Optional approximate number of ticks to be returned. */
ticks?: number;
/** Specifies an approximate tick count and valid format specifier string. */
tickFormat?: [number, string];
};
export default function quantizeScale<Output>({ range, domain, ticks, tickFormat, nice, }: QuantizeConfig<Output>): import("d3-scale").ScaleQuantize<Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateQuantizeScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleQuantize<Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"quantize", [import("../types/ScaleConfig").TimeInput, import("../types/ScaleConfig").TimeInput], Output[]>, "reverse" | "type" | "domain" | "range" | "nice" | "zero">, "reverse" | "domain" | "range" | "nice" | "zero"> | undefined) => import("d3-scale").ScaleQuantize<Output>;
export default function createQuantizeScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'quantize', Output>): import("d3-scale").ScaleQuantize<Output>;
//# sourceMappingURL=quantize.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = quantizeScale;
exports.default = createQuantizeScale;
exports.updateQuantizeScale = void 0;
var _d3Scale = require("d3-scale");
function quantizeScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
ticks = _ref.ticks,
tickFormat = _ref.tickFormat,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice;
var scale = (0, _d3Scale.scaleQuantize)();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (ticks) scale.ticks(ticks);
if (tickFormat) scale.tickFormat.apply(scale, tickFormat); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'quantize';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateQuantizeScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'nice', 'zero');
exports.updateQuantizeScale = updateQuantizeScale;
function createQuantizeScale(config) {
return updateQuantizeScale((0, _d3Scale.scaleQuantize)(), config);
}

@@ -1,3 +0,5 @@

import { PowerConfig } from './power';
export declare type SquareRootConfig<Output> = Omit<PowerConfig<Output>, 'exponent'>;
export default function squareRootScale<Output>(scaleConfig: SquareRootConfig<Output>): import("d3-scale").ScalePower<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateSqrtScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScalePower<Output, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"sqrt", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round" | "zero">, "reverse" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round" | "zero"> | undefined) => import("d3-scale").ScalePower<Output, Output>;
export default function createSqrtScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'sqrt', Output>): import("d3-scale").ScalePower<Output, Output>;
//# sourceMappingURL=squareRoot.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = squareRootScale;
exports.default = createSqrtScale;
exports.updateSqrtScale = void 0;
var _power = _interopRequireDefault(require("./power"));
var _d3Scale = require("d3-scale");
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var updateSqrtScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');
exports.updateSqrtScale = updateSqrtScale;
function squareRootScale(scaleConfig) {
var scale = (0, _power.default)(_extends({}, scaleConfig, {
exponent: 0.5
})); // @ts-ignore
scale.type = 'squareRoot';
return scale;
function createSqrtScale(config) {
return updateSqrtScale((0, _d3Scale.scaleSqrt)(), config);
}

@@ -1,9 +0,5 @@

export declare type SymlogConfig = {
/** Sets the output values of the scale. */
range?: any[];
/** Sets the input values of the scale. */
domain?: any[];
/** Sets the symlog constant to the specified number, defaults to 1. */
constant?: number;
};
export default function symLogScale({ range, domain, constant }: SymlogConfig): import("d3-scale").ScaleSymLog<number, number>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateSymlogScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleSymLog<Output, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"symlog", import("../types/ScaleConfig").ContinuousDomain, Output[]>, "reverse" | "type" | "domain" | "range" | "clamp" | "constant" | "nice" | "zero">, "reverse" | "domain" | "range" | "clamp" | "constant" | "nice" | "zero"> | undefined) => import("d3-scale").ScaleSymLog<Output, Output>;
export default function createSymlogScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'symlog', Output>): import("d3-scale").ScaleSymLog<Output, Output>;
//# sourceMappingURL=symlog.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = symLogScale;
exports.default = createSymlogScale;
exports.updateSymlogScale = void 0;
var _d3Scale = require("d3-scale");
// @ts-ignore no type defs for symlog
function symLogScale(_ref) {
var range = _ref.range,
domain = _ref.domain,
constant = _ref.constant;
var scale = (0, _d3Scale.scaleSymlog)();
if (range) scale.range(range);
if (domain) scale.domain(domain);
if (constant) scale.constant(constant); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'symlog';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateSymlogScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'constant', 'nice', 'zero');
exports.updateSymlogScale = updateSymlogScale;
function createSymlogScale(config) {
return updateSymlogScale((0, _d3Scale.scaleSymlog)(), config);
}

@@ -1,7 +0,6 @@

export declare type ThresholdConfig<Input, Output> = {
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the input values of the scale. */
domain?: Input[];
};
export default function thresholdScale<Input extends number | string | Date, Output>({ range, domain, }: ThresholdConfig<Input, Output>): import("d3-scale").ScaleThreshold<Input, Output>;
import { DefaultOutput, StringLike } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
import { DefaultThresholdInput } from '../types/Scale';
export declare const updateThresholdScale: <Output = DefaultOutput, DiscreteInput extends StringLike = StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleThreshold<ThresholdInput, Output>, config?: Pick<Pick<import("../types/BaseScaleConfig").BaseScaleConfig<"threshold", ThresholdInput[], Output[]>, "reverse" | "type" | "domain" | "range">, "reverse" | "domain" | "range"> | undefined) => import("d3-scale").ScaleThreshold<ThresholdInput, Output>;
export default function createThresholdScale<ThresholdInput extends DefaultThresholdInput = DefaultThresholdInput, Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'threshold', Output, StringLike, ThresholdInput>): import("d3-scale").ScaleThreshold<ThresholdInput, Output>;
//# sourceMappingURL=threshold.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = thresholdScale;
exports.default = createThresholdScale;
exports.updateThresholdScale = void 0;
var _d3Scale = require("d3-scale");
function thresholdScale(_ref) {
var range = _ref.range,
domain = _ref.domain;
var scale = (0, _d3Scale.scaleThreshold)();
if (range) scale.range(range);
if (domain) scale.domain(domain); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'threshold';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateThresholdScale = (0, _scaleOperator.default)('domain', 'range', 'reverse');
exports.updateThresholdScale = updateThresholdScale;
function createThresholdScale(config) {
return updateThresholdScale((0, _d3Scale.scaleThreshold)(), config);
}

@@ -1,15 +0,5 @@

export declare type TimeConfig<Output> = {
/** Sets the input values of the scale, which are Dates or coercible to numbers for time scales. */
domain?: (Date | number | {
valueOf(): number;
})[];
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output values of the scale while setting its interpolator to round. If the elements are not numbers, they will be coerced to numbers. */
rangeRound?: number[];
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Whether the scale should clamp values to within the range. */
clamp?: boolean;
};
export default function timeScale<Output>({ range, rangeRound, domain, nice, clamp, }: TimeConfig<Output>): import("d3-scale").ScaleTime<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateTimeScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleTime<Output, Output>, config?: Pick<import("../types/ScaleConfig").TimeScaleConfig<Output>, "reverse" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round"> | undefined) => import("d3-scale").ScaleTime<Output, Output>;
export default function createTimeScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'time', Output>): import("d3-scale").ScaleTime<Output, Output>;
//# sourceMappingURL=time.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = timeScale;
exports.default = createTimeScale;
exports.updateTimeScale = void 0;
var _d3Scale = require("d3-scale");
function timeScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = (0, _d3Scale.scaleTime)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'time';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateTimeScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');
exports.updateTimeScale = updateTimeScale;
function createTimeScale(config) {
return updateTimeScale((0, _d3Scale.scaleTime)(), config);
}

@@ -1,15 +0,5 @@

export declare type UtcConfig<Output> = {
/** Sets the input values of the scale, which are Dates or coercible to numbers for UTC time scales. */
domain?: (Date | number | {
valueOf(): number;
})[];
/** Sets the output values of the scale. */
range?: Output[];
/** Sets the output values of the scale while setting its interpolator to round. If the elements are not numbers, they will be coerced to numbers. */
rangeRound?: number[];
/** Extends the domain so that it starts and ends on nice round values. */
nice?: boolean;
/** Whether the scale should clamp values to within the range. */
clamp?: boolean;
};
export default function timeScale<Output>({ range, rangeRound, domain, nice, clamp, }: UtcConfig<Output>): import("d3-scale").ScaleTime<Output, Output>;
import { DefaultOutput } from '../types/Base';
import { PickScaleConfigWithoutType } from '../types/ScaleConfig';
export declare const updateUtcScale: <Output = DefaultOutput, DiscreteInput extends import("../types/Base").StringLike = import("../types/Base").StringLike, ThresholdInput extends string | number | Date = string | number | Date>(scale: import("d3-scale").ScaleTime<Output, Output>, config?: Pick<import("../types/ScaleConfig").UtcScaleConfig<Output>, "reverse" | "domain" | "range" | "clamp" | "interpolate" | "nice" | "round"> | undefined) => import("d3-scale").ScaleTime<Output, Output>;
export default function createUtcScale<Output = DefaultOutput>(config?: PickScaleConfigWithoutType<'utc', Output>): import("d3-scale").ScaleTime<Output, Output>;
//# sourceMappingURL=utc.d.ts.map
"use strict";
exports.__esModule = true;
exports.default = timeScale;
exports.default = createUtcScale;
exports.updateUtcScale = void 0;
var _d3Scale = require("d3-scale");
function timeScale(_ref) {
var range = _ref.range,
rangeRound = _ref.rangeRound,
domain = _ref.domain,
_ref$nice = _ref.nice,
nice = _ref$nice === void 0 ? false : _ref$nice,
_ref$clamp = _ref.clamp,
clamp = _ref$clamp === void 0 ? false : _ref$clamp;
var scale = (0, _d3Scale.scaleUtc)();
if (range) scale.range(range);
if (rangeRound) scale.rangeRound(rangeRound);
if (domain) scale.domain(domain);
if (nice) scale.nice();
if (clamp) scale.clamp(true); // @ts-ignore
var _scaleOperator = _interopRequireDefault(require("../operators/scaleOperator"));
scale.type = 'utc';
return scale;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var updateUtcScale = (0, _scaleOperator.default)('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');
exports.updateUtcScale = updateUtcScale;
function createUtcScale(config) {
return updateUtcScale((0, _d3Scale.scaleUtc)(), config);
}
{
"name": "@vx/scale",
"version": "0.0.198",
"version": "0.0.199",
"description": "vx scale",

@@ -24,3 +24,6 @@ "sideEffects": false,

],
"author": "@hshoff",
"authors": [
"@hshoff",
"@kristw"
],
"license": "MIT",

@@ -32,4 +35,8 @@ "bugs": {

"dependencies": {
"@types/d3-interpolate": "^1.3.1",
"@types/d3-scale": "^2.1.1",
"d3-scale": "^2.2.2"
"@types/d3-time": "^1.0.10",
"d3-interpolate": "^1.4.0",
"d3-scale": "^3.0.1",
"d3-time": "^1.1.0"
},

@@ -39,3 +46,3 @@ "publishConfig": {

},
"gitHead": "4a418928be63a12834accbae246a69136c2e8c19"
"gitHead": "b7fd57c8dede777c4983203046a704f52a61e226"
}

@@ -36,3 +36,4 @@ # @vx/scale

domain: [minX, maxX], // x-coordinate data values
rangeRound: [0, graphWidth], // svg x-coordinates, svg x-coordinates increase left to right
range: [0, graphWidth], // svg x-coordinates, svg x-coordinates increase left to right
round: true,
});

@@ -44,3 +45,4 @@

// so that minY in data space maps to graphHeight in svg y-coordinate space
rangeRound: [graphHeight, 0],
range: [graphHeight, 0],
round: true,
});

@@ -68,3 +70,3 @@

range,
rangeRound,
round,
domain,

@@ -87,3 +89,3 @@ padding,

range,
rangeRound,
round,
domain,

@@ -106,3 +108,3 @@ nice = false,

range,
rangeRound,
round,
domain,

@@ -142,3 +144,3 @@ base,

range,
rangeRound,
round,
domain,

@@ -162,3 +164,3 @@ padding,

range,
rangeRound,
round,
domain,

@@ -183,3 +185,3 @@ exponent,

range,
rangeRound,
round,
domain,

@@ -202,3 +204,3 @@ nice = false,

range,
rangeRound,
round,
domain,

@@ -219,3 +221,3 @@ nice = false,

range,
rangeRound,
round,
domain,

@@ -222,0 +224,0 @@ nice = false,

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc