Skip to content
Commits on Source (2)
{
"name": "i4-js-commons",
"version": "3.9.4",
"version": "3.9.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "i4-js-commons",
"version": "3.9.4",
"version": "3.9.5",
"description": "Just a load of common stuff for i4 front-ends and some probably usable in back-end as well",
"dependencies": {
"@material-ui/core": "^4.7.2",
......
......@@ -244,8 +244,6 @@ export const fromChannels = async ({
lengths = [],
}) => {
let counts = lengths;
console.log('typeDocs:', typeDocs);
console.log('ttl:', ttl);
if (historyCb || ttl || from || to || noSub) {
const histories = await Promise.all(
channels.map(({ rid, type, path }) =>
......@@ -260,7 +258,7 @@ export const fromChannels = async ({
}).then(data => ({ path, data })),
),
); // -> [[{ts, pl}, {ts, pl}], [{ts, pl}]]
console.log('histories:', histories);
// console.log('histories:', histories);
/* eslint-disable no-param-reassign */
counts = counts.length
? counts
......@@ -268,9 +266,9 @@ export const fromChannels = async ({
const value = dataInPoint(path, point);
return Array.isArray(value) ? value.length : 1;
}); // -> [1, 2, 1, 1]
console.log('counts:', counts);
// console.log('counts:', counts);
const merged = datasetMerge(counts, histories);
console.log('merged:', merged);
// console.log('merged:', merged);
if (historyCb) historyCb(merged);
else if (cb) merged.map(cb);
if (noSub) return merged;
......@@ -279,9 +277,9 @@ export const fromChannels = async ({
? undefined
: Promise.all(
channels.map(({ rid, type, path }, idx) => {
console.log('Sub-ing 1:', rid, type, path, counts, idx);
// console.log('Sub-ing 1:', rid, type, path, counts, idx);
const [before, [_, ...after]] = R.splitAt(idx)(counts); // eslint-disable-line no-unused-vars
console.log('Sub-ing 2:', before, after);
// console.log('Sub-ing 2:', before, after);
const callback = R.compose(cb, conformPoint(before, after, path));
return fromChannel({
rid,
......
......@@ -54,6 +54,7 @@ const getDefaultDataset = (idx, data = []) => ({
backgroundColor: chartColors[idx],
borderColor: chartColors[idx],
pointRadius,
spanGaps: true,
});
const defaultOptions = {
bar: {
......