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

rete-render-utils

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rete-render-utils

Rete.js Render utils ==== [![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua) [![Discord](https://img.shields.io/discord/1081223198055604244?color=%237289da&label=Discord)](http

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
increased by0.05%
Maintainers
0
Weekly downloads
 
Created
Source

Rete.js Render utils

Made in Ukraine Discord

Rete.js utils

Key features

  • Basic connection paths: provides the classic and loop SVG paths
  • Sockets position: enables the calculation of socket positions
    • DOM-based: calculates the position of sockets using offsetTop/offsetLeft

Getting Started

Before using this package, make sure to install it as a peer and dev dependency into your the render plugin.

This package exposes getDOMSocketPosition, which is a SocketPositionWatcher type and used by default in render plugins.

import { getDOMSocketPosition } from 'rete-render-utils';

const socketsPositionWatcher = getDOMSocketPosition<Schemes, AreaExtra>(area)

socketPositionWatcher.attach(area)

const unwatch = positionWatcher.listen(nodeId, portSide, portKey, (position) => {
  /// called when the socket position changes
})

The render plugins also use its default implementations for rendering connection paths using classicConnectionPath and loopConnectionPath.

import { classicConnectionPath } from 'rete-render-utils';

const curvature = 0.3
const points = [sourcePoint, targetPoint] // should contain two points
const svgPath = classicConnectionPath(points, curvature)

Contribution

Please refer to the Contribution guide

License

MIT

Keywords

FAQs

Package last updated on 30 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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