Skip to content

Commit

Permalink
Consistent dimension naming in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Mesquita-Morris committed Jan 15, 2024
1 parent d2be09c commit 0081918
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/api/v4/functions/aggregate.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4>Example</h4><p>The following code aggregates a <a href="../types/Cube.html"
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L175">index.ts:175</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L176">index.ts:176</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/functions/average.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h4>Example</h4><p>The following code aggregates a <a href="../types/Cube.html"
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L223">index.ts:223</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L224">index.ts:224</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
4 changes: 2 additions & 2 deletions docs/api/v4/functions/criteria-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ <h5><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-symb
<h4 class="tsd-returns-title">Returns <a href="../types/Function.html" class="tsd-signature-type tsd-kind-type-alias">Function</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">keyof </span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a href="../types/Criteria.html" class="tsd-signature-type tsd-kind-type-alias">Criteria</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography">
<h4>Example</h4><p>The following code creates a <a href="../types/Dimension.html" class="tsd-kind-type-alias">Dimension</a> that will be used to evaluate <code>Player</code> objects during a <a href="pivot.html" class="tsd-kind-function">pivot</a> operation based on the value of their <code>position</code> property:</p>
<pre><code class="language-ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">positions</span><span class="hl-1">: </span><span class="hl-3">string</span><span class="hl-1">[] = [</span><span class="hl-6">&#39;Goalkeeper&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Defender&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Midfielder&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Forward&#39;</span><span class="hl-1">];</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">dimension</span><span class="hl-1">: </span><span class="hl-3">Dimension</span><span class="hl-1">&lt;&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-3">positions</span><span class="hl-1">.</span><span class="hl-3">map</span><span class="hl-1">(</span><span class="hl-3">criteria</span><span class="hl-1">(</span><span class="hl-6">&#39;position&#39;</span><span class="hl-1">));</span>
<pre><code class="language-ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">positions</span><span class="hl-1">: </span><span class="hl-3">string</span><span class="hl-1">[] = [</span><span class="hl-6">&#39;Goalkeeper&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Defender&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Midfielder&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Forward&#39;</span><span class="hl-1">];</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">x</span><span class="hl-1">: </span><span class="hl-3">Dimension</span><span class="hl-1">&lt;&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-3">positions</span><span class="hl-1">.</span><span class="hl-3">map</span><span class="hl-1">(</span><span class="hl-3">criteria</span><span class="hl-1">(</span><span class="hl-6">&#39;position&#39;</span><span class="hl-1">));</span>
</code><button>Copy</button></pre>
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L70">index.ts:70</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L70">index.ts:70</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
8 changes: 4 additions & 4 deletions docs/api/v4/functions/pivot.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ <h5><span class="tsd-kind-parameter">dimension</span>: <a href="../types/Dimensi
<h4 class="tsd-returns-title">Returns <a href="../types/Matrix.html" class="tsd-signature-type tsd-kind-type-alias">Matrix</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">&gt;</span></h4>
<div class="tsd-comment tsd-typography">
<h4>Example</h4><p>The following code creates a <a href="../types/Matrix.html" class="tsd-kind-type-alias">Matrix</a> of <code>Player</code> objects, pivoted by their <code>position</code> property:</p>
<pre><code class="language-ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">x</span><span class="hl-1">: </span><span class="hl-3">Dimension</span><span class="hl-1">&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-4">positions</span><span class="hl-1">.</span><span class="hl-5">map</span><span class="hl-1">(</span><span class="hl-5">criteria</span><span class="hl-1">(</span><span class="hl-6">&#39;position&#39;</span><span class="hl-1">));</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">matrix</span><span class="hl-1">: </span><span class="hl-3">Matrix</span><span class="hl-1">&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-5">pivot</span><span class="hl-1">(</span><span class="hl-4">squad</span><span class="hl-1">, </span><span class="hl-4">x</span><span class="hl-1">);</span>
<pre><code class="language-ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">positions</span><span class="hl-1">: </span><span class="hl-3">string</span><span class="hl-1">[] = [</span><span class="hl-6">&#39;Goalkeeper&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Defender&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Midfielder&#39;</span><span class="hl-1">, </span><span class="hl-6">&#39;Forward&#39;</span><span class="hl-1">];</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">x</span><span class="hl-1">: </span><span class="hl-3">Dimension</span><span class="hl-1">&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-4">positions</span><span class="hl-1">.</span><span class="hl-5">map</span><span class="hl-1">(</span><span class="hl-5">criteria</span><span class="hl-1">(</span><span class="hl-6">&#39;position&#39;</span><span class="hl-1">));</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">matrix</span><span class="hl-1">: </span><span class="hl-3">Matrix</span><span class="hl-1">&lt;</span><span class="hl-3">Player</span><span class="hl-1">&gt; = </span><span class="hl-5">pivot</span><span class="hl-1">(</span><span class="hl-4">squad</span><span class="hl-1">, </span><span class="hl-4">x</span><span class="hl-1">);</span>
</code><button>Copy</button></pre>
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L94">index.ts:94</a></li></ul></aside></li>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L95">index.ts:95</a></li></ul></aside></li>
<li class="tsd-signature tsd-anchor-link" id="pivot-1"><span class="tsd-kind-call-signature">pivot</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-kind-parameter">dimension1</span>, <span class="tsd-kind-parameter">dimension2</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Cube.html" class="tsd-signature-type tsd-kind-type-alias">Cube</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">&gt;</span><a href="#pivot-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Pivots source data by two <a href="../types/Dimension.html" class="tsd-kind-type-alias">dimensions</a> returning a <a href="../types/Cube.html" class="tsd-kind-type-alias">Cube</a>.</p>
Expand Down Expand Up @@ -89,7 +89,7 @@ <h4>Example</h4><p>The following code creates a <a href="../types/Cube.html" cla
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L113">index.ts:113</a></li></ul></aside></li>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L114">index.ts:114</a></li></ul></aside></li>
<li class="tsd-signature tsd-anchor-link" id="pivot-2"><span class="tsd-kind-call-signature">pivot</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">TValue</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">dimensions</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../types/Hypercube.html" class="tsd-signature-type tsd-kind-type-alias">Hypercube</a><a href="#pivot-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Pivots source data by any number of <a href="../types/Dimension.html" class="tsd-kind-type-alias">dimensions</a> returning a <a href="../types/Hypercube.html" class="tsd-kind-type-alias">Hypercube</a>.</p>
Expand Down Expand Up @@ -126,7 +126,7 @@ <h4>Example</h4><p>The following code creates a <a href="../types/Hypercube.html
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L130">index.ts:130</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L131">index.ts:131</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/functions/sum.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h4>Example</h4><p>The following code aggregates a <a href="../types/Cube.html"
<p>See <a href="https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts">GitHub</a> for a complete example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L199">index.ts:199</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L200">index.ts:200</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Criteria.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4><span class="tsd-kind-type-parameter">TValue</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></section>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L28">index.ts:28</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L28">index.ts:28</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4><span class="tsd-kind-type-parameter">TValue</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></section>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L49">index.ts:49</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L49">index.ts:49</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Dimension.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4><span class="tsd-kind-type-parameter">TValue</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></section>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L35">index.ts:35</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L35">index.ts:35</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Function.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h5><span class="tsd-kind-parameter">arg</span>: <span class="tsd-signature-type
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">TResult</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L21">index.ts:21</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L21">index.ts:21</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Hypercube.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Type alias Hypercube</h1></div>
</div>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L55">index.ts:55</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L55">index.ts:55</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/api/v4/types/Matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4><span class="tsd-kind-type-parameter">TValue</span></h4>
<div class="tsd-comment tsd-typography"></div></li></ul></section>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/24bd357/src/index.ts#L42">index.ts:42</a></li></ul></aside></div>
<li>Defined in <a href="https://github.com/steelbreeze/pivot/blob/d2be09c/src/index.ts#L42">index.ts:42</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
3 changes: 2 additions & 1 deletion lib/node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export type Hypercube = Array<any>;
* The following code creates a {@link Dimension} that will be used to evaluate ```Player``` objects during a {@link pivot} operation based on the value of their ```position``` property:
* ```ts
* const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
* const dimension: Dimension<<Player> = positions.map(criteria('position'));
* const x: Dimension<<Player> = positions.map(criteria('position'));
* ```
* See {@link https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts GitHub} for a complete example.
* @category Cube building
Expand All @@ -74,6 +74,7 @@ export declare function pivot<TValue>(source: Array<TValue>): Matrix<TValue>;
* @example
* The following code creates a {@link Matrix} of ```Player``` objects, pivoted by their ```position``` property:
* ```ts
* const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
* const x: Dimension<Player> = positions.map(criteria('position'));
*
* const matrix: Matrix<Player> = pivot(squad, x);
Expand Down
2 changes: 1 addition & 1 deletion lib/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.average = exports.sum = exports.aggregate = exports.pivot = exports.crit
* The following code creates a {@link Dimension} that will be used to evaluate ```Player``` objects during a {@link pivot} operation based on the value of their ```position``` property:
* ```ts
* const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
* const dimension: Dimension<<Player> = positions.map(criteria('position'));
* const x: Dimension<<Player> = positions.map(criteria('position'));
* ```
* See {@link https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts GitHub} for a complete example.
* @category Cube building
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type Hypercube = Array<any>;
* The following code creates a {@link Dimension} that will be used to evaluate ```Player``` objects during a {@link pivot} operation based on the value of their ```position``` property:
* ```ts
* const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
* const dimension: Dimension<<Player> = positions.map(criteria('position'));
* const x: Dimension<<Player> = positions.map(criteria('position'));
* ```
* See {@link https://github.com/steelbreeze/pivot/blob/main/src/example/index.ts GitHub} for a complete example.
* @category Cube building
Expand All @@ -84,6 +84,7 @@ export function pivot<TValue>(source: Array<TValue>): Matrix<TValue>;
* @example
* The following code creates a {@link Matrix} of ```Player``` objects, pivoted by their ```position``` property:
* ```ts
* const positions: string[] = ['Goalkeeper', 'Defender', 'Midfielder', 'Forward'];
* const x: Dimension<Player> = positions.map(criteria('position'));
*
* const matrix: Matrix<Player> = pivot(squad, x);
Expand Down

0 comments on commit 0081918

Please sign in to comment.