本文整理汇总了TypeScript中iching.js类的典型用法代码示例。如果您正苦于以下问题:TypeScript js类的具体用法?TypeScript js怎么用?TypeScript js使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了js类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: updateSelectedValue
updateSelectedValue() {
if(this.upper_yao && this.lower_yao) {
var hexagram = iching.trigram2hexagram(this.upper_yao, this.lower_yao);
var gong = iching.getGongName(hexagram);
var name = iching.getHexagramName(hexagram);
var wuxing = iching.getWuXing(gong);
this.gua_infos = [];
this.gua_infos.push({
title: hexagram,
gong: gong,
name: name,
wuxing: wuxing
})
}
}
开发者ID:l2yao,项目名称:Iching,代码行数:15,代码来源:bagong-page.ts
示例2: constructor
constructor() {
this.items = [];
for(let i = 0; i < 8; i++) {
this.items.push({
title: iching.getTrigrams()[i]
})
}
}
开发者ID:l2yao,项目名称:Iching,代码行数:8,代码来源:bagong-page.ts
示例3: updateChanges
updateChanges() {
if (this.calendar && this.birthday && this.birthtime) {
var lunarInfo;
var dateArray = this.birthday.split('-');
if (this.calendar == 'solar') {
lunarInfo = lunarCalendar.solarToLunar(dateArray[0], dateArray[1], dateArray[2]);
} else {
var solarInfo = lunarCalendar.lunarToSolar(dateArray[0], dateArray[1], dateArray[2]);
lunarInfo = lunarCalendar.solarToLunar(solarInfo.year, solarInfo.month, solarInfo.day);
}
var upper_yao = iching.getXianTianBaGua(Math.round(lunarInfo.lunarDay));
var lower_yao = iching.getXianTianBaGua(lunarInfo.lunarMonth);
var hexagram = iching.trigram2hexagram(upper_yao, lower_yao);
var gong = iching.getGongName(hexagram);
var name = iching.getHexagramName(hexagram);
var wuxing = iching.getWuXing(gong);
var sizhu = lunarInfo.GanZhiYear + '年 ' + lunarInfo.GanZhiMonth + '月 ' + lunarInfo.GanZhiDay + '日';
this.gua_infos = [];
this.gua_infos.push({
sizhu: sizhu,
gong: gong,
name: name,
wuxing: wuxing
});
d3.select("svg").remove();
var svgContainer = d3.select('#bazi').append("svg")
.attr("width", 400)
.attr("height", 420);
iching.drawTrigrams(svgContainer, upper_yao, lower_yao, lunarInfo.GanZhiDay.substring(0,1));
}
}
开发者ID:l2yao,项目名称:Iching,代码行数:32,代码来源:bazi-page.ts
示例4: updateChanges
updateChanges(event) {
if( typeof this.flip1 != 'undefined' && typeof this.flip2 != 'undefined' && typeof this.flip3 != 'undefined'
&& typeof this.flip4 != 'undefined' && typeof this.flip5 != 'undefined' && typeof this.flip6 != 'undefined') {
var first_yao = iching.zheng2yinyang(this.flip1);
var second_yao = iching.zheng2yinyang(this.flip2);
var third_yao = iching.zheng2yinyang(this.flip3);
var forth_yao = iching.zheng2yinyang(this.flip4);
var fifth_yao = iching.zheng2yinyang(this.flip5);
var sixth_yao = iching.zheng2yinyang(this.flip6);
var upper_yao = iching.yinyang2trigram(forth_yao, fifth_yao, sixth_yao);
var lower_yao = iching.yinyang2trigram(first_yao, second_yao, third_yao);
var today = new Date();
var day = today.getDate();
var month = today.getMonth()+1; //January is 0!
var year = today.getFullYear();
var lunarInfo = lunarCalendar.solarToLunar(year, month, day);
var hexagram = iching.trigram2hexagram(upper_yao, lower_yao);
var gong = iching.getGongName(hexagram);
var name = iching.getHexagramName(hexagram);
var wuxing = iching.getWuXing(gong);
var sizhu = lunarInfo.GanZhiYear + '年 ' + lunarInfo.GanZhiMonth + '月 ' + lunarInfo.GanZhiDay + '日';
this.gua_infos = [];
this.gua_infos.push({
sizhu: sizhu,
gong: gong,
name: name,
wuxing: wuxing
});
d3.select("svg").remove();
var svgContainer = d3.select('#zhanbu').append("svg")
.attr("width", 400)
.attr("height", 420);
iching.drawTrigrams(svgContainer, upper_yao, lower_yao, lunarInfo.GanZhiDay.substring(0,1));
}
}
开发者ID:l2yao,项目名称:Iching,代码行数:39,代码来源:zhanbu-page.ts
注:本文中的iching.js类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论