Skip to content

Commit 5d4f3eb

Browse files
authored
Merge pull request #75 from metatron-app/3.0.1
Release 3.0.1
2 parents 19ba6b7 + 8e2d66a commit 5d4f3eb

File tree

90 files changed

+2015
-1846
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2015
-1846
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ hive-site.xml
6666
discovery-server/src/main/resources/hive-site.xml
6767
!/discovery-server/src/main/java/com/metatron/discovery/domain/workbook/configurations/PageConfiguration.java
6868
!/discovery-server/src/main/java/com/metatron/discovery/domain/workbook/configurations/filter/ExpressionFilter.java
69+
discovery-frontend/src/environments/build.env.ts
6970

7071
# dataprep local base dir
7172
dataprep/uploads

discovery-frontend/build.env.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exports.vars = [
2+
'METATRON_APP_VERSION',
3+
'METATRON_DEPLOY_SERVER'
4+
];

discovery-frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"lint": "ng lint",
1313
"lint-fix": "ng lint --fix",
1414
"e2e": "ng e2e",
15-
"dummy-db": "json-server --watch dummy.json"
15+
"dummy-db": "json-server --watch dummy.json",
16+
"prebuild": "node prebuild.js"
1617
},
1718
"private": true,
1819
"dependencies": {

discovery-frontend/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
<goals>
5353
<goal>npm</goal>
5454
</goals>
55+
56+
<configuration>
57+
<environmentVariables>
58+
<METATRON_APP_VERSION>${metatron.app.version}</METATRON_APP_VERSION>
59+
</environmentVariables>
60+
<arguments>run prebuild</arguments>
61+
</configuration>
5562
</execution>
5663

5764
<execution>

discovery-frontend/prebuild.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
const vars = require('./build.env').vars;
6+
7+
const env_vars = {};
8+
9+
vars.forEach(x => {
10+
if (vars.indexOf(x) !== -1) {
11+
env_vars[x] = process.env[x];
12+
}
13+
});
14+
15+
16+
const buildinfo_path = path.join(__dirname, 'src', 'environments', 'build.env.ts');
17+
const buildinfo = JSON.stringify(env_vars, null, ' ');
18+
19+
fs.writeFileSync(buildinfo_path, `export const BuildInfo = ${buildinfo};`);
20+
21+
process.exit(0);

discovery-frontend/src/app/common/component/chart/base-chart.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ export abstract class BaseChart extends AbstractComponent implements OnInit, OnD
8888
// 선반 정보
8989
protected pivot: Pivot;
9090

91+
// 기존 선반 정보 (병렬 / 중첩에따라서 변경되지않는 선반값)
92+
protected originPivot: Pivot;
93+
9194
// 저장 정보
9295
protected saveInfo: UIOption;
9396

@@ -236,6 +239,8 @@ export abstract class BaseChart extends AbstractComponent implements OnInit, OnD
236239
////////////////////////////////////////////////////////
237240

238241
// Set
242+
this.pivot = result.config.pivot;
243+
this.originPivot = _.cloneDeep(this.pivot);
239244
this.originalData = _.cloneDeep(result.data);
240245

241246
///////////////////////////
@@ -255,7 +260,8 @@ export abstract class BaseChart extends AbstractComponent implements OnInit, OnD
255260
}
256261

257262
// Min/Max 변경
258-
if( !_.isUndefined(this.uiOption.yAxis.grid) ) {
263+
if( !_.isUndefined(this.uiOption.yAxis.grid)
264+
&& !this.uiOption.yAxis.grid.autoScaled ) {
259265

260266
this.calculateMinMax(this.uiOption.yAxis.grid, result, true);
261267
}
@@ -274,7 +280,8 @@ export abstract class BaseChart extends AbstractComponent implements OnInit, OnD
274280
}
275281

