Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sequba committed Dec 22, 2022
2 parents ec30263 + 3157a09 commit 0adb3bb
Show file tree
Hide file tree
Showing 102 changed files with 1,874 additions and 1,461 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "CodeQL"

on:
pull_request:
types:
- opened
- reopened
- synchronize # the head branch is updated from the base branch, new commits are pushed to the head branch, or the base branch is changed
push:
branches:
- 'master'
- 'develop'
- 'release/**'
schedule:
- cron: "39 19 * * 5"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.3.0] - 2022-12-22

### Added
- Exported the `ArraySize` class as a public API. [#843](https://github.com/handsontable/hyperformula/issues/843)
- Renamed an internal interface from `ArgumentTypes` to `FunctionArgumentType`, and exported it as a public API. [#1108](https://github.com/handsontable/hyperformula/pull/1108)
- Exported `ImplementedFunctions` and `FunctionMetadata` as public APIs. [#1108](https://github.com/handsontable/hyperformula/pull/1108)

## [2.2.0] - 2022-11-17

### Added
Expand Down
2 changes: 2 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const highlight = require('./highlight');
const regexPlugin = require('markdown-it-regex').default;
const footnotePlugin = require('markdown-it-footnote');
const searchBoxPlugin = require('./plugins/search-box');
const HyperFormula = require('../../dist/hyperformula.full');
const fs = require('fs');
Expand Down Expand Up @@ -74,6 +75,7 @@ module.exports = {
regex: /(process\.env\.HT_RELEASE_DATE as string)/,
replace: () => `'${HyperFormula.releaseDate}'`
})
md.use(footnotePlugin)
}
},
// TODO: It doesn't work. It's seems that this option is bugged. Documentation says that this option is configurable,
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ console.log(winningTeam)
## Demo

<iframe
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.2.x/advanced-usage?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.3.x/advanced-usage?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
title="handsontable/hyperformula-demos: advanced-usage"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
Expand Down
33 changes: 17 additions & 16 deletions docs/guide/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ISEVEN(A2:A5*10)

Thanks to HyperFormula's built-in array features, you can:
* [Operate on arrays](#operating-on-arrays) just like on [scalars](#about-arrays)
* [Pass arrays to functions](#passing-arrays-to-scalar-functions) that accept [scalars](#about-arrays)
* [Pass arrays to functions](#passing-arrays-to-scalar-functions-vectorization) that accept [scalars](#about-arrays)
* [Broadcast](#broadcasting) smaller input arrays across larger output areas

You can also:
Expand All @@ -83,7 +83,7 @@ You can also:

You can operate on arrays just like on single values.

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled, each output array value is the result of your operation on the corresponding input array value.
When the [array arithmetic mode](#array-arithmetic-mode) is enabled, each output array value is the result of your operation on the corresponding input array value.

```
=ARRAYFORMULA(A2:A5*B2:B5)
Expand All @@ -95,22 +95,23 @@ When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled
// =A5*B5
```

### Passing arrays to scalar functions
You can pass arrays to functions that would normally accept [scalars](#about-arrays) (thanks to HyperFormula's **vectorization** feature).
### Passing arrays to scalar functions (vectorization)

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled, and you pass an array to a [scalar](#about-arrays) function, that function produces an array on the output as well.
When the [array arithmetic mode](#array-arithmetic-mode) is enabled, HyperFormula automatically _vectorizes_ most functions.

As a consequence of that, you can pass arrays to functions that would normally accept [scalars](#about-arrays). The result would also be an array.

```
=ARRAYFORMULA(ISEVEN(A2:A5*10))
=ARRAYFORMULA(ISEVEN(A2:A5))
// calculates:
// =ISEVEN(A2*10)
// =ISEVEN(A3*10)
// =ISEVEN(A4*10)
// =ISEVEN(A5*10)
// =ISEVEN(A2)
// =ISEVEN(A3)
// =ISEVEN(A4)
// =ISEVEN(A5)
```

#### Broadcasting
### Broadcasting

If an input array has a dimension of `1`, it's automatically repeated ("broadcast") on that dimension to match the size of the output.

Expand All @@ -126,15 +127,15 @@ If an input array has a dimension of `1`, it's automatically repeated ("broadcas

### Filtering an array

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled, you can filter an array, based on boolean arrays, using the `FILTER` function:
When the [array arithmetic mode](#array-arithmetic-mode) is enabled, you can filter an array, based on boolean arrays, using the `FILTER` function:

| Syntax | Example |
|:-----------------------------------------------------|:------------------------------------------------|
| `FILTER(your_array, BoolArray1[, BoolArray2[, ...]]` | `=ARRAYFORMULA(FILTER(A2:A5*10), {1, 0, 0, 1})` |

### Constraining an array's size

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled, you can constrain the size of the output array, using the `ARRAY_CONSTRAIN` function:
When the [array arithmetic mode](#array-arithmetic-mode) is enabled, you can constrain the size of the output array, using the `ARRAY_CONSTRAIN` function:

| Syntax | Example |
|:-------------------------------------------|:----------------------------------------------|
Expand All @@ -148,17 +149,17 @@ If your specified output array size is larger or equal to the input array size,

### With the array arithmetic mode enabled

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is enabled, and you pass an array to a [scalar](#about-arrays) function, the following rules apply:
When the [array arithmetic mode](#array-arithmetic-mode) is enabled, and you pass an array to a [scalar](#about-arrays) function, the following rules apply:
* Array dimensions need to be consistent (e.g. every row needs to be of the same length).
* If an input array value is missing (due to a difference in dimensions), the corresponding output array value is `#N/A`.
* If a cell evaluates to an array, the array values are spilled into neighboring cells (unless the neighboring cells are already filled).<br>This behavior doesn't apply to ranges, which return the `#VALUE!` error in this case.
* If one of input array dimensions is `1` (`1`x`n` or `n`x`1`), the array is repeated, to match the output array dimensions.

### With the array arithmetic mode disabled

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is disabled, and you pass an array to a [scalar](#about-arrays) function, the array is reduced to 1 element (usually the array's top-left value).
When the [array arithmetic mode](#array-arithmetic-mode) is disabled, and you pass an array to a [scalar](#about-arrays) function, the array is reduced to 1 element (usually the array's top-left value).

When the [array arithmetic mode](#enabling-the-array-arithmetic-mode) is disabled, and you operate on a range of width/height equal to `1`, the behavior depends on your array formula's location:
When the [array arithmetic mode](#array-arithmetic-mode) is disabled, and you operate on a range of width/height equal to `1`, the behavior depends on your array formula's location:

| Your array formula's location | Behavior |
|:--------------------------------------------------|:---------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/basic-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ This demo presents several basic operations integrated with a
sample UI.

<iframe
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.2.x/basic-operations?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.3.x/basic-operations?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
title="handsontable/hyperformula-demos: basic-operations"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ works. It's time to move on to a more
## Demo

<iframe
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.2.x/basic-usage?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.3.x/basic-usage?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
title="handsontable/hyperformula-demos: basic-usage"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ can be sent as a single one.
## Demo

<iframe
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.2.x/batch-operations?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
src="https://codesandbox.io/embed/github/handsontable/hyperformula-demos/tree/2.3.x/batch-operations?autoresize=1&fontsize=11&hidenavigation=1&theme=light&view=preview"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
title="handsontable/hyperformula-demos: batch-operations"
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
Expand Down
Loading

0 comments on commit 0adb3bb

Please sign in to comment.