victory-create-container
Advanced tools
+6
-1
| import * as React from "react"; | ||
| export type ContainerType = "brush" | "cursor" | "selection" | "voronoi" | "zoom"; | ||
| export type ContainerType = | ||
| | "brush" | ||
| | "cursor" | ||
| | "selection" | ||
| | "voronoi" | ||
| | "zoom"; | ||
| export function createContainer<V, W>( | ||
@@ -5,0 +10,0 @@ c1: ContainerType, |
+6
-1
| import * as React from "react"; | ||
| export type ContainerType = "brush" | "cursor" | "selection" | "voronoi" | "zoom"; | ||
| export type ContainerType = | ||
| | "brush" | ||
| | "cursor" | ||
| | "selection" | ||
| | "voronoi" | ||
| | "zoom"; | ||
| export function createContainer<V, W>( | ||
@@ -5,0 +10,0 @@ c1: ContainerType, |
+7
-7
| { | ||
| "name": "victory-create-container", | ||
| "version": "35.8.5", | ||
| "version": "35.9.0", | ||
| "description": "Container Helper for Victory", | ||
@@ -23,8 +23,8 @@ "keywords": [ | ||
| "lodash": "^4.17.19", | ||
| "victory-brush-container": "^35.8.5", | ||
| "victory-core": "^35.8.1", | ||
| "victory-cursor-container": "^35.8.1", | ||
| "victory-selection-container": "^35.8.1", | ||
| "victory-voronoi-container": "^35.8.4", | ||
| "victory-zoom-container": "^35.8.1" | ||
| "victory-brush-container": "^35.9.0", | ||
| "victory-core": "^35.9.0", | ||
| "victory-cursor-container": "^35.9.0", | ||
| "victory-selection-container": "^35.9.0", | ||
| "victory-voronoi-container": "^35.9.0", | ||
| "victory-zoom-container": "^35.9.0" | ||
| }, | ||
@@ -31,0 +31,0 @@ "scripts": { |
+37
-18
@@ -1,2 +0,11 @@ | ||
| import { toPairs, groupBy, forOwn, includes, flow, isEmpty, isFunction, keys } from "lodash"; | ||
| import { | ||
| toPairs, | ||
| groupBy, | ||
| forOwn, | ||
| includes, | ||
| flow, | ||
| isEmpty, | ||
| isFunction, | ||
| keys | ||
| } from "lodash"; | ||
| import { VictoryContainer, Log } from "victory-core"; | ||
@@ -52,3 +61,5 @@ import { voronoiContainerMixin } from "victory-voronoi-container"; | ||
| target, | ||
| eventHandlers: combineEventHandlers(eventsArray.map((event) => event.eventHandlers)) | ||
| eventHandlers: combineEventHandlers( | ||
| eventsArray.map((event) => event.eventHandlers) | ||
| ) | ||
| // note: does not currently handle eventKey or childName | ||
@@ -110,26 +121,34 @@ }; | ||
| if (behavior && !includes(behaviors, behavior)) { | ||
| Log.warn(`"${behavior}" is not a valid behavior. Choose from [${behaviors.join(", ")}].`); | ||
| Log.warn( | ||
| `"${behavior}" is not a valid behavior. Choose from [${behaviors.join( | ||
| ", " | ||
| )}].` | ||
| ); | ||
| } | ||
| }; | ||
| const makeCreateContainerFunction = (mixinMap, Container) => (behaviorA, behaviorB, ...invalid) => { | ||
| // eslint-disable-line | ||
| const behaviors = keys(mixinMap); | ||
| const makeCreateContainerFunction = | ||
| (mixinMap, Container) => | ||
| (behaviorA, behaviorB, ...invalid) => { | ||
| // eslint-disable-line | ||
| const behaviors = keys(mixinMap); | ||
| checkBehaviorName(behaviorA, behaviors); | ||
| checkBehaviorName(behaviorB, behaviors); | ||
| checkBehaviorName(behaviorA, behaviors); | ||
| checkBehaviorName(behaviorB, behaviors); | ||
| if (invalid.length) { | ||
| Log.warn("too many arguments given to createContainer (maximum accepted: 2)."); | ||
| } | ||
| if (invalid.length) { | ||
| Log.warn( | ||
| "too many arguments given to createContainer (maximum accepted: 2)." | ||
| ); | ||
| } | ||
| const firstMixins = mixinMap[behaviorA]; | ||
| const secondMixins = mixinMap[behaviorB] || []; | ||
| const firstMixins = mixinMap[behaviorA]; | ||
| const secondMixins = mixinMap[behaviorB] || []; | ||
| if (!firstMixins) { | ||
| return Container; | ||
| } | ||
| if (!firstMixins) { | ||
| return Container; | ||
| } | ||
| return combineContainerMixins([...firstMixins, ...secondMixins], Container); | ||
| }; | ||
| return combineContainerMixins([...firstMixins, ...secondMixins], Container); | ||
| }; | ||
@@ -136,0 +155,0 @@ const createContainer = makeCreateContainerFunction( |
+6
-1
| import * as React from "react"; | ||
| export type ContainerType = "brush" | "cursor" | "selection" | "voronoi" | "zoom"; | ||
| export type ContainerType = | ||
| | "brush" | ||
| | "cursor" | ||
| | "selection" | ||
| | "voronoi" | ||
| | "zoom"; | ||
| export function createContainer<V, W>( | ||
@@ -5,0 +10,0 @@ c1: ContainerType, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1574373
0.06%26740
0.18%40
2.56%