276282
// Min/Max 변경
277-
if( !_.isUndefined(this.uiOption.xAxis.grid) ) {
283+
if( !_.isUndefined(this.uiOption.xAxis.grid)
284+
&& !this.uiOption.xAxis.grid.autoScaled ) {
278285

279286
this.calculateMinMax(this.uiOption.xAxis.grid, result, false);
280287
}
@@ -284,7 +291,6 @@ export abstract class BaseChart extends AbstractComponent implements OnInit, OnD
284291

285292
// Set
286293
this.data = result.data;
287-
this.pivot = result.config.pivot;
288294

289295
// 데이터레이블에서 사용되는 uiData에 설정된 columns 데이터 설정
290296
this.data.columns = this.setUIData();

discovery-frontend/src/app/common/component/chart/option/converter/axis-option-converter.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ export class AxisOptionConverter {
396396

397397
let min = null;
398398
let max = null;
399+
let calculateMin = null;
399400
if( data.categories && data.categories.length > 0 ) {
400401
_.each(data.categories, (category) => {
401402
_.each(category.value, (value) => {
@@ -407,15 +408,18 @@ export class AxisOptionConverter {
407408
}
408409
});
409410
});
410-
min = min > 0
411-
? Math.ceil(min - ((max - min) * 0.05))
412-
: min;
411+
calculateMin = Math.ceil(min - ((max - min) * 0.05))
412+
// min = min > 0
413+
// ? calculateMin >= 0 ? calculateMin : min
414+
// : min;
413415
max = max == null ? 0 : max;
414416
}
415417
else {
416-
min = data.info.minValue > 0
417-
? Math.ceil(data.info.minValue - ((data.info.maxValue - data.info.minValue) * 0.05))
418-
: data.info.minValue;
418+
calculateMin = Math.ceil(data.info.minValue - ((data.info.maxValue - data.info.minValue) * 0.05))
419+
min = data.info.minValue;
420+
// min = data.info.minValue > 0
421+
// ? calculateMin >= 0 ? calculateMin : min
422+
// : data.info.minValue;
419423
max = data.info.maxValue;
420424
}
421425

@@ -425,18 +429,25 @@ export class AxisOptionConverter {
425429

426430
// 기준선 변경시
427431
let baseline = 0;
428-
if( axisOption[index].baseline != 0 ) {
432+
if( axisOption[index].baseline && axisOption[index].baseline != 0 ) {
429433
baseline = axisOption[index].baseline
430434
}
431435

432436
// 축 범위 자동설정이 설정되지 않았고
433437
// 오토스케일 적용시
434438
if( baseline == 0 && axisOption[index].grid.autoScaled ) {
435-
// 적용
436-
option.min = min > 0
437-
? Math.ceil(min - ((max - min) * 0.05))
438-
: min;
439-
option.max = max;
439+
// // 적용
440+
// option.min = min > 0
441+
// ? Math.ceil(min - ((max - min) * 0.05))
442+
// : min;
443+
// option.max = max;
444+
445+
delete option.min;
446+
delete option.max;
447+
option.scale = true;
448+
}
449+
else {
450+
delete option.scale;
440451
}
441452
}
442453
});

discovery-frontend/src/app/common/component/chart/option/ui-option/ui-pie-chart.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
*/
1414

1515
import { UIOption } from '../ui-option';
16-
import { BarMarkType, LineMarkType, LineMode, LineStyle, PieSeriesViewType, PointShape } from '../define/common';
16+
import { PieSeriesViewType } from '../define/common';
17+
1718
/**
1819
* 파이차트 화면 UI에 필요한 옵션
1920
* Version 2.0
2021
*/
2122
export interface UIPieChart extends UIOption {
2223

23-
// Bar Chart 표시 방식
24+
// Chart 표시 방식
2425
markType: PieSeriesViewType;
26+
27+
// 기타외 표시개수
28+
maxCategory?: number;
2529
}
2630

2731

0 commit comments

Comments
 (0)