
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
entitree-flex
Advanced tools
This is the core package that fuels the iconic https://www.entitree.com website!
In a paper from 2013, A.J. van der Ploeg enhanced the Tidy Tree (Reingold-Tilford) algorithm to allow for variable-sized nodes, while keeping its linear runtime nature. He described the algorithm in his paper, Drawing Non-layered Tidy Trees in Linear Time. The author also provided a working Java application on GitHub at https://github.com/cwi-swat/non-layered-tidy-trees
This package take it to the next level by allowing also side nodes, very useful if you are drawing family trees and pedigrees.
npm i entitree-flex
OR
yarn add entitree-flex
It does come with TS definitions
const { layoutFromNested } = require("entitree-flex")
//or
import { layoutFromNested } from "entitree-flex"
const tree = {
name: "root",
width: 60,
height: 20,
siblings: [
{ name: "rootSibling1" },
{ name: "rootSibling2"},
],
partners: [{ name: "rootPartner1" }, { name: "rootPartner2" }],
children: [
{
name: "child1",
width: 20,
height: 50,
partners: [
{
name: "child1partner1",
},
],
children: [
{
name: "grandchild1",
children: [
{
name: "grandGrandchild1",
},
],
},
{
name: "grandchild2",
},
],
},
],
parents: [
{
name: "parent1",
parents: [
{
name: "grandParent1",
},
{
name: "grandParent2",
},
],
},
{
name: "parent1",
parents: [
{
name: "grandparent1",
},
],
},
],
};
layoutFromNested(tree [, settings])
and the object will be populated with all the coordinates for a flexible, bidirectional, side-nodes supporting tree
const { layoutFromMap } = require("entitree-flex")
//or
import { layoutFromMap } from "entitree-flex"
const flatTree = {
1: {
name: "root",
width: 14,
childrenIds: [2, 3],
},
2: { name: "child2" },
3: { name: "child3", childrenIds: [4, 5], spousesIds: [6] },
4: { name: "grandChild4" },
5: { name: "grandChild5" },
6: { name: "spouse of child 3" },
};
layoutFromMap(1, flatTree [, settings])
defaultSettings = {
clone: false, // returns a copy of the input, if your application does not allow editing the original object
firstDegreeSpacing: 15, // spacing in px between nodes belonging to the same source, eg children with same parent
secondDegreeSpacing: 20, // spacing in px between nodes not belonging to same parent eg "cousin" nodes
enableFlex: true, // has slightly better perfomance if turned off (node.width, node.height will not be read)
nextAfterAccessor: "partners", // the side node prop used to go sideways, AFTER the current node
nextAfterSpacing: 10, // the spacing of the "side" nodes AFTER the current node
nextBeforeAccessor: "siblings", // the side node prop used to go sideways, BEFORE the current node
nextBeforeSpacing: 10, // the spacing of the "side" nodes BEFORE the current node
nodeHeight: 40, // default node height in px
nodeWidth: 40, // default node width in px
rootX: 0, // set root position if other than 0
rootY: 0, // set root position if other than 0
sourcesAccessor: "parents", // the prop used to go up the ancestors
sourceTargetSpacing: 10, // the "vertical" spacing in vertical layout
targetsAccessor: "children", // what prop to use to pick up children
};
FAQs
Flexible Tree layout supporting ancestors, descendants and side nodes in all 4 orientations
We found that entitree-flex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.