Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
decision-tree-builder
Advanced tools
Readme
A tool to build data classification rules using visual flowchart-style decision tree. Uses d3.js v4 for SVG drawing.
rule1 AND rule2
.node
object that is broadcast with the nodeClick
event as this may cause issues
with d3's internal data structure. You should instead use cloneAndStripNode
or similar to get a distinct copy of the nodes values.0
index represents a false
decision outcome1
index represents a true
decision outcome0110
indicates four decisions were taken to reach a result => false, true, true, false
Initialise with data and options:
let options = {
layout: {
divId: "tree-panel",
svgWidth: 1200,
svgHeight: 1000,
svgMargin: {
top: 20,
right: 90,
bottom: 30,
left: 90
},
nodeWidth: 250,
nodeHeight: 250,
nodeMargin: {
x: 100,
y: 250
},
zoomScale: [-1, 100],
transitionDuration: 750
},
// defined for use with `queryDecisionTree` example
operatorFunctions: {
equal: function(a, b){
return new Promise((resolve, reject) => {
resolve(a == b);
});
}
}
};
let myBuilder = new DecisionTreeBuilder(treeData, options); // see demo for expected data format
Then listen for nodeClick
events, you will be passed the target node in the event detail:
window.addEventListener('nodeClick', function (e) {
var node = e.detail;
// perform action with the node..
});
You can optionally color stroke of nodes and links based on their truthy/falsey status, see demo.css
for example.
addChildNodes(node, newNodesData)
updateDecisionNodeData(node, newData)
pruneNode(node)
serialiseTreeToJSON()
queryDecisionTree(target)
// returns the value of resulting leaf node, and a binary path to the result.setHighlighted(node, ignoreToggleState)
fitBounds(paddingPercent, transitionDuration)
adjustBounds(offset)
destroy()
See demo.js
for example.
The MIT License (MIT)
FAQs
A tool to build data classification rules using visual flowchart-style decision tree
The npm package decision-tree-builder receives a total of 18 weekly downloads. As such, decision-tree-builder popularity was classified as not popular.
We found that decision-tree-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.