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.4.0 to 3.4.1

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 tsd-has-type-parameter"},{"id":2,"kind":256,"name":"Key","url":"interfaces/key.html","classes":"tsd-kind-interface"},{"id":3,"kind":1024,"name":"text","url":"interfaces/key.html#text","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Key"},{"id":4,"kind":1024,"name":"style","url":"interfaces/key.html#style","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Key"},{"id":5,"kind":256,"name":"Cell","url":"interfaces/cell.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":6,"kind":1024,"name":"source","url":"interfaces/cell.html#source","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":7,"kind":1024,"name":"rows","url":"interfaces/cell.html#rows","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":8,"kind":1024,"name":"cols","url":"interfaces/cell.html#cols","classes":"tsd-kind-property tsd-parent-kind-interface","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"},{"id":10,"kind":1024,"name":"style","url":"interfaces/cell.html#style","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,20.794]],["parent/0",[]],["name/1",[1,20.794]],["parent/1",[]],["name/2",[2,12.321]],["parent/2",[]],["name/3",[3,15.686]],["parent/3",[2,0.999]],["name/4",[4,15.686]],["parent/4",[2,0.999]],["name/5",[5,6.131]],["parent/5",[]],["name/6",[6,20.794]],["parent/6",[5,0.497]],["name/7",[7,20.794]],["parent/7",[5,0.497]],["name/8",[8,20.794]],["parent/8",[5,0.497]],["name/9",[3,15.686]],["parent/9",[5,0.497]],["name/10",[4,15.686]],["parent/10",[5,0.497]]],"invertedIndex":[["cell",{"_index":5,"name":{"5":{}},"parent":{"6":{},"7":{},"8":{},"9":{},"10":{}}}],["cols",{"_index":8,"name":{"8":{}},"parent":{}}],["key",{"_index":2,"name":{"2":{}},"parent":{"3":{},"4":{}}}],["merge",{"_index":1,"name":{"1":{}},"parent":{}}],["rows",{"_index":7,"name":{"7":{}},"parent":{}}],["source",{"_index":6,"name":{"6":{}},"parent":{}}],["style",{"_index":4,"name":{"4":{},"10":{}},"parent":{}}],["table",{"_index":0,"name":{"0":{}},"parent":{}}],["text",{"_index":3,"name":{"3":{},"9":{}},"parent":{}}]],"pipeline":[]}}
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 tsd-has-type-parameter"},{"id":2,"kind":256,"name":"Key","url":"interfaces/key.html","classes":"tsd-kind-interface"},{"id":3,"kind":1024,"name":"text","url":"interfaces/key.html#text","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Key"},{"id":4,"kind":1024,"name":"style","url":"interfaces/key.html#style","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Key"},{"id":5,"kind":256,"name":"Cell","url":"interfaces/cell.html","classes":"tsd-kind-interface tsd-has-type-parameter"},{"id":6,"kind":1024,"name":"index","url":"interfaces/cell.html#index","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":7,"kind":1024,"name":"source","url":"interfaces/cell.html#source","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":8,"kind":1024,"name":"rows","url":"interfaces/cell.html#rows","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":9,"kind":1024,"name":"cols","url":"interfaces/cell.html#cols","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Cell"},{"id":10,"kind":1024,"name":"text","url":"interfaces/cell.html#text","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-inherited","parent":"Cell"},{"id":11,"kind":1024,"name":"style","url":"interfaces/cell.html#style","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,21.595]],["parent/0",[]],["name/1",[1,21.595]],["parent/1",[]],["name/2",[2,13.122]],["parent/2",[]],["name/3",[3,16.487]],["parent/3",[2,1.089]],["name/4",[4,16.487]],["parent/4",[2,1.089]],["name/5",[5,5.5]],["parent/5",[]],["name/6",[6,21.595]],["parent/6",[5,0.457]],["name/7",[7,21.595]],["parent/7",[5,0.457]],["name/8",[8,21.595]],["parent/8",[5,0.457]],["name/9",[9,21.595]],["parent/9",[5,0.457]],["name/10",[3,16.487]],["parent/10",[5,0.457]],["name/11",[4,16.487]],["parent/11",[5,0.457]]],"invertedIndex":[["cell",{"_index":5,"name":{"5":{}},"parent":{"6":{},"7":{},"8":{},"9":{},"10":{},"11":{}}}],["cols",{"_index":9,"name":{"9":{}},"parent":{}}],["index",{"_index":6,"name":{"6":{}},"parent":{}}],["key",{"_index":2,"name":{"2":{}},"parent":{"3":{},"4":{}}}],["merge",{"_index":1,"name":{"1":{}},"parent":{}}],["rows",{"_index":8,"name":{"8":{}},"parent":{}}],["source",{"_index":7,"name":{"7":{}},"parent":{}}],["style",{"_index":4,"name":{"4":{},"11":{}},"parent":{}}],["table",{"_index":0,"name":{"0":{}},"parent":{}}],["text",{"_index":3,"name":{"3":{},"10":{}},"parent":{}}]],"pipeline":[]}}

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

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

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

