Skip to content

Commit

Permalink
🐛 docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram77 committed May 9, 2023
1 parent a420cf0 commit 0855262
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 96 deletions.
8 changes: 4 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors:
- family-names: Sahu
given-names: Subhajit
orcid: https://orcid.org/0000-0001-5140-6578
title: "nodef/extra-array: A collection of functions for working with Arrays"
version: 3.1.0
doi: 10.5281/zenodo.7339658
date-released: 2022-11-20
title: "nodef/extra-array: An array is a collection of values, stored contiguously."
version: 4.1.15
doi: 10.5281/zenodo.7913300
date-released: 2023-05-09
73 changes: 33 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,37 @@ An [array] is a collection of values, stored contiguously.<br>
📰 [Docs](https://nodef.github.io/extra-array/),
📘 [Wiki](https://github.com/nodef/extra-array/wiki/).

This package includes common array functions related to querying **about**
arrays, **generating** them, **comparing** one with another, finding their
**length**, **getting** and **setting** elements, obtaining its **properties**,
getting a **part** of it, **rearranging** elements in it, **finding** an element
of a subset of elements in it, performing **functional** operations,
**manipulating** it in various ways, **combining** together arrays or its
elements, of performing **set operations** upon it.
![](https://i.imgur.com/46wYtxW.png)

All functions except `from*()` take array as 1st parameter. Methods like
`swap()` are pure and do not modify the array itself, while methods like
`swap$()` *do modify (update)* the array itself. Some methods accept a map
function for *faster comparision* (like [unique]). I find the map-approach
beautiful, which I learned from Haskell's `sortOn()`. You can notice that I have
followed Javascript naming scheme as far as possible. Some names are borrowed
from Haskell, Python, Java, Processing.
<br>


This package includes comprehensive set of array functions with which you can
**generate** an array, **clone** it, query **about** it, get non-negative
**indices**, manage its **length**, **get/set** elements, fully or partially
**sort** it, obtain **minimum(s)/maximum(s)**, **compare** it with another
array, get a **part** of it, **search a value**, obtain all possible
**arrangements** or **random arrangements**, **find** an element, **take/drop**
elements or **scan** from its beginning or its end, **search** the index of a
part of it, perform **functional** operations, **flatten** multi-level arrays,
obtain **prefix sum**, **manipulate** it in various ways, **count/partition**
elements, **split** it, **concatenate/join** multiple arrays, **rearrange**
elements within it, or performing **set operations** upon it.

With our package, you can simplify the implementation of complex algorithms, and
be able to achieve your goals faster, regardless of your level of expertise. Try
it out today and discover how it can transform your development experience!

We use a consistent naming scheme that helps you quickly identify the functions
you need. All functions except `from*()` take array as 1st parameter. Some
functions operate on a specified range in the array and are called `ranged*()`,
such as `rangedPartialSort()`. Functions like `swap()` are pure and do not
modify the array itself, while functions like `swap$()` *do modify (update)* the
array itself. Some functions accept a map function for *faster comparison*,
such as `unique()`. Further, functions which return an iterable instead of an
array are prefixed with `i`, such as `isubsequences()`. We borrow some names
from other programming languages such as *Haskell*, *Python*, *Java*, and
*Processing*.

This package is available in *Node.js* and *Web* formats. To use it on the web,
simply use the `extra_array` global variable after loading with a `<script>`
Expand All @@ -43,11 +59,11 @@ xarray.get(x, -1);

var x = [1, 2, 3, 4];
xarray.swap(x, 0, 1);
// → [2, 1, 3, 4]
// → [ 2, 1, 3, 4 ]

var x = [1, 2, 3, 4];
xarray.rotate(x, 1);
// → [4, 1, 2, 3]
// → [ 2, 3, 4, 1 ]

xarray.permutations([1, 2, 3]);
// → [
Expand All @@ -66,6 +82,7 @@ xarray.permutations([1, 2, 3]);
<br>



## Index

| Property | Description |
Expand All @@ -83,9 +100,6 @@ xarray.permutations([1, 2, 3]);
| [keys] | Obtain all indices. |
| [values] | Get all values. |
| [entries] | Obtain all index-value pairs. |
| [ikeys] | List all indices. |
| [ivalues] | List all values. |
| [ientries] | List all index-value pairs. |
| | |
| [index] | Get zero-based index for an element in array. |
| [indexRange] | Get zero-based index range for part of array. |
Expand Down Expand Up @@ -115,12 +129,8 @@ xarray.permutations([1, 2, 3]);
| [searchUnsortedValue] | Find first index of an unsorted value. |
| [sort] | Arrange values in order. |
| [sort$] | Arrange values in order! |
| [sortRange] | Arrange a range of values in order. |
| [sortRange$] | Arrange a range of values in order! |
| [partialSort] | Partially arrange values in order. |
| [partialSort$] | Partially arrange values in order! |
| [partialSortRange] | Partially arrange a range of values in order. |
| [partialSortRange$] | Partially arrange a range of values in order! |
| | |
| [minimum] | Find first smallest value. |
| [minimumEntry] | Find first smallest entry. |
Expand Down Expand Up @@ -166,11 +176,6 @@ xarray.permutations([1, 2, 3]);
| [infixes] | Obtain all possible infixes. |
| [subsequences] | Obtain all possible subsequences. |
| [permutations] | Obtain all possible permutations. |
| [iprefixes] | List all possible prefixes. |
| [isuffixes] | List all possible suffixes. |
| [iinfixes] | List all possible infixes. |
| [isubsequences] | List all possible subsequences. |
| [ipermutations] | List all possible permutations. |
| [searchInfix] | Find first index of an infix. |
| [searchInfixRight] | Find last index of an infix. |
| [searchInfixAll] | Find indices of an infix. |
Expand Down Expand Up @@ -325,9 +330,6 @@ xarray.permutations([1, 2, 3]);
[keys]: https://github.com/nodef/extra-array/wiki/keys
[values]: https://github.com/nodef/extra-array/wiki/values
[entries]: https://github.com/nodef/extra-array/wiki/entries
[ikeys]: https://github.com/nodef/extra-array/wiki/ikeys
[ivalues]: https://github.com/nodef/extra-array/wiki/ivalues
[ientries]: https://github.com/nodef/extra-array/wiki/ientries
[index]: https://github.com/nodef/extra-array/wiki/index
[indexRange]: https://github.com/nodef/extra-array/wiki/indexRange
[isEmpty]: https://github.com/nodef/extra-array/wiki/isEmpty
Expand All @@ -353,12 +355,8 @@ xarray.permutations([1, 2, 3]);
[searchUnsortedValue]: https://github.com/nodef/extra-array/wiki/searchUnsortedValue
[sort]: https://github.com/nodef/extra-array/wiki/sort
[sort$]: https://github.com/nodef/extra-array/wiki/sort$
[sortRange]: https://github.com/nodef/extra-array/wiki/sortRange
[sortRange$]: https://github.com/nodef/extra-array/wiki/sortRange$
[partialSort]: https://github.com/nodef/extra-array/wiki/partialSort
[partialSort$]: https://github.com/nodef/extra-array/wiki/partialSort$
[partialSortRange]: https://github.com/nodef/extra-array/wiki/partialSortRange
[partialSortRange$]: https://github.com/nodef/extra-array/wiki/partialSortRange$
[minimum]: https://github.com/nodef/extra-array/wiki/minimum
[minimumEntry]: https://github.com/nodef/extra-array/wiki/minimumEntry
[maximum]: https://github.com/nodef/extra-array/wiki/maximum
Expand Down Expand Up @@ -399,11 +397,6 @@ xarray.permutations([1, 2, 3]);
[infixes]: https://github.com/nodef/extra-array/wiki/infixes
[subsequences]: https://github.com/nodef/extra-array/wiki/subsequences
[permutations]: https://github.com/nodef/extra-array/wiki/permutations
[iprefixes]: https://github.com/nodef/extra-array/wiki/iprefixes
[isuffixes]: https://github.com/nodef/extra-array/wiki/isuffixes
[iinfixes]: https://github.com/nodef/extra-array/wiki/iinfixes
[isubsequences]: https://github.com/nodef/extra-array/wiki/isubsequences
[ipermutations]: https://github.com/nodef/extra-array/wiki/ipermutations
[searchInfix]: https://github.com/nodef/extra-array/wiki/searchInfix
[searchInfixRight]: https://github.com/nodef/extra-array/wiki/searchInfixRight
[searchInfixAll]: https://github.com/nodef/extra-array/wiki/searchInfixAll
Expand Down
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ PARSE, OTHERS

INDEX -VE
- moveWithin


SOURCEMAP, UNIQUE DEPENDENCIES
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extra-array",
"version": "4.1.1",
"version": "4.1.2",
"description": "An array is a collection of values, stored contiguously.",
"main": "index.js",
"module": "index.mjs",
Expand Down
Loading

0 comments on commit 0855262

Please sign in to comment.