sonar 41 left
This commit is contained in:
@@ -266,7 +266,7 @@ export async function uploadFailedSecond(detail) {
|
||||
|
||||
detail.forEach(i => {
|
||||
let content = '';
|
||||
|
||||
let key = '';
|
||||
switch (i.type) {
|
||||
case 'too_many':
|
||||
manySrt = 'There are more errors.';
|
||||
@@ -277,9 +277,7 @@ export async function uploadFailedSecond(detail) {
|
||||
case 'malformed':
|
||||
content = `<li>Data malformed in Timestamp Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
||||
break;
|
||||
case 'missing':
|
||||
let key = '';
|
||||
|
||||
case 'missing':
|
||||
switch (i.loc[2]) {
|
||||
case 'case id':
|
||||
key = 'Case ID';
|
||||
|
||||
@@ -113,10 +113,17 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
// 可使用 parseInt(整數) parseFloat(浮點數) 將字串轉為數字
|
||||
// Relative 要轉為百分比 %
|
||||
if(node.data('type') === 'activity') {
|
||||
let textInt;
|
||||
let textFloat;
|
||||
let textDurRel;
|
||||
let timeLabelInt;
|
||||
let timeLabelFloat;
|
||||
let textTimeLabel;
|
||||
|
||||
switch(dataLayerType) {
|
||||
case 'freq': // Frequency
|
||||
let textInt = dataLayerOption === 'rel_freq' ? text + optionValue * 100 + "%" : text + optionValue;
|
||||
let textFloat = dataLayerOption === 'rel_freq'? text + (optionValue * 100).toFixed(2) + "%" : text + optionValue.toFixed(2);
|
||||
textInt = dataLayerOption === 'rel_freq' ? text + optionValue * 100 + "%" : text + optionValue;
|
||||
textFloat = dataLayerOption === 'rel_freq'? text + (optionValue * 100).toFixed(2) + "%" : text + optionValue.toFixed(2);
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
text = Math.trunc(optionValue) === optionValue ? textInt : textFloat;
|
||||
@@ -124,13 +131,13 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
|
||||
case 'duration': // Duration 除了 Relative 為百分比 % ,其他要轉變時間單位。
|
||||
// Relative %
|
||||
let textDurRel = text + (optionValue * 100).toFixed(2) + "%";
|
||||
textDurRel = text + (optionValue * 100).toFixed(2) + "%";
|
||||
// Timelabel
|
||||
let timeLabelInt = text + getTimeLabel(optionValue);
|
||||
let timeLabelFloat = text + getTimeLabel(optionValue.toFixed(2));
|
||||
timeLabelInt = text + getTimeLabel(optionValue);
|
||||
timeLabelFloat = text + getTimeLabel(optionValue.toFixed(2));
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
let textTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
textTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
|
||||
text = dataLayerOption === 'rel_duration' ? textDurRel : textTimeLabel;
|
||||
break;
|
||||
@@ -169,13 +176,18 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
'content': function(edge) { // 關係線顯示的文字
|
||||
let optionValue = edge.data(`${dataLayerType}.${dataLayerOption}`);
|
||||
let result = '';
|
||||
|
||||
let edgeInt;
|
||||
let edgeFloat;
|
||||
let edgeDurRel;
|
||||
let timeLabelInt;
|
||||
let timeLabelFloat;
|
||||
let edgeTimeLabel;
|
||||
if(optionValue === '') return optionValue;
|
||||
|
||||
switch(dataLayerType) {
|
||||
case 'freq':
|
||||
let edgeInt = dataLayerOption === 'rel_freq' ? optionValue * 100 + "%" : optionValue;
|
||||
let edgeFloat = dataLayerOption === 'rel_freq' ? (optionValue * 100).toFixed(2) + "%" : optionValue.toFixed(2);
|
||||
edgeInt = dataLayerOption === 'rel_freq' ? optionValue * 100 + "%" : optionValue;
|
||||
edgeFloat = dataLayerOption === 'rel_freq' ? (optionValue * 100).toFixed(2) + "%" : optionValue.toFixed(2);
|
||||
|
||||
// 判斷是否為整數,若非整數要取小數點後面兩個值。
|
||||
result = Math.trunc(optionValue) === optionValue ? edgeInt : edgeFloat;
|
||||
@@ -183,11 +195,11 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
|
||||
|
||||
case 'duration': // Duration 除了 Relative 為百分比 % ,其他要轉變時間單位。
|
||||
// Relative %
|
||||
let edgeDurRel = (optionValue * 100).toFixed(2) + "%";
|
||||
edgeDurRel = (optionValue * 100).toFixed(2) + "%";
|
||||
// Timelabel
|
||||
let timeLabelInt = getTimeLabel(optionValue);
|
||||
let timeLabelFloat = getTimeLabel(optionValue.toFixed(2));
|
||||
let edgeTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
timeLabelInt = getTimeLabel(optionValue);
|
||||
timeLabelFloat = getTimeLabel(optionValue.toFixed(2));
|
||||
edgeTimeLabel = Math.trunc(optionValue) === optionValue ? timeLabelInt : timeLabelFloat;
|
||||
|
||||
result = dataLayerOption === 'rel_duration' ? edgeDurRel : edgeTimeLabel;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user