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

@vizabi/core

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vizabi/core - npm Package Compare versions

Comparing version 1.21.0 to 1.21.1

src/core/encoding/facet.js

10

dist/Dataframe.js

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

// http://vizabi.org v1.21.0 Copyright 2021 Jasper Heeffer and others at Gapminder Foundation
// http://vizabi.org v1.21.1 Copyright 2021 Jasper Heeffer and others at Gapminder Foundation
(function (global, factory) {

@@ -6,3 +6,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx')) :

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Dataframe = {}, global.mobx));
}(this, (function (exports, mobx) { 'use strict';
})(this, (function (exports, mobx) { 'use strict';

@@ -354,2 +354,6 @@ const directions = {

};
//case for quarter
if (intervalSize === "quarter") return d3.utcMonth.every(3);
//special case to make weeks start from monday as per ISO 8601, not sunday
if (intervalSize === "week") intervalSize = "monday";
return d3['utc' + ucFirst(intervalSize)] || nonTimeInterval;

@@ -1553,3 +1557,3 @@ }

})));
}));
//# sourceMappingURL=Dataframe.js.map
{
"name": "@vizabi/core",
"version": "1.21.0",
"version": "1.21.1",
"description": "Vizabi core (data layer)",

@@ -58,7 +58,8 @@ "main": "dist/Vizabi.js",

"peerDependencies": {
"mobx": "^5.15.7",
"d3": "^6.7.0"
"d3": "^6.7.0",
"mobx": "^5.15.7"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.0.4",
"@vizabi/reader-ddfcsv": "^4.0.1",
"install-peers": "^1.0.3",

@@ -74,4 +75,3 @@ "jest": "^27.1.0",

"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-visualizer": "^5.5.2",
"@vizabi/reader-ddfcsv": "^4.0.1"
"rollup-plugin-visualizer": "^5.5.2"
},

@@ -81,3 +81,6 @@ "serve": {

"hot": false
},
"dependencies": {
"user": "^0.0.0"
}
}

@@ -45,3 +45,3 @@ import { fromPromise } from 'mobx-utils'

else if (this.path)
return csvReader({ path: this.path, sheet: this.sheet, keyConcepts: this.keyConcepts, dtypes: this.dtypes });
return csvReader(this.config);
console.warn("No inline values or csv path found. Please set `values` or `path` property on dataSource.", this)

@@ -215,3 +215,8 @@ },

return {
raw: response,
//Sometimes the raw response is a dataframe (such as from CSV/inline reader)
//And sometimes it's a plain array (such as from ws-service reader)
//Some downstream code however expects "raw" to be a plain array,
//for example, the for loop in entityPropertyDataConfig.js: lookups()
//hence, this converts response back to plain array
raw: isDataFrame(response) ? [...response.values()] : response,
forKey,

@@ -218,0 +223,0 @@ forQueryKey

@@ -351,2 +351,6 @@ import { fromPromise } from "mobx-utils";

};
//case for quarter
if (intervalSize === "quarter") return d3.utcMonth.every(3);
//special case to make weeks start from monday as per ISO 8601, not sunday
if (intervalSize === "week") intervalSize = "monday";
return d3['utc' + ucFirst(intervalSize)] || nonTimeInterval;

@@ -353,0 +357,0 @@ }

@@ -8,3 +8,2 @@ import { inlineReader } from "./../inline/inline";

const GOOGLE_DOC_PREFIX = 'https://docs.google.com/spreadsheets/';
const MISSED_INDICATOR_NAME = 'indicator';
const ERRORS = {

@@ -102,4 +101,9 @@ WRONG_TIME_COLUMN_OR_UNITS: 'reader/error/wrongTimeUnitsOrColumn',

if (isTimeInColumns)
return timeInColumns({rows, columns});
if (isTimeInColumns) {
try {
return timeInColumns({rows, columns}, ERRORS);
} catch (error) {
throw makeError(error);
}
}

@@ -106,0 +110,0 @@ return {rows, columns};

@@ -1,4 +0,6 @@

export function timeInColumns({columns, rows}, parsers) {
const keySize = this.keySize;
import { ucFirst } from "../../core/utils";
const MISSED_INDICATOR_NAME = 'indicator';
export function timeInColumns({columns, rows, hasNameColumn, timeKey = "time", keySize = 1}, ERRORS, parsers) {
let nameConcept = null;

@@ -9,17 +11,17 @@

// name column is not at its original index because it was moved by csv reader "load" method
if (this.hasNameColumn) {
if (hasNameColumn) {
nameConcept = columns.splice(keySize + 1, 1)[0] || 'name';
}
const missedIndicator = parsers && parsers[this.timeKey] && !!parsers[this.timeKey](columns[keySize]);
const missedIndicator = parsers && parsers[timeKey] && !!parsers[timeKey](columns[keySize]);
if (missedIndicator) {
Vizabi.utils.warn('Indicator column is missed.');
console.warn('Indicator column is missed.');
}
const indicatorKey = missedIndicator ? this.MISSED_INDICATOR_NAME : columns[keySize];
const indicatorKey = missedIndicator ? MISSED_INDICATOR_NAME : columns[keySize];
const concepts = columns.slice(0, keySize)
.concat(this.timeKey)
.concat(timeKey)
.concat(nameConcept || [])
.concat(missedIndicator ? Vizabi.utils.capitalize(this.MISSED_INDICATOR_NAME) : rows.reduce((result, row) => {
.concat(missedIndicator ? ucFirst(MISSED_INDICATOR_NAME) : rows.reduce((result, row) => {
const concept = row[indicatorKey];

@@ -43,10 +45,10 @@ if (!result.includes(concept) && concept) {

if (resultRows[0][row[indicatorKey]] !== null) {
throw this.error(ERRORS.REPEATED_KEYS, null, {
indicator: row[indicatorKey],
key: row[entityDomain]
});
throw {
name: ERRORS.REPEATED_KEYS,
message: `indicator: ${row[indicatorKey]}, key: ${row[entityDomain]}`
}
}
resultRows.forEach(resultRow => {
resultRow[row[indicatorKey]] = row[resultRow[this.timeKey]];
resultRow[row[indicatorKey]] = row[resultRow[timeKey]];
});

@@ -58,3 +60,3 @@ } else {

[entityDomain]: row[entityDomain],
[this.timeKey]: key
[timeKey]: key
};

@@ -61,0 +63,0 @@ const optionalNameColumn = !nameConcept ? {} : {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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