Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@steelbreeze/landscape

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@steelbreeze/landscape - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

2

docs/api/v3/assets/js/search.js

@@ -1,1 +0,1 @@

window.searchData = {"kinds":{"64":"Function","256":"Interface","1024":"Property"},"rows":[{"id":0,"kind":64,"name":"table","url":"index.html#table","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":1,"kind":64,"name":"merge","url":"index.html#merge","classes":"tsd-kind-function"},{"id":2,"kind":256,"name":"Element","url":"interfaces/element.html","classes":"tsd-kind-interface"},{"id":3,"kind":1024,"name":"style","url":"interfaces/element.html#style","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Element"},{"id":4,"kind":1024,"name":"text","url":"interfaces/element.html#text","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Element"},{"id":5,"kind":256,"name":"Cell","url":"interfaces/cell.html","classes":"tsd-kind-interface"},{"id":6,"kind":1024,"name":"rows","url":"interfaces/cell.html#rows","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":7,"kind":1024,"name":"cols","url":"interfaces/cell.html#cols","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":8,"kind":1024,"name":"style","url":"interfaces/cell.html#style","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Cell"},{"id":9,"kind":1024,"name":"text","url":"interfaces/cell.html#text","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Cell"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,19.924]],["parent/0",[]],["name/1",[1,19.924]],["parent/1",[]],["name/2",[2,11.451]],["parent/2",[]],["name/3",[3,14.816]],["parent/3",[2,0.9]],["name/4",[4,14.816]],["parent/4",[2,0.9]],["name/5",[5,6.931]],["parent/5",[]],["name/6",[6,19.924]],["parent/6",[5,0.545]],["name/7",[7,19.924]],["parent/7",[5,0.545]],["name/8",[3,14.816]],["parent/8",[5,0.545]],["name/9",[4,14.816]],["parent/9",[5,0.545]]],"invertedIndex":[["cell",{"_index":5,"name":{"5":{}},"parent":{"6":{},"7":{},"8":{},"9":{}}}],["cols",{"_index":7,"name":{"7":{}},"parent":{}}],["element",{"_index":2,"name":{"2":{}},"parent":{"3":{},"4":{}}}],["merge",{"_index":1,"name":{"1":{}},"parent":{}}],["rows",{"_index":6,"name":{"6":{}},"parent":{}}],["style",{"_index":3,"name":{"3":{},"8":{}},"parent":{}}],["table",{"_index":0,"name":{"0":{}},"parent":{}}],["text",{"_index":4,"name":{"4":{},"9":{}},"parent":{}}]],"pipeline":[]}}
window.searchData = {"kinds":{"64":"Function","256":"Interface","1024":"Property"},"rows":[{"id":0,"kind":256,"name":"Element","url":"interfaces/element.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"style","url":"interfaces/element.html#style","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Element"},{"id":2,"kind":1024,"name":"text","url":"interfaces/element.html#text","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Element"},{"id":3,"kind":256,"name":"Cell","url":"interfaces/cell.html","classes":"tsd-kind-interface"},{"id":4,"kind":1024,"name":"rows","url":"interfaces/cell.html#rows","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":5,"kind":1024,"name":"cols","url":"interfaces/cell.html#cols","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":6,"kind":1024,"name":"style","url":"interfaces/cell.html#style","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Cell"},{"id":7,"kind":1024,"name":"text","url":"interfaces/cell.html#text","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Cell"},{"id":8,"kind":64,"name":"table","url":"index.html#table","classes":"tsd-kind-function tsd-has-type-parameter"},{"id":9,"kind":64,"name":"merge","url":"index.html#merge","classes":"tsd-kind-function"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,11.451]],["parent/0",[]],["name/1",[1,14.816]],["parent/1",[0,0.9]],["name/2",[2,14.816]],["parent/2",[0,0.9]],["name/3",[3,6.931]],["parent/3",[]],["name/4",[4,19.924]],["parent/4",[3,0.545]],["name/5",[5,19.924]],["parent/5",[3,0.545]],["name/6",[1,14.816]],["parent/6",[3,0.545]],["name/7",[2,14.816]],["parent/7",[3,0.545]],["name/8",[6,19.924]],["parent/8",[]],["name/9",[7,19.924]],["parent/9",[]]],"invertedIndex":[["cell",{"_index":3,"name":{"3":{}},"parent":{"4":{},"5":{},"6":{},"7":{}}}],["cols",{"_index":5,"name":{"5":{}},"parent":{}}],["element",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{}}}],["merge",{"_index":7,"name":{"9":{}},"parent":{}}],["rows",{"_index":4,"name":{"4":{}},"parent":{}}],["style",{"_index":1,"name":{"1":{},"6":{}},"parent":{}}],["table",{"_index":6,"name":{"8":{}},"parent":{}}],["text",{"_index":2,"name":{"2":{},"7":{}},"parent":{}}]],"pipeline":[]}}

@@ -1,1 +0,1 @@

var landscape;(()=>{"use strict";var e={};(()=>{var t=e;function s(e,t,s,o){const a=t.x.map(((t,n)=>s?l(e,(e=>e[n].length),o):1)),r=e.map((e=>s?1:l(e,(e=>e.length),o)));return n(e,r,((e,s,o,l)=>n(e,a,((e,t,n)=>({...e[Math.floor(e.length*(o+n)/(t*s))]})),t.y[l].map((e=>u(c(`axis y ${e.key}`,e.value)))))),t.x[0].map(((e,s)=>n(t.x,a,(e=>u(c(`axis x ${e[s].key}`,e[s].value))),t.y[0].map((()=>u(c("axis xy"))))))))}function n(e,t,s,n){return e.forEach(((e,o)=>{const l=t[o];for(let t=0;t<l;++t)n.push(s(e,l,t,o))})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.merge=t.split=t.table=void 0,t.table=function(e,t,n,o,l=!1){return s(e.map((e=>e.map((e=>e.length?function(e,t){const s=[];for(const n of e){const e=t(n);let o=s.find((t=>r(t,e)));o||s.push(o=u(e))}return s}(e,n):[u(c("empty"))])))),t,o,l)},t.split=s,t.merge=function(e,t,s){let n;o(e,((l,a)=>{o(l,((o,c)=>{s&&a&&(n=e[a-1][c])&&r(n,o)&&n.cols===o.cols?(n.rows+=o.rows,l.splice(c,1)):t&&c&&(n=l[c-1])&&r(n,o)&&n.rows===o.rows&&(n.cols+=o.cols,l.splice(c,1))}))}))};const o=(e,t)=>{for(let s=e.length;s--;)t(e[s],s)};function l(e,t,s){const n=e.map((e=>t(e)||1));return s?n.reduce(((e,t)=>e*t/a(e,t))):Math.max(...n)}const a=(e,t)=>t?a(t,e%t):e,r=(e,t)=>e.key===t.key&&e.value===t.value&&e.style===t.style,c=(e,t="",s="")=>({key:s,value:t,style:e}),u=e=>({...e,rows:1,cols:1})})(),landscape=e})();
var landscape;(()=>{"use strict";var e={};(()=>{var s=e;Object.defineProperty(s,"__esModule",{value:!0}),s.merge=s.table=void 0,s.table=(e,s,a,l,r=!1)=>function(e,s,a,l){const r=s.x.map(((s,o)=>a?t(e,(e=>e[o].length),l):1)),n=e.map((e=>a?1:t(e,(e=>e.length),l)));return o(e,n,((e,t,a,l)=>o(e,r,((e,s,o)=>({...e[Math.floor(e.length*(a+o)/(s*t))]})),s.y[l].map((e=>u(c(`axis y ${e.key}`,e.value)))))),s.x[0].map(((e,t)=>o(s.x,r,(e=>u(c(`axis x ${e[t].key}`,e[t].value))),s.y[0].map((()=>u(c("axis xy"))))))))}(e.map((e=>e.map((e=>e.length?function(e,s){const t=[];for(const o of e){const e=s(o);t.some((s=>n(s,e)))||t.push(u(e))}return t}(e,a):[u(c("empty"))])))),s,l,r),s.merge=(e,s,t)=>{let o;a(e,((l,r)=>{a(l,((a,c)=>{t&&r&&(o=e[r-1][c])&&n(o,a)&&o.cols===a.cols?(o.rows+=a.rows,l.splice(c,1)):s&&c&&(o=l[c-1])&&n(o,a)&&o.rows===a.rows&&(o.cols+=a.cols,l.splice(c,1))}))}))};const t=(e,s,t)=>(t?l:Math.max)(...e.map((e=>s(e)||1)));function o(e,s,t,o){return e.forEach(((e,a)=>{const l=s[a];for(let s=0;s<l;++s)o.push(t(e,l,s,a))})),o}const a=(e,s)=>{for(let t=e.length;t--;)s(e[t],t)},l=(...e)=>e.reduce(((e,s)=>e*s/r(e,s))),r=(e,s)=>s?r(s,e%s):e,n=(e,s)=>e.key===s.key&&e.value===s.value&&e.style===s.style,c=(e,s="",t="")=>({key:t,value:s,style:e}),u=e=>({...e,rows:1,cols:1})})(),landscape=e})();

@@ -24,9 +24,4 @@ import { Axes, Cube, Function, Pair, Row } from '@steelbreeze/pivot';

*/
export declare function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getElement: Function<TRow, Element>, onX: boolean, precise?: boolean): Array<Array<Cell>>;
export declare const table: <TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getElement: Function<TRow, Element>, onX: boolean, precise?: boolean) => Array<Array<Cell>>;
/**
* Splits a cube of cells into a table, creating mutiple rows or columns where a cell in a cube has multiple values.
* @hidden
*/
export declare function split<TRow extends Row>(cells: Cube<Cell>, axes: Axes<TRow>, onX: boolean, precise: boolean): Array<Array<Cell>>;
/**
* Merge adjacent cells in a split table on the y and/or x axes.

@@ -37,2 +32,2 @@ * @param cells A table of Cells created by a previous call to splitX or splitY.

*/
export declare function merge(cells: Array<Array<Cell>>, onX: boolean, onY: boolean): void;
export declare const merge: (cells: Array<Array<Cell>>, onX: boolean, onY: boolean) => void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.merge = exports.split = exports.table = void 0;
exports.merge = exports.table = void 0;
/**

@@ -12,15 +12,14 @@ * Generates a table from a cube and it's axis.

*/
function table(cube, axes, getElement, onX, precise = false) {
// convert the source data to cells and remove resulting duplicates; create the resultant table
return split(cube.map(row => row.map(table => table.length ? cells(table, getElement) : [cell(element('empty'))])), axes, onX, precise);
}
const table = (cube, axes, getElement, onX, precise = false) =>
// convert the source data to cells and remove resulting duplicates; create the resultant table
expand(cube.map(row => row.map(table => table.length ? cells(table, getElement) : [cell(element('empty'))])), axes, onX, precise);
exports.table = table;
/**
* Splits a cube of cells into a table, creating mutiple rows or columns where a cell in a cube has multiple values.
* Expands a cube of cells into a table, creating mutiple rows or columns where a cell in a cube has multiple values.
* @hidden
*/
function split(cells, axes, onX, precise) {
function expand(cells, axes, onX, precise) {
// calcuate the x and y splits required
const xSplits = axes.x.map((_, iX) => onX ? leastCommonMultiple(cells, row => row[iX].length, precise) : 1);
const ySplits = cells.map(row => onX ? 1 : leastCommonMultiple(row, table => table.length, precise));
const xSplits = axes.x.map((_, iX) => onX ? split(cells, row => row[iX].length, precise) : 1);
const ySplits = cells.map(row => onX ? 1 : split(row, table => table.length, precise));
// iterate and expand the y axis based on the split data

@@ -43,3 +42,2 @@ return reduce(cells, ySplits, (row, ySplit, ysi, iY) =>

}
exports.split = split;
/**

@@ -51,3 +49,3 @@ * Merge adjacent cells in a split table on the y and/or x axes.

*/
function merge(cells, onX, onY) {
const merge = (cells, onX, onY) => {
let next;

@@ -66,3 +64,3 @@ forEachRev(cells, (row, iY) => {

});
}
};
exports.merge = merge;

@@ -77,5 +75,4 @@ /**

const element = getElement(row);
let existing = result.find(cell => equals(cell, element));
if (!existing) {
result.push(existing = cell(element));
if (!result.some(cell => equals(cell, element))) {
result.push(cell(element));
}

@@ -86,2 +83,7 @@ }

/**
* Calculate the number of splits required for a given cell
* @hidden
*/
const split = (source, callbackfn, precise) => (precise ? leastCommonMultiple : Math.max)(...source.map(item => callbackfn(item) || 1));
/**
* Expands an array using, splitting values into multiple based on a set of corresponding splits then maps the data to a desired structure.

@@ -109,9 +111,11 @@ * @hidden

/**
* Determines which method to use to calculate the number table cells to split a cube table cell into.
* @hidden
*/
//const splitter = (precise: boolean): (...counts: Array<number>) => number => precise ? leastCommonMultiple : Math.max;
/**
* Returns the least common multiple of a set of integers generated from an object.
* @hidden
*/
function leastCommonMultiple(source, callbackfn, precise) {
const counts = source.map(value => callbackfn(value) || 1);
return precise ? counts.reduce((a, b) => (a * b) / greatestCommonFactor(a, b)) : Math.max(...counts);
}
const leastCommonMultiple = (...counts) => counts.reduce((a, b) => (a * b) / greatestCommonFactor(a, b));
/**

@@ -118,0 +122,0 @@ * Returns the greatest common factor of two numbers

@@ -1,1 +0,1 @@

var landscape;(()=>{"use strict";var e={};(()=>{var t=e;function s(e,t,s,o){const a=t.x.map(((t,n)=>s?l(e,(e=>e[n].length),o):1)),r=e.map((e=>s?1:l(e,(e=>e.length),o)));return n(e,r,((e,s,o,l)=>n(e,a,((e,t,n)=>({...e[Math.floor(e.length*(o+n)/(t*s))]})),t.y[l].map((e=>u(c(`axis y ${e.key}`,e.value)))))),t.x[0].map(((e,s)=>n(t.x,a,(e=>u(c(`axis x ${e[s].key}`,e[s].value))),t.y[0].map((()=>u(c("axis xy"))))))))}function n(e,t,s,n){return e.forEach(((e,o)=>{const l=t[o];for(let t=0;t<l;++t)n.push(s(e,l,t,o))})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.merge=t.split=t.table=void 0,t.table=function(e,t,n,o,l=!1){return s(e.map((e=>e.map((e=>e.length?function(e,t){const s=[];for(const n of e){const e=t(n);let o=s.find((t=>r(t,e)));o||s.push(o=u(e))}return s}(e,n):[u(c("empty"))])))),t,o,l)},t.split=s,t.merge=function(e,t,s){let n;o(e,((l,a)=>{o(l,((o,c)=>{s&&a&&(n=e[a-1][c])&&r(n,o)&&n.cols===o.cols?(n.rows+=o.rows,l.splice(c,1)):t&&c&&(n=l[c-1])&&r(n,o)&&n.rows===o.rows&&(n.cols+=o.cols,l.splice(c,1))}))}))};const o=(e,t)=>{for(let s=e.length;s--;)t(e[s],s)};function l(e,t,s){const n=e.map((e=>t(e)||1));return s?n.reduce(((e,t)=>e*t/a(e,t))):Math.max(...n)}const a=(e,t)=>t?a(t,e%t):e,r=(e,t)=>e.key===t.key&&e.value===t.value&&e.style===t.style,c=(e,t="",s="")=>({key:s,value:t,style:e}),u=e=>({...e,rows:1,cols:1})})(),landscape=e})();
var landscape;(()=>{"use strict";var e={};(()=>{var s=e;Object.defineProperty(s,"__esModule",{value:!0}),s.merge=s.table=void 0,s.table=(e,s,a,l,r=!1)=>function(e,s,a,l){const r=s.x.map(((s,o)=>a?t(e,(e=>e[o].length),l):1)),n=e.map((e=>a?1:t(e,(e=>e.length),l)));return o(e,n,((e,t,a,l)=>o(e,r,((e,s,o)=>({...e[Math.floor(e.length*(a+o)/(s*t))]})),s.y[l].map((e=>u(c(`axis y ${e.key}`,e.value)))))),s.x[0].map(((e,t)=>o(s.x,r,(e=>u(c(`axis x ${e[t].key}`,e[t].value))),s.y[0].map((()=>u(c("axis xy"))))))))}(e.map((e=>e.map((e=>e.length?function(e,s){const t=[];for(const o of e){const e=s(o);t.some((s=>n(s,e)))||t.push(u(e))}return t}(e,a):[u(c("empty"))])))),s,l,r),s.merge=(e,s,t)=>{let o;a(e,((l,r)=>{a(l,((a,c)=>{t&&r&&(o=e[r-1][c])&&n(o,a)&&o.cols===a.cols?(o.rows+=a.rows,l.splice(c,1)):s&&c&&(o=l[c-1])&&n(o,a)&&o.rows===a.rows&&(o.cols+=a.cols,l.splice(c,1))}))}))};const t=(e,s,t)=>(t?l:Math.max)(...e.map((e=>s(e)||1)));function o(e,s,t,o){return e.forEach(((e,a)=>{const l=s[a];for(let s=0;s<l;++s)o.push(t(e,l,s,a))})),o}const a=(e,s)=>{for(let t=e.length;t--;)s(e[t],t)},l=(...e)=>e.reduce(((e,s)=>e*s/r(e,s))),r=(e,s)=>s?r(s,e%s):e,n=(e,s)=>e.key===s.key&&e.value===s.value&&e.style===s.style,c=(e,s="",t="")=>({key:t,value:s,style:e}),u=e=>({...e,rows:1,cols:1})})(),landscape=e})();
{
"name": "@steelbreeze/landscape",
"version": "3.6.1",
"version": "3.6.2",
"description": "Landscape map viewpoint visualisation",

@@ -5,0 +5,0 @@ "main": "lib/node/index.js",

@@ -29,15 +29,14 @@ import { Axes, Cube, Function, Pair, Row, Table } from '@steelbreeze/pivot';

*/
export function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getElement: Function<TRow, Element>, onX: boolean, precise: boolean = false): Array<Array<Cell>> {
export const table = <TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getElement: Function<TRow, Element>, onX: boolean, precise: boolean = false): Array<Array<Cell>> =>
// convert the source data to cells and remove resulting duplicates; create the resultant table
return split(cube.map(row => row.map(table => table.length ? cells(table, getElement) : <Cell[]>[cell(element('empty'))])), axes, onX, precise);
}
expand(cube.map(row => row.map(table => table.length ? cells(table, getElement) : <Cell[]>[cell(element('empty'))])), axes, onX, precise);
/**
* Splits a cube of cells into a table, creating mutiple rows or columns where a cell in a cube has multiple values.
* Expands a cube of cells into a table, creating mutiple rows or columns where a cell in a cube has multiple values.
* @hidden
*/
export function split<TRow extends Row>(cells: Cube<Cell>, axes: Axes<TRow>, onX: boolean, precise: boolean): Array<Array<Cell>> {
function expand<TRow extends Row>(cells: Cube<Cell>, axes: Axes<TRow>, onX: boolean, precise: boolean): Array<Array<Cell>> {
// calcuate the x and y splits required
const xSplits = axes.x.map((_, iX) => onX ? leastCommonMultiple(cells, row => row[iX].length, precise) : 1);
const ySplits = cells.map(row => onX ? 1 : leastCommonMultiple(row, table => table.length, precise));
const xSplits = axes.x.map((_, iX) => onX ? split(cells, row => row[iX].length, precise) : 1);
const ySplits = cells.map(row => onX ? 1 : split(row, table => table.length, precise));

@@ -76,3 +75,3 @@ // iterate and expand the y axis based on the split data

*/
export function merge(cells: Array<Array<Cell>>, onX: boolean, onY: boolean): void {
export const merge = (cells: Array<Array<Cell>>, onX: boolean, onY: boolean): void => {
let next;

@@ -82,2 +81,3 @@

forEachRev(row, (cell, iX) => {
if (onY && iY && (next = cells[iY - 1][iX]) && equals(next, cell) && next.cols === cell.cols) {

@@ -103,6 +103,5 @@ next.rows += cell.rows;

const element = getElement(row);
let existing = result.find(cell => equals(cell, element));
if (!existing) {
result.push(existing = cell(element));
if (!result.some(cell => equals(cell, element))) {
result.push(cell(element));
}

@@ -115,2 +114,8 @@ }

/**
* Calculate the number of splits required for a given cell
* @hidden
*/
const split = <T>(source: Array<T>, callbackfn: Function<T, number>, precise: boolean) => (precise ? leastCommonMultiple : Math.max)(...source.map(item => callbackfn(item) || 1))
/**
* Expands an array using, splitting values into multiple based on a set of corresponding splits then maps the data to a desired structure.

@@ -142,11 +147,13 @@ * @hidden

/**
* Determines which method to use to calculate the number table cells to split a cube table cell into.
* @hidden
*/
//const splitter = (precise: boolean): (...counts: Array<number>) => number => precise ? leastCommonMultiple : Math.max;
/**
* Returns the least common multiple of a set of integers generated from an object.
* @hidden
*/
function leastCommonMultiple<TSource>(source: Array<TSource>, callbackfn: Function<TSource, number>, precise: boolean): number {
const counts = source.map(value => callbackfn(value) || 1);
const leastCommonMultiple = (...counts: Array<number>): number => counts.reduce((a, b) => (a * b) / greatestCommonFactor(a, b));
return precise ? counts.reduce((a, b) => (a * b) / greatestCommonFactor(a, b)) : Math.max(...counts); // TODO: restore this method to be just LCM
}
/**

@@ -153,0 +160,0 @@ * Returns the greatest common factor of two numbers

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc