@datarailsshared/dr_renderer 1.2.401 → 1.2.403

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.401",
3
+ "version": "1.2.403",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1235,7 +1235,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1235
1235
  trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
1236
1236
  trendSeries.dashStyle = 'shortdot';
1237
1237
  trendSeries.type = 'line';
1238
- trendSeries.data = trendSeries.data.map((el, index) => a + b * (index + 1));
1238
+ trendSeries.data = trendSeries.data.map(
1239
+ (data, index) => lodash.get(data, 'name')
1240
+ ? { name: data.name, initialName: data.initialName, y: a + b * (index + 1) }
1241
+ : a + b * (index + 1)
1242
+ );
1239
1243
 
1240
1244
  if (colors && colors[i]) {
1241
1245
  trendSeries.color = colors[i];
@@ -1424,7 +1428,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1424
1428
  trendSeries.name = highchartsRenderer.getTrendSeriesName(trendSeries);
1425
1429
  trendSeries.dashStyle = 'shortdot';
1426
1430
  trendSeries.type = 'line';
1427
- trendSeries.data = trendSeries.data.map((data, index) => ({name: data.name, y: a + b * (index + 1)}));
1431
+ trendSeries.data = trendSeries.data.map(
1432
+ (data, index) => ({ name: data.name, initialName: data.initialName, y: a + b * (index + 1) })
1433
+ );
1428
1434
 
1429
1435
  if (colors && colors[i]) {
1430
1436
  trendSeries.color = colors[i];
@@ -6804,14 +6804,17 @@ describe('highcharts_renderer', () => {
6804
6804
  {
6805
6805
  data: [
6806
6806
  {
6807
+ initialName: 'col 1',
6807
6808
  name: 'col 1',
6808
6809
  y: 11728
6809
6810
  },
6810
6811
  {
6812
+ initialName: 'col 2',
6811
6813
  name: 'col 2',
6812
6814
  y: 55555
6813
6815
  },
6814
6816
  {
6817
+ initialName: 'Others',
6815
6818
  name: 'Others',
6816
6819
  y: 99382
6817
6820
  }
@@ -6837,14 +6840,17 @@ describe('highcharts_renderer', () => {
6837
6840
  {
6838
6841
  data: [
6839
6842
  {
6843
+ initialName: 'col 1',
6840
6844
  name: 'col 1',
6841
6845
  y: 89913.5
6842
6846
  },
6843
6847
  {
6848
+ initialName: 'col 2',
6844
6849
  name: 'col 2',
6845
6850
  y: 78184
6846
6851
  },
6847
6852
  {
6853
+ initialName: 'Others',
6848
6854
  name: 'Others',
6849
6855
  y: 66454.5
6850
6856
  }
@@ -7320,9 +7326,21 @@ describe('highcharts_renderer', () => {
7320
7326
  },
7321
7327
  {
7322
7328
  data: [
7323
- 11728,
7324
- 55555,
7325
- 99382
7329
+ {
7330
+ initialName: 'col 1',
7331
+ name: 'col 1',
7332
+ y: 11728
7333
+ },
7334
+ {
7335
+ initialName: 'col 2',
7336
+ name: 'col 2',
7337
+ y: 55555
7338
+ },
7339
+ {
7340
+ initialName: 'Others',
7341
+ name: 'Others',
7342
+ y: 99382
7343
+ }
7326
7344
  ],
7327
7345
  initialName: 'row 1',
7328
7346
  name: 'Trend Line (row 1)',
@@ -7333,9 +7351,21 @@ describe('highcharts_renderer', () => {
7333
7351
  },
7334
7352
  {
7335
7353
  data: [
7336
- 89913.5,
7337
- 78184,
7338
- 66454.5
7354
+ {
7355
+ initialName: 'col 1',
7356
+ name: 'col 1',
7357
+ y: 89913.5
7358
+ },
7359
+ {
7360
+ initialName: 'col 2',
7361
+ name: 'col 2',
7362
+ y: 78184
7363
+ },
7364
+ {
7365
+ initialName: 'Others',
7366
+ name: 'Others',
7367
+ y: 66454.5
7368
+ }
7339
7369
  ],
7340
7370
  initialName: 'row 2',
7341
7371
  name: 'Trend Line (row 2)',