@datarailsshared/dr_renderer 1.2.107 → 1.2.109
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 +1 -1
- package/src/dr_pivottable.js +9 -5
- package/src/highcharts_renderer.js +47 -5
package/package.json
CHANGED
package/src/dr_pivottable.js
CHANGED
|
@@ -1313,7 +1313,7 @@ let initDRPivotTable = function($, window, document) {
|
|
|
1313
1313
|
if (th.hasAttribute('data_show_more') && th.colSpan > 0 && !hasColLabels) {
|
|
1314
1314
|
th.colSpan = th.colSpan - 1;
|
|
1315
1315
|
}
|
|
1316
|
-
|
|
1316
|
+
|
|
1317
1317
|
tr.appendChild(th);
|
|
1318
1318
|
if (isRowSubtotal) {
|
|
1319
1319
|
addClass(tr, classRowExpanded);
|
|
@@ -1491,14 +1491,18 @@ let initDRPivotTable = function($, window, document) {
|
|
|
1491
1491
|
const value = totalAggregator.value();
|
|
1492
1492
|
const formattedValue = getFormattedNumber(value, totalAggregator, opts);
|
|
1493
1493
|
|
|
1494
|
+
if (!colHeader) {
|
|
1495
|
+
colHeader = {}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1494
1498
|
let style = "pvtTotal pvtAddField colTotal";
|
|
1495
|
-
style += " col" + colHeader.row + " colcol" + colHeader.col;
|
|
1499
|
+
style += " col" + colHeader.row || "-1" + " colcol" + colHeader.col || "-1";
|
|
1496
1500
|
|
|
1497
1501
|
const td = createElement("td", style, formattedValue, {
|
|
1498
1502
|
"data-value": value,
|
|
1499
|
-
"data-rowcol": "col" + colHeader.col,
|
|
1500
|
-
"data-rownode": "" + colHeader.node
|
|
1501
|
-
}, getTableEventHandlers(value, [], colHeader.key));
|
|
1503
|
+
"data-rowcol": "col" + colHeader.col || "-1",
|
|
1504
|
+
"data-rownode": "" + colHeader.node || "-1"
|
|
1505
|
+
}, getTableEventHandlers(value, [], colHeader.key || []));
|
|
1502
1506
|
|
|
1503
1507
|
return td;
|
|
1504
1508
|
}
|
|
@@ -467,8 +467,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
467
467
|
if (!cols && is_drill_down_pie) {
|
|
468
468
|
cols = this.point.name;
|
|
469
469
|
}
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
|
|
471
|
+
var drOthersInColumn = lodash.find(pivotData.getColKeys(), keys => keys.length && keys.includes('DR_Others'));
|
|
472
|
+
if (!lodash.isArray(cols) && drOthersInColumn[0] !== 'DR_Others') {
|
|
472
473
|
cols = [cols];
|
|
473
474
|
}
|
|
474
475
|
|
|
@@ -1385,8 +1386,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1385
1386
|
var num_cols = col_n_keys.length;
|
|
1386
1387
|
var num_rows = row_n_keys.length;
|
|
1387
1388
|
|
|
1389
|
+
const isOthersIncludedInRow = num_rows === 1 && row_n_keys[0].includes('DR_Others');
|
|
1390
|
+
const othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
1391
|
+
|
|
1388
1392
|
lodash.forEach(col_n_keys, function (col_n_value) {
|
|
1389
|
-
|
|
1393
|
+
const row_n_value = isOthersIncludedInRow ? row_n_keys[0] : [];
|
|
1394
|
+
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
1390
1395
|
var val = agg.value();
|
|
1391
1396
|
var key = col_n_value;
|
|
1392
1397
|
|
|
@@ -1400,6 +1405,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1400
1405
|
if (lodash.isEmpty(String(ob.name))) {
|
|
1401
1406
|
ob.name = "[blank]";
|
|
1402
1407
|
}
|
|
1408
|
+
|
|
1409
|
+
if (ob.name === 'DR_Others') {
|
|
1410
|
+
ob.name = othersName;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1403
1413
|
ob.y = val;
|
|
1404
1414
|
if (!isNaN(key))
|
|
1405
1415
|
key = Number(key)
|
|
@@ -1424,13 +1434,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1424
1434
|
var num_cols = col_n_keys.length;
|
|
1425
1435
|
var num_rows = row_n_keys.length;
|
|
1426
1436
|
|
|
1437
|
+
const othersName = lodash.get(opts, "total_value_options.filter_options.filteredOutFieldName") || 'Others';
|
|
1427
1438
|
|
|
1428
1439
|
lodash.forEach(col_n_keys, function (col_n_value) {
|
|
1429
1440
|
var col_ob = {};
|
|
1430
1441
|
var col_n = col_n_value[0];
|
|
1431
1442
|
if (col_n != undefined) {
|
|
1432
1443
|
col_ob.id = !isNaN(col_n) ? Number(col_n) : col_n;
|
|
1433
|
-
col_ob.name = col_n;
|
|
1444
|
+
col_ob.name = col_n === 'DR_Others' ? othersName : col_n;
|
|
1434
1445
|
col_ob.data = [];
|
|
1435
1446
|
lodash.forEach(row_n_keys, function (row_n_value) {
|
|
1436
1447
|
var agg = pivotData.getAggregator(row_n_value, col_n_value);
|
|
@@ -1445,7 +1456,8 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
1445
1456
|
// }
|
|
1446
1457
|
}
|
|
1447
1458
|
|
|
1448
|
-
|
|
1459
|
+
const row_name = row_n_value[0] === 'DR_Others' ? othersName : row_n_value[0];
|
|
1460
|
+
col_ob.data.push([row_name, val]);
|
|
1449
1461
|
}
|
|
1450
1462
|
});
|
|
1451
1463
|
if (col_ob.data.length) {
|
|
@@ -5582,6 +5594,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
5582
5594
|
default_value: ''
|
|
5583
5595
|
}]
|
|
5584
5596
|
},
|
|
5597
|
+
'description': {
|
|
5598
|
+
category_class: 'google-visualization-charteditor-mini-more',
|
|
5599
|
+
category_label: 'Description',
|
|
5600
|
+
category_type: 'description',
|
|
5601
|
+
elements: [{
|
|
5602
|
+
element_type: 'textarea',
|
|
5603
|
+
value_name: 'description',
|
|
5604
|
+
element_label: 'Widget Description',
|
|
5605
|
+
default_value: ''
|
|
5606
|
+
}]
|
|
5607
|
+
},
|
|
5585
5608
|
'chart': {
|
|
5586
5609
|
category_class: 'google-visualization-charteditor-mini-more',
|
|
5587
5610
|
category_label: 'Chart',
|
|
@@ -6302,6 +6325,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6302
6325
|
highchartsRenderer.suboptions["tooltips"],
|
|
6303
6326
|
highchartsRenderer.suboptions["label"],
|
|
6304
6327
|
highchartsRenderer.suboptions["subtitle"],
|
|
6328
|
+
highchartsRenderer.suboptions["description"],
|
|
6305
6329
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6306
6330
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6307
6331
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6325,6 +6349,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6325
6349
|
highchartsRenderer.suboptions["tooltips"],
|
|
6326
6350
|
highchartsRenderer.suboptions["label"],
|
|
6327
6351
|
highchartsRenderer.suboptions["subtitle"],
|
|
6352
|
+
highchartsRenderer.suboptions["description"],
|
|
6328
6353
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6329
6354
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6330
6355
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6347,6 +6372,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6347
6372
|
highchartsRenderer.suboptions["tooltips"],
|
|
6348
6373
|
highchartsRenderer.suboptions["label"],
|
|
6349
6374
|
highchartsRenderer.suboptions["subtitle"],
|
|
6375
|
+
highchartsRenderer.suboptions["description"],
|
|
6350
6376
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6351
6377
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6352
6378
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6375,6 +6401,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6375
6401
|
highchartsRenderer.suboptions["tooltips"],
|
|
6376
6402
|
highchartsRenderer.suboptions["label"],
|
|
6377
6403
|
highchartsRenderer.suboptions["subtitle"],
|
|
6404
|
+
highchartsRenderer.suboptions["description"],
|
|
6378
6405
|
highchartsRenderer.suboptions["table_options"],
|
|
6379
6406
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6380
6407
|
highchartsRenderer.suboptions["chart"],
|
|
@@ -6397,6 +6424,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6397
6424
|
highchartsRenderer.suboptions["tooltips"],
|
|
6398
6425
|
highchartsRenderer.suboptions["label_with_percentage"],
|
|
6399
6426
|
highchartsRenderer.suboptions["subtitle"],
|
|
6427
|
+
highchartsRenderer.suboptions["description"],
|
|
6400
6428
|
highchartsRenderer.suboptions["table_options"],
|
|
6401
6429
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6402
6430
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6424,6 +6452,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6424
6452
|
highchartsRenderer.suboptions["tooltips"],
|
|
6425
6453
|
highchartsRenderer.suboptions["label"],
|
|
6426
6454
|
highchartsRenderer.suboptions["subtitle"],
|
|
6455
|
+
highchartsRenderer.suboptions["description"],
|
|
6427
6456
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6428
6457
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6429
6458
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6446,6 +6475,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6446
6475
|
highchartsRenderer.suboptions["tooltips"],
|
|
6447
6476
|
highchartsRenderer.suboptions["label"],
|
|
6448
6477
|
highchartsRenderer.suboptions["subtitle"],
|
|
6478
|
+
highchartsRenderer.suboptions["description"],
|
|
6449
6479
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6450
6480
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6451
6481
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6466,6 +6496,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6466
6496
|
highchartsRenderer.suboptions["tooltips"],
|
|
6467
6497
|
highchartsRenderer.suboptions["label"],
|
|
6468
6498
|
highchartsRenderer.suboptions["subtitle"],
|
|
6499
|
+
highchartsRenderer.suboptions["description"],
|
|
6469
6500
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6470
6501
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6471
6502
|
highchartsRenderer.suboptions["negative_number_format"],
|
|
@@ -6494,6 +6525,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6494
6525
|
highchartsRenderer.suboptions["tooltips"],
|
|
6495
6526
|
highchartsRenderer.suboptions["label"],
|
|
6496
6527
|
highchartsRenderer.suboptions["subtitle"],
|
|
6528
|
+
highchartsRenderer.suboptions["description"],
|
|
6497
6529
|
highchartsRenderer.suboptions["table_options"],
|
|
6498
6530
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6499
6531
|
highchartsRenderer.suboptions["chart"],
|
|
@@ -6516,6 +6548,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6516
6548
|
highchartsRenderer.suboptions["tooltips"],
|
|
6517
6549
|
highchartsRenderer.suboptions["label_with_percentage"],
|
|
6518
6550
|
highchartsRenderer.suboptions["subtitle"],
|
|
6551
|
+
highchartsRenderer.suboptions["description"],
|
|
6519
6552
|
highchartsRenderer.suboptions["table_options"],
|
|
6520
6553
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6521
6554
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6543,6 +6576,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6543
6576
|
highchartsRenderer.suboptions["tooltips"],
|
|
6544
6577
|
highchartsRenderer.suboptions["label"],
|
|
6545
6578
|
highchartsRenderer.suboptions["subtitle"],
|
|
6579
|
+
highchartsRenderer.suboptions["description"],
|
|
6546
6580
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6547
6581
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6548
6582
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6565,6 +6599,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6565
6599
|
highchartsRenderer.suboptions["tooltips"],
|
|
6566
6600
|
highchartsRenderer.suboptions["label"],
|
|
6567
6601
|
highchartsRenderer.suboptions["subtitle"],
|
|
6602
|
+
highchartsRenderer.suboptions["description"],
|
|
6568
6603
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6569
6604
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6570
6605
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6592,6 +6627,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6592
6627
|
highchartsRenderer.suboptions["tooltips"],
|
|
6593
6628
|
highchartsRenderer.suboptions["label_pie"],
|
|
6594
6629
|
highchartsRenderer.suboptions["subtitle"],
|
|
6630
|
+
highchartsRenderer.suboptions["description"],
|
|
6595
6631
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6596
6632
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6597
6633
|
highchartsRenderer.suboptions["chart"],
|
|
@@ -6610,6 +6646,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6610
6646
|
highchartsRenderer.suboptions["tooltips"],
|
|
6611
6647
|
highchartsRenderer.suboptions["label_pie"],
|
|
6612
6648
|
highchartsRenderer.suboptions["subtitle"],
|
|
6649
|
+
highchartsRenderer.suboptions["description"],
|
|
6613
6650
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6614
6651
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6615
6652
|
highchartsRenderer.suboptions["chart"],
|
|
@@ -6639,6 +6676,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6639
6676
|
highchartsRenderer.suboptions["range"],
|
|
6640
6677
|
highchartsRenderer.suboptions["tooltips"],
|
|
6641
6678
|
highchartsRenderer.suboptions["subtitle"],
|
|
6679
|
+
highchartsRenderer.suboptions["description"],
|
|
6642
6680
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6643
6681
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6644
6682
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6657,6 +6695,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6657
6695
|
highchartsRenderer.suboptions["range"],
|
|
6658
6696
|
highchartsRenderer.suboptions["tooltips"],
|
|
6659
6697
|
highchartsRenderer.suboptions["subtitle"],
|
|
6698
|
+
highchartsRenderer.suboptions["description"],
|
|
6660
6699
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6661
6700
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6662
6701
|
highchartsRenderer.suboptions["chart_grid"],
|
|
@@ -6679,6 +6718,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6679
6718
|
highchartsRenderer.suboptions["default_show"],
|
|
6680
6719
|
highchartsRenderer.suboptions["value"],
|
|
6681
6720
|
highchartsRenderer.suboptions["range"],
|
|
6721
|
+
highchartsRenderer.suboptions["description"],
|
|
6682
6722
|
highchartsRenderer.suboptions["name"],
|
|
6683
6723
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6684
6724
|
highchartsRenderer.suboptions["table_design_options"],
|
|
@@ -6700,6 +6740,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6700
6740
|
suboptions: [
|
|
6701
6741
|
highchartsRenderer.suboptions["default_show"],
|
|
6702
6742
|
highchartsRenderer.suboptions["name"],
|
|
6743
|
+
highchartsRenderer.suboptions["description"],
|
|
6703
6744
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6704
6745
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6705
6746
|
highchartsRenderer.suboptions["negative_number_format"],
|
|
@@ -6717,6 +6758,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6717
6758
|
class: 'google-visualization-charteditor-thumbs-table',
|
|
6718
6759
|
render: highchartsRenderer.ptRenderBasicLine,
|
|
6719
6760
|
suboptions: [
|
|
6761
|
+
highchartsRenderer.suboptions["description"],
|
|
6720
6762
|
highchartsRenderer.suboptions["table_options_transpose"],
|
|
6721
6763
|
highchartsRenderer.suboptions["table_design_options"],
|
|
6722
6764
|
highchartsRenderer.suboptions["negative_number_format"],
|