overlapping-ranges-layout

1.0.1 • Public • Published

overlapping-ranges-layout

overlapping-ranges-layout

npm version build status ISC-licensed minimum Node.js version chat with me on Gitter support me on Patreon

Installation

npm install overlapping-ranges-layout

Usage

const computeLayout = require('overlapping-ranges-layout')
 
// see also the flatten-overlapping-ranges package
// ---A---
//   -----B------
//      --C--
//         ----D---
const sections = [
    [2, ['A'               ]],
    [3, ['A', 'B'          ]],
    [2, ['A', 'B', 'C'     ]],
    [1, [     'B', 'C'     ]],
    [2, [     'B', 'C', 'D']],
    [1, [     'B',      'D']],
    [2, [               'D']]
]
 
const layout = computeLayout(sections)
console.log(layout)
[
    [2, ['A'           ]],
    [3, ['A',  'B'     ]],
    [2, ['A',  'B', 'C']],
    [1, [null, 'B', 'C']],
    [2, ['D',  'B', 'C']],
    [1, ['D',  'B'     ]],
    [2, ['D'           ]]
]

Contributing

If you have a question or need support using overlapping-ranges-layout, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

Readme

Keywords

Package Sidebar

Install

npm i overlapping-ranges-layout

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

4.84 kB

Total Files

5

Last publish

Collaborators

  • derhuerst