Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

victory-zoom-container

Package Overview
Dependencies
Maintainers
16
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-zoom-container - npm Package Compare versions

Comparing version 37.3.2 to 37.3.3

6

CHANGELOG.md
# victory-zoom-container
## 37.3.3
### Patch Changes
- Remove deprecated babel-plugin-lodash plugin ([#2965](https://github.com/FormidableLabs/victory/pull/2965))
## 37.3.2

@@ -4,0 +10,0 @@

68

es/victory-zoom-container.d.ts
import React from "react";
import { VictoryContainerProps, DomainTuple, VictoryEventHandler } from "victory-core";
export declare type ZoomDimensionType = "x" | "y";
export declare type ZoomDomain = {
export type ZoomDimensionType = "x" | "y";
export type ZoomDomain = {
x: DomainTuple;

@@ -44,35 +44,35 @@ y: DomainTuple;

clipContainerComponent: JSX.Element;
disable?: boolean | undefined;
downsample?: number | boolean | undefined;
disable?: boolean;
downsample?: number | boolean;
minimumZoom?: {
x?: number | undefined;
y?: number | undefined;
} | undefined;
onZoomDomainChange?: ((domain: ZoomDomain, props: VictoryZoomContainerProps) => void) | undefined;
zoomDimension?: ZoomDimensionType | undefined;
zoomDomain?: Partial<ZoomDomain> | undefined;
horizontal?: boolean | undefined;
"aria-describedby"?: string | undefined;
"aria-labelledby"?: string | undefined;
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
className?: string | undefined;
containerId?: string | number | undefined;
containerRef?: React.Ref<HTMLElement> | undefined;
desc?: string | undefined;
events?: React.DOMAttributes<any> | undefined;
height?: number | undefined;
name?: string | undefined;
portalComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
portalZIndex?: number | undefined;
preserveAspectRatio?: string | undefined;
responsive?: boolean | undefined;
role?: string | undefined;
style?: React.CSSProperties | undefined;
tabIndex?: number | undefined;
theme?: import("victory-core").VictoryThemeDefinition | undefined;
title?: string | undefined;
width?: number | undefined;
ouiaId?: string | number | undefined;
ouiaSafe?: boolean | undefined;
ouiaType?: string | undefined;
x?: number;
y?: number;
};
onZoomDomainChange?: (domain: ZoomDomain, props: VictoryZoomContainerProps) => void;
zoomDimension?: ZoomDimensionType;
zoomDomain?: Partial<ZoomDomain>;
horizontal?: boolean;
"aria-describedby"?: string;
"aria-labelledby"?: string;
children?: React.ReactElement | React.ReactElement[];
className?: string;
containerId?: number | string;
containerRef?: React.Ref<HTMLElement>;
desc?: string;
events?: React.DOMAttributes<any>;
height?: number;
name?: string;
portalComponent?: React.ReactElement;
portalZIndex?: number;
preserveAspectRatio?: string;
responsive?: boolean;
role?: string;
style?: React.CSSProperties;
tabIndex?: number;
theme?: import("victory-core").VictoryThemeDefinition;
title?: string;
width?: number;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
zoomActive: boolean;

@@ -79,0 +79,0 @@ };

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

import _defaults from "lodash/defaults";
import React from "react";
import { ZoomHelpers } from "./zoom-helpers";
import { VictoryClipContainer, VictoryContainer, Data } from "victory-core";
import defaults from "lodash/defaults";
const DEFAULT_DOWNSAMPLE = 150;

@@ -66,5 +66,5 @@ export const VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS = {

const isDataComponent = Data.isDataComponent(child);
const originalDomain = _defaults({}, props.originalDomain, props.domain);
const zoomDomain = _defaults({}, props.zoomDomain, props.domain);
const cachedZoomDomain = _defaults({}, props.cachedZoomDomain, props.domain);
const originalDomain = defaults({}, props.originalDomain, props.domain);
const zoomDomain = defaults({}, props.zoomDomain, props.domain);
const cachedZoomDomain = defaults({}, props.cachedZoomDomain, props.domain);
let domain;

@@ -79,3 +79,3 @@ if (!ZoomHelpers.checkDomainEquality(zoomDomain, cachedZoomDomain)) {

// default: use currentDomain, set by the event handlers
domain = _defaults({}, currentDomain, originalDomain);
domain = defaults({}, currentDomain, originalDomain);
}

@@ -101,3 +101,3 @@ let newDomain = props.polar ? {

};
const newChild = /*#__PURE__*/React.cloneElement(child, _defaults(childProps, child.props));
const newChild = /*#__PURE__*/React.cloneElement(child, defaults(childProps, child.props));

@@ -104,0 +104,0 @@ // Clip data components

@@ -1,2 +0,1 @@

/// <reference types="lodash" />
import { Selection } from "victory-core";

@@ -3,0 +2,0 @@ export declare const RawZoomHelpers: {

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

import _delay from "lodash/delay";
import _defaults from "lodash/defaults";
import _throttle from "lodash/throttle";
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 1000] }]*/
import { Children } from "react";
import defaults from "lodash/defaults";
import delay from "lodash/delay";
import throttle from "lodash/throttle";
import { Helpers, Selection, Collection, Wrapper } from "victory-core";

@@ -138,3 +138,3 @@ export const RawZoomHelpers = {

// delay the callback that resumes animation by ~1 frame so that animation does not interfere with wheel events
return _delay(resumeAnimation, 16); // eslint-disable-line no-magic-numbers
return delay(resumeAnimation, 16); // eslint-disable-line no-magic-numbers
},

@@ -149,5 +149,5 @@ getLastDomain(targetProps, originalDomain) {

if (zoomDomain && !this.checkDomainEquality(zoomDomain, cachedZoomDomain)) {
return _defaults({}, zoomDomain, domain);
return defaults({}, zoomDomain, domain);
}
return _defaults({}, currentDomain || zoomDomain || originalDomain, domain);
return defaults({}, currentDomain || zoomDomain || originalDomain, domain);
},

@@ -171,3 +171,3 @@ getDomain(props) {

}
return _defaults({}, childrenDomain, originalDomain, domain);
return defaults({}, childrenDomain, originalDomain, domain);
},

@@ -263,3 +263,3 @@ onMouseDown(evt, targetProps) {

if (Helpers.isFunction(onZoomDomainChange)) {
onZoomDomainChange(currentDomain, _defaults({}, mutatedProps, targetProps));
onZoomDomainChange(currentDomain, defaults({}, mutatedProps, targetProps));
}

@@ -308,3 +308,3 @@ return [{

if (Helpers.isFunction(onZoomDomainChange)) {
onZoomDomainChange(currentDomain, _defaults({}, mutatedProps, targetProps));
onZoomDomainChange(currentDomain, defaults({}, mutatedProps, targetProps));
}

@@ -323,3 +323,3 @@ return [{

onMouseLeave: RawZoomHelpers.onMouseLeave.bind(RawZoomHelpers),
onMouseMove: _throttle(RawZoomHelpers.onMouseMove.bind(RawZoomHelpers), 16,
onMouseMove: throttle(RawZoomHelpers.onMouseMove.bind(RawZoomHelpers), 16,
// eslint-disable-line no-magic-numbers

@@ -330,3 +330,3 @@ {

}),
onWheel: _throttle(RawZoomHelpers.onWheel.bind(RawZoomHelpers), 16,
onWheel: throttle(RawZoomHelpers.onWheel.bind(RawZoomHelpers), 16,
// eslint-disable-line no-magic-numbers

@@ -333,0 +333,0 @@ {

import React from "react";
import { VictoryContainerProps, DomainTuple, VictoryEventHandler } from "victory-core";
export declare type ZoomDimensionType = "x" | "y";
export declare type ZoomDomain = {
export type ZoomDimensionType = "x" | "y";
export type ZoomDomain = {
x: DomainTuple;

@@ -44,35 +44,35 @@ y: DomainTuple;

clipContainerComponent: JSX.Element;
disable?: boolean | undefined;
downsample?: number | boolean | undefined;
disable?: boolean;
downsample?: number | boolean;
minimumZoom?: {
x?: number | undefined;
y?: number | undefined;
} | undefined;
onZoomDomainChange?: ((domain: ZoomDomain, props: VictoryZoomContainerProps) => void) | undefined;
zoomDimension?: ZoomDimensionType | undefined;
zoomDomain?: Partial<ZoomDomain> | undefined;
horizontal?: boolean | undefined;
"aria-describedby"?: string | undefined;
"aria-labelledby"?: string | undefined;
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
className?: string | undefined;
containerId?: string | number | undefined;
containerRef?: React.Ref<HTMLElement> | undefined;
desc?: string | undefined;
events?: React.DOMAttributes<any> | undefined;
height?: number | undefined;
name?: string | undefined;
portalComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
portalZIndex?: number | undefined;
preserveAspectRatio?: string | undefined;
responsive?: boolean | undefined;
role?: string | undefined;
style?: React.CSSProperties | undefined;
tabIndex?: number | undefined;
theme?: import("victory-core").VictoryThemeDefinition | undefined;
title?: string | undefined;
width?: number | undefined;
ouiaId?: string | number | undefined;
ouiaSafe?: boolean | undefined;
ouiaType?: string | undefined;
x?: number;
y?: number;
};
onZoomDomainChange?: (domain: ZoomDomain, props: VictoryZoomContainerProps) => void;
zoomDimension?: ZoomDimensionType;
zoomDomain?: Partial<ZoomDomain>;
horizontal?: boolean;
"aria-describedby"?: string;
"aria-labelledby"?: string;
children?: React.ReactElement | React.ReactElement[];
className?: string;
containerId?: number | string;
containerRef?: React.Ref<HTMLElement>;
desc?: string;
events?: React.DOMAttributes<any>;
height?: number;
name?: string;
portalComponent?: React.ReactElement;
portalZIndex?: number;
preserveAspectRatio?: string;
responsive?: boolean;
role?: string;
style?: React.CSSProperties;
tabIndex?: number;
theme?: import("victory-core").VictoryThemeDefinition;
title?: string;
width?: number;
ouiaId?: number | string;
ouiaSafe?: boolean;
ouiaType?: string;
zoomActive: boolean;

@@ -79,0 +79,0 @@ };

@@ -7,6 +7,6 @@ "use strict";

exports.useVictoryZoomContainer = exports.VictoryZoomContainer = exports.VICTORY_ZOOM_CONTAINER_DEFAULT_PROPS = void 0;
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
var _react = _interopRequireDefault(require("react"));
var _zoomHelpers = require("./zoom-helpers");
var _victoryCore = require("victory-core");
var _defaults = _interopRequireDefault(require("lodash/defaults"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -74,5 +74,5 @@ const DEFAULT_DOWNSAMPLE = 150;

const isDataComponent = _victoryCore.Data.isDataComponent(child);
const originalDomain = (0, _defaults2.default)({}, props.originalDomain, props.domain);
const zoomDomain = (0, _defaults2.default)({}, props.zoomDomain, props.domain);
const cachedZoomDomain = (0, _defaults2.default)({}, props.cachedZoomDomain, props.domain);
const originalDomain = (0, _defaults.default)({}, props.originalDomain, props.domain);
const zoomDomain = (0, _defaults.default)({}, props.zoomDomain, props.domain);
const cachedZoomDomain = (0, _defaults.default)({}, props.cachedZoomDomain, props.domain);
let domain;

@@ -87,3 +87,3 @@ if (!_zoomHelpers.ZoomHelpers.checkDomainEquality(zoomDomain, cachedZoomDomain)) {

// default: use currentDomain, set by the event handlers
domain = (0, _defaults2.default)({}, currentDomain, originalDomain);
domain = (0, _defaults.default)({}, currentDomain, originalDomain);
}

@@ -109,3 +109,3 @@ let newDomain = props.polar ? {

};
const newChild = /*#__PURE__*/_react.default.cloneElement(child, (0, _defaults2.default)(childProps, child.props));
const newChild = /*#__PURE__*/_react.default.cloneElement(child, (0, _defaults.default)(childProps, child.props));

@@ -112,0 +112,0 @@ // Clip data components

@@ -1,2 +0,1 @@

/// <reference types="lodash" />
import { Selection } from "victory-core";

@@ -3,0 +2,0 @@ export declare const RawZoomHelpers: {

@@ -7,6 +7,6 @@ "use strict";

exports.ZoomHelpers = exports.RawZoomHelpers = void 0;
var _delay2 = _interopRequireDefault(require("lodash/delay"));
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
var _throttle2 = _interopRequireDefault(require("lodash/throttle"));
var _react = require("react");
var _defaults = _interopRequireDefault(require("lodash/defaults"));
var _delay = _interopRequireDefault(require("lodash/delay"));
var _throttle = _interopRequireDefault(require("lodash/throttle"));
var _victoryCore = require("victory-core");

@@ -147,3 +147,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// delay the callback that resumes animation by ~1 frame so that animation does not interfere with wheel events
return (0, _delay2.default)(resumeAnimation, 16); // eslint-disable-line no-magic-numbers
return (0, _delay.default)(resumeAnimation, 16); // eslint-disable-line no-magic-numbers
},

@@ -158,5 +158,5 @@ getLastDomain(targetProps, originalDomain) {

if (zoomDomain && !this.checkDomainEquality(zoomDomain, cachedZoomDomain)) {
return (0, _defaults2.default)({}, zoomDomain, domain);
return (0, _defaults.default)({}, zoomDomain, domain);
}
return (0, _defaults2.default)({}, currentDomain || zoomDomain || originalDomain, domain);
return (0, _defaults.default)({}, currentDomain || zoomDomain || originalDomain, domain);
},

@@ -180,3 +180,3 @@ getDomain(props) {

}
return (0, _defaults2.default)({}, childrenDomain, originalDomain, domain);
return (0, _defaults.default)({}, childrenDomain, originalDomain, domain);
},

@@ -272,3 +272,3 @@ onMouseDown(evt, targetProps) {

if (_victoryCore.Helpers.isFunction(onZoomDomainChange)) {
onZoomDomainChange(currentDomain, (0, _defaults2.default)({}, mutatedProps, targetProps));
onZoomDomainChange(currentDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
}

@@ -317,3 +317,3 @@ return [{

if (_victoryCore.Helpers.isFunction(onZoomDomainChange)) {
onZoomDomainChange(currentDomain, (0, _defaults2.default)({}, mutatedProps, targetProps));
onZoomDomainChange(currentDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
}

@@ -332,3 +332,3 @@ return [{

onMouseLeave: RawZoomHelpers.onMouseLeave.bind(RawZoomHelpers),
onMouseMove: (0, _throttle2.default)(RawZoomHelpers.onMouseMove.bind(RawZoomHelpers), 16,
onMouseMove: (0, _throttle.default)(RawZoomHelpers.onMouseMove.bind(RawZoomHelpers), 16,
// eslint-disable-line no-magic-numbers

@@ -339,3 +339,3 @@ {

}),
onWheel: (0, _throttle2.default)(RawZoomHelpers.onWheel.bind(RawZoomHelpers), 16,
onWheel: (0, _throttle.default)(RawZoomHelpers.onWheel.bind(RawZoomHelpers), 16,
// eslint-disable-line no-magic-numbers

@@ -342,0 +342,0 @@ {

{
"name": "victory-zoom-container",
"version": "37.3.2",
"version": "37.3.3",
"description": "Interactive Zoom Component for Victory",

@@ -24,3 +24,3 @@ "keywords": [

"lodash": "^4.17.19",
"victory-core": "37.3.2"
"victory-core": "37.3.3"
},

@@ -184,28 +184,2 @@ "peerDependencies": {

},
"format": {
"command": "nps format:pkg",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:fix": {
"command": "pnpm run format || nps format:pkg:fix",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"lint": {

@@ -273,4 +247,2 @@ "command": "eslint src",

"types:create": "wireit",
"format": "wireit",
"format:fix": "wireit",
"lint": "wireit",

@@ -277,0 +249,0 @@ "lint:fix": "wireit",

/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 1000] }]*/
import { Children } from "react";
import defaults from "lodash/defaults";
import delay from "lodash/delay";
import throttle from "lodash/throttle";
import { Helpers, Selection, Collection, Wrapper } from "victory-core";
import { throttle, defaults, delay } from "lodash";

@@ -6,0 +9,0 @@ export const RawZoomHelpers = {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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