New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-d3-utils

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-d3-utils - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

7

CHANGELOG.md
# Changelog
## [0.5.0](https://www.github.com/zakodium/react-d3-utils/compare/v0.4.0...v0.5.0) (2022-01-31)
### Features
* add style prop to AlignGroup ([#21](https://www.github.com/zakodium/react-d3-utils/issues/21)) ([553369e](https://www.github.com/zakodium/react-d3-utils/commit/553369ee205011d320452f8d74656a90a1769a2c))
## [0.4.0](https://www.github.com/zakodium/react-d3-utils/compare/v0.3.0...v0.4.0) (2022-01-24)

@@ -4,0 +11,0 @@

3

lib-esm/components/AlignGroup.d.ts

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

import { ReactNode } from 'react';
import { ReactNode, CSSProperties } from 'react';
export declare type Align = 'start' | 'middle' | 'end' | 'none';

@@ -6,2 +6,3 @@ export interface AlignGroupProps {

y?: number;
style?: CSSProperties;
verticalAlign?: Align;

@@ -8,0 +9,0 @@ horizontalAlign?: Align;

@@ -24,8 +24,8 @@ import { jsx as _jsx } from "react/jsx-runtime";

export function AlignGroup(props) {
const { x = 0, y = 0, verticalAlign = 'start', horizontalAlign = 'start', children, } = props;
const { x = 0, y = 0, verticalAlign = 'start', horizontalAlign = 'start', children, style = {}, } = props;
const observed = useBBoxObserver();
const xPosition = useMemo(() => calculatePosition(x - observed.x, horizontalAlign, observed.width || 0, x), [x, observed.x, observed.width, horizontalAlign]);
const yPosition = useMemo(() => calculatePosition(y - observed.y, verticalAlign, observed.height || 0, y), [y, observed.y, observed.height, verticalAlign]);
return (_jsx("g", { ref: observed.ref, transform: `translate(${xPosition}, ${yPosition})`, children: children }, void 0));
return (_jsx("g", { style: style, ref: observed.ref, transform: `translate(${xPosition}, ${yPosition})`, children: children }, void 0));
}
//# sourceMappingURL=AlignGroup.js.map

@@ -27,8 +27,8 @@ "use strict";

function AlignGroup(props) {
const { x = 0, y = 0, verticalAlign = 'start', horizontalAlign = 'start', children, } = props;
const { x = 0, y = 0, verticalAlign = 'start', horizontalAlign = 'start', children, style = {}, } = props;
const observed = (0, useBBoxObserver_1.useBBoxObserver)();
const xPosition = (0, react_1.useMemo)(() => calculatePosition(x - observed.x, horizontalAlign, observed.width || 0, x), [x, observed.x, observed.width, horizontalAlign]);
const yPosition = (0, react_1.useMemo)(() => calculatePosition(y - observed.y, verticalAlign, observed.height || 0, y), [y, observed.y, observed.height, verticalAlign]);
return ((0, jsx_runtime_1.jsx)("g", { ref: observed.ref, transform: `translate(${xPosition}, ${yPosition})`, children: children }, void 0));
return ((0, jsx_runtime_1.jsx)("g", { style: style, ref: observed.ref, transform: `translate(${xPosition}, ${yPosition})`, children: children }, void 0));
}
exports.AlignGroup = AlignGroup;
{
"name": "react-d3-utils",
"version": "0.4.0",
"version": "0.5.0",
"description": "Low-level utilities to build charts with React and D3",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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