import { Axes, Cube, Func1, Row } from '@steelbreeze/pivot';
import { Axes, Cube, Func, Row } from '@steelbreeze/pivot';
export interface Key {

@@ -10,2 +10,4 @@ /** The text to use in the final table rendering. */

export interface Cell<TRow extends Row> extends Key {
/** Unique keys for the source context. */
index: Array<number>;
/** The the rows that this this key came from. */

@@ -25,3 +27,3 @@ source: Array<TRow>;

*/
export declare function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getKey: Func1<TRow, Key>, onX: boolean): Array<Array<Cell<TRow>>>;
export declare function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getKey: Func<TRow, Key>, onX: boolean): Array<Array<Cell<TRow>>>;
/**

@@ -28,0 +30,0 @@ * Merge adjacent cells in a split table on the y and/or x axes.

@@ -12,4 +12,5 @@ "use strict";

function table(cube, axes, getKey, onX) {
const identity = { index: 0 };
// convert the source data to keys and remove resulting duplicates
const cells = cube.map(row => row.map(table => table.length ? tableCells(table, getKey) : [{ text: '', style: 'empty', source: [], rows: 1, cols: 1 }]));
const cells = cube.map(row => row.map(table => table.length ? tableCells(table, getKey, identity) : [{ text: '', style: 'empty', index: [], source: [], rows: 1, cols: 1 }]));
// create the resultant table

@@ -59,3 +60,3 @@ return split(cells, axes, onX);

next.rows += value.rows;
next.source.push(...value.source);
mergeContext(next, value);
row.splice(iX, 1);

@@ -65,3 +66,3 @@ }

next.cols += value.cols;
next.source.push(...value.source);
mergeContext(next, value);
row.splice(iX, 1);

@@ -74,6 +75,18 @@ }

/**
* Merges the context of two adjacent cells.
* @hidden
*/
function mergeContext(next, value) {
value.index.forEach((index, i) => {
if (!next.index.includes(index)) {
next.index.push(index);
next.source.push(value.source[i]);
}
});
}
/**
* Convert a table of rows into a table of cells.
* @hidden
*/
function tableCells(table, getKey) {
function tableCells(table, getKey, identity) {
const result = [];

@@ -84,7 +97,9 @@ for (const row of table) {

if (cell) {
cell.index.push(identity.index);
cell.source.push(row);
}
else {
result.push({ ...key, source: [row], rows: 1, cols: 1 });
result.push({ ...key, index: [identity.index], source: [row], rows: 1, cols: 1 });
}
identity.index++;
}

@@ -141,3 +156,3 @@ return result;

function axis(pair, name) {
return { text: pair.value, style: `axis ${name} ${pair.key}`, source: [], rows: 1, cols: 1 };
return { text: pair.value, style: `axis ${name} ${pair.key}`, index: [], source: [], rows: 1, cols: 1 };
}

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

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

@@ -15,3 +15,3 @@ "main": "lib/node/index.js",

"dependencies": {
"@steelbreeze/pivot": "^1.2.3"
"@steelbreeze/pivot": "^2.0.0"
},

@@ -18,0 +18,0 @@ "devDependencies": {

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

import { Axes, Cube, Func1, Func2, Pair, Row, Table } from '@steelbreeze/pivot';
import { Axes, Cube, Func, Pair, Row, Table } from '@steelbreeze/pivot';

@@ -13,4 +13,7 @@ export interface Key {

export interface Cell<TRow extends Row> extends Key {
/** Unique keys for the source context. */
index: Array<number>;
/** The the rows that this this key came from. */
source: Array<TRow>
source: Array<TRow>;

@@ -31,5 +34,7 @@ /** The number of rows to occupy. */

*/
export function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getKey: Func1<TRow, Key>, onX: boolean): Array<Array<Cell<TRow>>> {
export function table<TRow extends Row>(cube: Cube<TRow>, axes: Axes<TRow>, getKey: Func<TRow, Key>, onX: boolean): Array<Array<Cell<TRow>>> {
const identity = { index: 0 };
// convert the source data to keys and remove resulting duplicates
const cells = cube.map(row => row.map(table => table.length ? tableCells(table, getKey) : [{ text: '', style: 'empty', source: [], rows: 1, cols: 1 }]));
const cells = cube.map(row => row.map(table => table.length ? tableCells(table, getKey, identity) : [{ text: '', style: 'empty', index: [], source: [], rows: 1, cols: 1 }]));

@@ -90,7 +95,7 @@ // create the resultant table

next.rows += value.rows;
next.source.push(...value.source);
mergeContext(next, value);
row.splice(iX, 1);
} else if (onX && iX && (next = row[iX - 1]) && keyEquals(next, value) && next.rows === value.rows) {
next.cols += value.cols;
next.source.push(...value.source);
mergeContext(next, value);
row.splice(iX, 1);

@@ -103,6 +108,19 @@ }

/**
* Merges the context of two adjacent cells.
* @hidden
*/
function mergeContext<TRow extends Row>(next: Cell<TRow>, value: Cell<TRow>): void {
value.index.forEach((index, i) => {
if (!next.index.includes(index)) {
next.index.push(index);
next.source.push(value.source[i]);
}
});
}
/**
* Convert a table of rows into a table of cells.
* @hidden
*/
function tableCells<TRow extends Row>(table: Table<TRow>, getKey: Func1<TRow, Key>): Table<Cell<TRow>> {
function tableCells<TRow extends Row>(table: Table<TRow>, getKey: Func<TRow, Key>, identity: { index: number }): Table<Cell<TRow>> {
const result: Table<Cell<TRow>> = [];

@@ -115,6 +133,9 @@

if (cell) {
cell.index.push(identity.index);
cell.source.push(row);
} else {
result.push({ ...key, source: [row], rows: 1, cols: 1 });
result.push({ ...key, index: [identity.index], source: [row], rows: 1, cols: 1 });
}
identity.index++;
}

@@ -145,3 +166,3 @@

*/
function forEachRev<TValue>(values: Array<TValue>, callbackfn: Func2<TValue, number, void>): void {
function forEachRev<TValue>(values: Array<TValue>, callbackfn: (value: TValue, index: number) => void): void {
for (let index = values.length; index--;) {

@@ -156,3 +177,3 @@ callbackfn(values[index], index);

*/
function leastCommonMultiple<TSource>(source: Array<TSource>, callbackfn: Func1<TSource, number>): number {
function leastCommonMultiple<TSource>(source: Array<TSource>, callbackfn: Func<TSource, number>): number {
return source.map(value => callbackfn(value) || 1).reduce((a, b) => (a * b) / greatestCommonFactor(a, b));

@@ -182,3 +203,3 @@ }

function axis<TRow extends Row>(pair: Pair, name: string): Cell<TRow> {
return { text: pair.value, style: `axis ${name} ${pair.key}`, source: [], rows: 1, cols: 1 };
return { text: pair.value, style: `axis ${name} ${pair.key}`, index: [], source: [], rows: 1, cols: 1 };
}

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