@visactor/vseed 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { isEmpty } from "remeda";
|
|
1
|
+
import { isArray, isEmpty } from "remeda";
|
|
2
|
+
import { isVTable } from "../chatType.js";
|
|
2
3
|
const checkVSeed = (vseed)=>{
|
|
3
4
|
const { chartType, dataset, dimensions, measures } = vseed;
|
|
4
5
|
if (!chartType) throw new Error('chartType is required');
|
|
5
|
-
if (!dataset ||
|
|
6
|
+
if (!dataset || !isArray(dataset)) throw new Error('dataset is required, and must be an array');
|
|
7
|
+
if (isEmpty(dataset) && !isVTable(vseed)) throw new Error('dataset can not empty');
|
|
6
8
|
if (dimensions && !Array.isArray(dimensions)) throw new Error('dimensions must be an array');
|
|
7
9
|
if (measures && !Array.isArray(measures)) throw new Error('measures must be an array');
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline/utils/valid/checkVSeed.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/valid/checkVSeed.ts"],"sourcesContent":["import { isEmpty } from 'remeda'\nimport type { VSeed } from 'src/types'\n\nexport const checkVSeed = (vseed: VSeed) => {\n const { chartType, dataset, dimensions, measures } = vseed\n if (!chartType) {\n throw new Error('chartType is required')\n }\n if (!dataset ||
|
|
1
|
+
{"version":3,"file":"pipeline/utils/valid/checkVSeed.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/valid/checkVSeed.ts"],"sourcesContent":["import { isArray, isEmpty } from 'remeda'\nimport type { VSeed } from 'src/types'\nimport { isVTable } from '../chatType'\n\nexport const checkVSeed = (vseed: VSeed) => {\n const { chartType, dataset, dimensions, measures } = vseed\n if (!chartType) {\n throw new Error('chartType is required')\n }\n if (!dataset || !isArray(dataset)) {\n throw new Error('dataset is required, and must be an array')\n }\n if (isEmpty(dataset) && !isVTable(vseed)) {\n throw new Error('dataset can not empty')\n }\n if (dimensions && !Array.isArray(dimensions)) {\n throw new Error('dimensions must be an array')\n }\n if (measures && !Array.isArray(measures)) {\n throw new Error('measures must be an array')\n }\n}\n"],"names":["checkVSeed","vseed","chartType","dataset","dimensions","measures","Error","isArray","isEmpty","isVTable","Array"],"mappings":";;AAIO,MAAMA,aAAa,CAACC;IACzB,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGJ;IACrD,IAAI,CAACC,WACH,MAAM,IAAII,MAAM;IAElB,IAAI,CAACH,WAAW,CAACI,QAAQJ,UACvB,MAAM,IAAIG,MAAM;IAElB,IAAIE,QAAQL,YAAY,CAACM,SAASR,QAChC,MAAM,IAAIK,MAAM;IAElB,IAAIF,cAAc,CAACM,MAAM,OAAO,CAACN,aAC/B,MAAM,IAAIE,MAAM;IAElB,IAAID,YAAY,CAACK,MAAM,OAAO,CAACL,WAC7B,MAAM,IAAIC,MAAM;AAEpB"}
|
package/dist/umd/index.js
CHANGED
|
@@ -3395,13 +3395,17 @@ self.R = R;
|
|
|
3395
3395
|
};
|
|
3396
3396
|
return advancedVSeed;
|
|
3397
3397
|
};
|
|
3398
|
+
function chunk_BO3LQZNF_o(r) {
|
|
3399
|
+
return Array.isArray(r);
|
|
3400
|
+
}
|
|
3398
3401
|
function chunk_VCYTMP4D_n(e) {
|
|
3399
3402
|
return void 0 === e ? !0 : "string" == typeof e || Array.isArray(e) ? 0 === e.length : 0 === Object.keys(e).length;
|
|
3400
3403
|
}
|
|
3401
3404
|
const checkVSeed = (vseed)=>{
|
|
3402
3405
|
const { chartType, dataset, dimensions, measures } = vseed;
|
|
3403
3406
|
if (!chartType) throw new Error('chartType is required');
|
|
3404
|
-
if (!dataset ||
|
|
3407
|
+
if (!dataset || !chunk_BO3LQZNF_o(dataset)) throw new Error('dataset is required, and must be an array');
|
|
3408
|
+
if (chunk_VCYTMP4D_n(dataset) && !isVTable(vseed)) throw new Error('dataset can not empty');
|
|
3405
3409
|
if (dimensions && !Array.isArray(dimensions)) throw new Error('dimensions must be an array');
|
|
3406
3410
|
if (measures && !Array.isArray(measures)) throw new Error('measures must be an array');
|
|
3407
3411
|
};
|
|
@@ -4329,9 +4333,6 @@ self.R = R;
|
|
|
4329
4333
|
arr
|
|
4330
4334
|
] : [];
|
|
4331
4335
|
}
|
|
4332
|
-
function chunk_BO3LQZNF_o(r) {
|
|
4333
|
-
return Array.isArray(r);
|
|
4334
|
-
}
|
|
4335
4336
|
var tinycolor = __webpack_require__("../../node_modules/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js");
|
|
4336
4337
|
var tinycolor_default = /*#__PURE__*/ __webpack_require__.n(tinycolor);
|
|
4337
4338
|
const tableStyleMap = {
|
|
@@ -7336,11 +7337,11 @@ self.R = R;
|
|
|
7336
7337
|
markArea: markArea
|
|
7337
7338
|
};
|
|
7338
7339
|
};
|
|
7339
|
-
const
|
|
7340
|
+
const isNumber = (value, fuzzy = !1)=>{
|
|
7340
7341
|
const type = typeof value;
|
|
7341
7342
|
return fuzzy ? "number" === type : "number" === type || isType(value, "Number");
|
|
7342
7343
|
};
|
|
7343
|
-
const
|
|
7344
|
+
const common_isNumber = isNumber;
|
|
7344
7345
|
const clamp_clamp = function(input, min, max) {
|
|
7345
7346
|
return input < min ? min : input > max ? max : input;
|
|
7346
7347
|
};
|
|
@@ -7522,10 +7523,10 @@ self.R = R;
|
|
|
7522
7523
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
7523
7524
|
}
|
|
7524
7525
|
function Color_rgb(value) {
|
|
7525
|
-
return
|
|
7526
|
+
return common_isNumber(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : common_isArray(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
7526
7527
|
}
|
|
7527
7528
|
function rgba(value) {
|
|
7528
|
-
return
|
|
7529
|
+
return common_isNumber(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : common_isArray(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
7529
7530
|
}
|
|
7530
7531
|
function SRGBToLinear(c) {
|
|
7531
7532
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -14352,27 +14353,27 @@ self.R = R;
|
|
|
14352
14353
|
};
|
|
14353
14354
|
const isObjectLike = (value)=>"object" == typeof value && null !== value;
|
|
14354
14355
|
const common_isObjectLike = isObjectLike;
|
|
14355
|
-
const
|
|
14356
|
+
const isPlainObject_isPlainObject = function(value) {
|
|
14356
14357
|
if (!common_isObjectLike(value) || !isType(value, "Object")) return !1;
|
|
14357
14358
|
if (null === Object.getPrototypeOf(value)) return !0;
|
|
14358
14359
|
let proto = value;
|
|
14359
14360
|
for(; null !== Object.getPrototypeOf(proto);)proto = Object.getPrototypeOf(proto);
|
|
14360
14361
|
return Object.getPrototypeOf(value) === proto;
|
|
14361
14362
|
};
|
|
14362
|
-
const
|
|
14363
|
-
const
|
|
14363
|
+
const isPlainObject = isPlainObject_isPlainObject;
|
|
14364
|
+
const isString = (value, fuzzy = !1)=>{
|
|
14364
14365
|
const type = typeof value;
|
|
14365
14366
|
return fuzzy ? "string" === type : "string" === type || isType(value, "String");
|
|
14366
14367
|
};
|
|
14367
|
-
const
|
|
14368
|
+
const common_isString = isString;
|
|
14368
14369
|
function pickWithout(obj, keys) {
|
|
14369
|
-
if (!obj || !
|
|
14370
|
+
if (!obj || !isPlainObject(obj)) return obj;
|
|
14370
14371
|
const result = {};
|
|
14371
14372
|
return Object.keys(obj).forEach((k)=>{
|
|
14372
14373
|
const v = obj[k];
|
|
14373
14374
|
let match = !1;
|
|
14374
14375
|
keys.forEach((itKey)=>{
|
|
14375
|
-
(
|
|
14376
|
+
(common_isString(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
14376
14377
|
}), match || (result[k] = v);
|
|
14377
14378
|
}), result;
|
|
14378
14379
|
}
|
|
@@ -16780,7 +16781,7 @@ self.R = R;
|
|
|
16780
16781
|
const length = objValue.length;
|
|
16781
16782
|
for(; ++index < length;)newValue[index] = objValue[index];
|
|
16782
16783
|
}
|
|
16783
|
-
} else
|
|
16784
|
+
} else isPlainObject(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
16784
16785
|
isCommon && baseMerge(newValue, srcValue, shallowArray, skipTargetArray), assignMergeValue(target, key, newValue);
|
|
16785
16786
|
}
|
|
16786
16787
|
function assignMergeValue(target, key, value) {
|