0.1.7 • Published 5 years ago

loompy v0.1.7

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

loompy

This package provides a way to create loompy files in Node.

Installation

This package depends on hdf5.node, you need to specify your libhdf5 location when installing for this dependency to compile correctly. Read their readme for more details.

Example:

npm install loompy --hdf5_home_linux=/usr/lib/x86_64-linux-gnu/hdf5/serial

API

loompy.create(filename, matrix, rowAttrs, colAttrs)

argumenttypecomment
filenamestringPath of the file to create
matrixTypedArray[]Matrix of data, as an array of TypedArrays
rowAttrsObject<string:Array>Row attributes
colAttrsObject<string:Array>Column attributes

Example:

const loompy = require('loompy')


const filename = 'example.loom'

const matrix =
  Array(10).fill(0).map((_, i) =>
    new Float64Array(10).map((_, j) => j < 5 ? 1 : 2))

const row_attrs = { someTextAttributes: Array.from({ length: 10 }, (_, i) => `Element ${i * i * i}`) }
const col_attrs = { someDoubleAttributes: new Float64Array(10).map((_, i) => i) }

loompy.create(filename, matrix, row_attrs, col_attrs)
0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago