Socket
Socket
Sign inDemoInstall

html-decision-tree

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-decision-tree

Image Description Decision Tree


Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Install size
133 kB
Created
Weekly downloads
 

Readme

Source

HTML Decision Tree

This is a generic library for building a simple web-based decision trees UI. Data is provided in JSON format, which is then displayed on a website.

Installing and Building

The code is in Typescript. After cloning the repository, just type

npm install
npm run-script build

This builds the decisiontree.js library in dist.

Alternative build is done using typescript and webpack:

npx tsc
npx webpack

Or simply install the package using

npm install html-decision-tree

Simple Example

Here is a very simple decision tree for deciding if you should play tennis:

Tennis example

Here is the corresponding flow chart decision tree for deciding if you should play tennis in SVG

Alt Tennis Decision Tree

and in JSON format.

JSON Format

Current node format in some pseudo grammar:

{
type: binary|nary|null,
value: 0-9+,
title: \w*,
content: \w*,
labels: [{
  text: \w*,
  value: 0-9+,
  }],
children: [node*],
action: URL
}

The idea is nary nodes have content (that is the description on the radio button) which is linked via the value to the children . Binary nodes have default description content as Yes (0) and No (1). Actions are only considered in leaf nodes and open a new Tab.

Acknowledgments

  • Amaya Webster for suggesting the initial idea at the 2020 DIAGRAM and ETS Code Sprint
  • Brian Hochhalter for UI design and wireframe design and prototyping
  • Danielle Vargas for CSS styles and accessibility testing and design
  • Carlos Cavalie for accessibility testing and design

Keywords

FAQs

Last updated on 16 Jun 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc