Global

Methods

cvNumCols(rows, kpDigopt) → {Object}

Description:
  • 將表格各列中以文字傳入之數值欄轉為數值,並依欄位型別給予過濾器型別

    計算結果列之數值欄在來源列為文字時會原樣保留文字,表格預設之數值過濾器('num')比對文字值會得不到列。 逐欄判型:①欄內非空值皆為數值或數值字串,且各值轉為數值前後之顯示文字(含kpDig取位)皆相同時,該欄文字值轉為數值並給予'num'過濾器; ②其餘有非空值之欄維持原值並給予'text'過濾器(例如含NP、-之欄,或不取位而尾零會因轉數值消失之欄);③全為空值之欄不指定(沿用表格預設之數值過濾器,因無資料故無實質影響)。 顯示文字不變為硬約束,故轉換不會改變儲存格所見:有kpDig之欄因取位函數內部即先轉數值,轉換前後之顯示文字必然相同(檢查恆成立,保障來自取位本身), 無kpDig之欄才實際比對字面(尾零、前導零、前後空白、科學記號、正負號、十六進位字樣等字面不同者維持文字); 數值字串另須為有限值且絕對值不超過安全整數上限,否則(Infinity、1e309、超過2^53之整數)維持文字,避免轉換時夾限或失去精度

Source:
Parameters:
Name Type Attributes Default Description
rows Array

輸入列物件陣列,各列鍵同第1列

kpDig Object <optional>
{}

輸入欄位鍵對應顯示小數位數之物件

Returns:

回傳物件,含rows(新的列物件陣列,不改動輸入)與kpHeadFilterType(欄位鍵對應'num'或'text'之物件)

Type
Object

getCellText(v, idigopt) → {String}

Description:
  • 取得表格儲存格之顯示文字

    給予idig(kpDig內該欄位之小數位數)且值為數字(含數字字串)時取位,其餘空值為空字串、字串與數字原樣轉字串、物件與陣列轉JSON字串(含循環參照時為空字串), 轉換規則同w-aggrid-vue預設儲存格顯示,使儲存格slot與數值欄轉型前後之顯示比對共用同一份定義

Source:
Parameters:
Name Type Attributes Description
v *

輸入儲存格值

idig Integer <optional>

輸入小數位數,未給或undefined代表不取位

Returns:

回傳顯示文字字串

Type
String

getDefAxis(optopt) → {Object}

Description:
  • 產生預設Highcharts軸物件

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

Returns:

回傳物件

Type
Object

getDefChart(optopt) → {Object}

Description:
  • 產生預設Highcharts圖物件

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

Returns:

回傳物件

Type
Object

getDefLegend(optopt) → {Object}

Description:
  • 產生預設Highcharts圖例物件

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

Returns:

回傳物件

Type
Object

getDefOpt(optopt) → {Object}

Description:
  • 產生預設Highcharts設定物件

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

Returns:

回傳物件

Type
Object

getIdig(kpDig, k) → {*}

Description:
  • 取得kpDig內某欄位之顯示小數位數

    只取kpDig自有之鍵(不含constructor、toString等繼承成員),無則回傳undefined代表不取位

Source:
Parameters:
Name Type Description
kpDig Object

輸入欄位鍵對應顯示小數位數之物件

k String

輸入欄位鍵

Returns:

回傳小數位數,無該鍵時為undefined

Type
*

getSoilCodeIcon() → {Object}

Description:
  • 取得土壤圖例代碼對應土壤圖示物件,key為圖例代碼字串(如'105'、'227'),值為png之data URI字串,圖示取自w-demores之dataCivilSoilCodeIcon並內建於本套件,供無連外網路之環境使用

    因圖示數據量大,回傳者為內部物件本身而非複製品,故取用時僅可讀取不可改寫

Source:
Returns:

回傳土壤圖例代碼對應土壤圖示物件

Type
Object

setLegendLoc(optopt, optionsPicopt) → {Object}

Description:
  • 使用繪圖設定物件針對Highcharts物件處理圖例位置

Source:
Parameters:
Name Type Attributes Default Description
opt Object <optional>
{}

輸入設定物件,預設{}

optionsPic Object <optional>
{}

輸入繪圖設定物件,預設{}

Returns:

回傳物件

Type
Object