@cubejs-client/core 0.31.15 → 0.31.30

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
@@ -273,6 +273,7 @@ declare module '@cubejs-client/core' {
273
273
  export type SeriesNamesColumn = {
274
274
  key: string;
275
275
  title: string;
276
+ shortTitle: string;
276
277
  yValues: string[];
277
278
  };
278
279
 
@@ -425,6 +426,7 @@ declare module '@cubejs-client/core' {
425
426
  * {
426
427
  * key: 'Stories.count',
427
428
  * title: 'Stories Count',
429
+ * shortTitle: 'Count',
428
430
  * series: [
429
431
  * { x: '2015-01-01T00:00:00', value: 27120 },
430
432
  * { x: '2015-02-01T00:00:00', value: 25861 },
@@ -455,6 +457,7 @@ declare module '@cubejs-client/core' {
455
457
  * {
456
458
  * key: 'Stories.count',
457
459
  * title: 'Stories Count',
460
+ * shortTitle: 'Count',
458
461
  * yValues: ['Stories.count'],
459
462
  * },
460
463
  * ]
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.30",
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": "5f63c029be3cc960ef16d872ed37b4a42f847693"
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
  ]);