@cubejs-client/core 0.31.15 → 0.31.33

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.
package/index.d.ts CHANGED
@@ -261,6 +261,7 @@ declare module '@cubejs-client/core' {
261
261
  export type Series<T> = {
262
262
  key: string;
263
263
  title: string;
264
+ shortTitle: string;
264
265
  series: T[];
265
266
  };
266
267
 
@@ -273,6 +274,7 @@ declare module '@cubejs-client/core' {
273
274
  export type SeriesNamesColumn = {
274
275
  key: string;
275
276
  title: string;
277
+ shortTitle: string;
276
278
  yValues: string[];
277
279
  };
278
280
 
@@ -425,6 +427,7 @@ declare module '@cubejs-client/core' {
425
427
  * {
426
428
  * key: 'Stories.count',
427
429
  * title: 'Stories Count',
430
+ * shortTitle: 'Count',
428
431
  * series: [
429
432
  * { x: '2015-01-01T00:00:00', value: 27120 },
430
433
  * { x: '2015-02-01T00:00:00', value: 25861 },
@@ -455,6 +458,7 @@ declare module '@cubejs-client/core' {
455
458
  * {
456
459
  * key: 'Stories.count',
457
460
  * title: 'Stories Count',
461
+ * shortTitle: 'Count',
458
462
  * yValues: ['Stories.count'],
459
463
  * },
460
464
  * ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubejs-client/core",
3
- "version": "0.31.15",
3
+ "version": "0.31.33",
4
4
  "engines": {},
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,5 +45,5 @@
45
45
  "eslint-plugin-node": "^5.2.1",
46
46
  "jest": "^26.0.1"
47
47
  },
48
- "gitHead": "b881465f9826f180b1edd778fffecf639dd2e946"
48
+ "gitHead": "c0521741a90cd9cfa9601925629e00dbc7972680"
49
49
  }
package/src/ResultSet.js CHANGED
@@ -203,8 +203,9 @@ class ResultSet {
203
203
  }
204
204
 
205
205
  series(pivotConfig) {
206
- return this.seriesNames(pivotConfig).map(({ title, key }) => ({
206
+ return this.seriesNames(pivotConfig).map(({ title, shortTitle, key }) => ({
207
207
  title,
208
+ shortTitle,
208
209
  key,
209
210
  series: this.chartPivot(pivotConfig).map(({ x, ...obj }) => ({ value: obj[key], x }))
210
211
  }));
@@ -661,6 +662,15 @@ class ResultSet {
661
662
  ) :
662
663
  aliasedAxis, ', '
663
664
  ),
665
+ shortTitle: this.axisValuesString(
666
+ pivotConfig.y.find(d => d === 'measures') ?
667
+ dropLast(1, aliasedAxis).concat(
668
+ measures[
669
+ ResultSet.measureFromAxis(axisValues)
670
+ ].shortTitle
671
+ ) :
672
+ aliasedAxis, ', '
673
+ ),
664
674
  key: this.axisValuesString(aliasedAxis, ','),
665
675
  yValues: axisValues
666
676
  };
@@ -467,11 +467,13 @@ describe('ResultSet', () => {
467
467
  {
468
468
  key: 'one,Users.count',
469
469
  title: 'one, Users Count',
470
+ shortTitle: 'one, Count',
470
471
  yValues: ['Users.count'],
471
472
  },
472
473
  {
473
474
  key: 'two,Users.count',
474
475
  title: 'two, Users Count',
476
+ shortTitle: 'two, Count',
475
477
  yValues: ['Users.count'],
476
478
  },
477
479
  ]);
@@ -589,11 +591,13 @@ describe('ResultSet', () => {
589
591
  {
590
592
  key: '0,Users.count',
591
593
  title: '0, Users Count',
594
+ shortTitle: '0, Count',
592
595
  yValues: ['Users.count'],
593
596
  },
594
597
  {
595
598
  key: '1,Users.count',
596
599
  title: '1, Users Count',
600
+ shortTitle: '1, Count',
597
601
  yValues: ['Users.count'],
598
602
  },
599
603
  ]);
@@ -298,11 +298,13 @@ describe('compare date range', () => {
298
298
  {
299
299
  key: '2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999,Orders.count',
300
300
  title: '2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999, Orders Count',
301
+ shortTitle: '2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999, Count',
301
302
  yValues: ['2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999', 'Orders.count'],
302
303
  },
303
304
  {
304
305
  key: '2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999,Orders.count',
305
306
  title: '2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999, Orders Count',
307
+ shortTitle: '2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999, Count',
306
308
  yValues: ['2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999', 'Orders.count'],
307
309
  },
308
310
  ]);
@@ -340,6 +342,7 @@ describe('compare date range', () => {
340
342
  x: '2020-08-16T00:00:00.000',
341
343
  },
342
344
  ],
345
+ shortTitle: '2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999, Count',
343
346
  title: '2020-08-10T00:00:00.000 - 2020-08-16T23:59:59.999, Orders Count',
344
347
  },
345
348
  {
@@ -374,6 +377,7 @@ describe('compare date range', () => {
374
377
  x: '2020-08-16T00:00:00.000',
375
378
  },
376
379
  ],
380
+ shortTitle: '2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999, Count',
377
381
  title: '2020-08-03T00:00:00.000 - 2020-08-09T23:59:59.999, Orders Count',
378
382
  },
379
383
  ]);