Git Product home page Git Product logo

sylarlong / iztro Goto Github PK

View Code? Open in Web Editor NEW
1.9K 22.0 240.0 27 MB

⭐A lightweight open-source JavaScript library for obtaining The Purple Star Astrology (Zi Wei Dou Shu) astrolabe information.. 支持多语言轻量级获取紫微斗数排盘信息的javascript开源库。

Home Page: https://iztro.com

License: MIT License

TypeScript 99.43% JavaScript 0.57%
astrolabe astrology horoscope ziweidoushu chinese-astrology javascript npm typescript natal-chart

iztro's Introduction

Hi there 👋

💖Visit Count💖


Visit Count

Languages and Tools

How to reach me

  • Send emails to me:

  • Add me on WeChat:

    WeChat

iztro's People

Contributors

dependabot[bot] avatar fossabot avatar sanchun333 avatar sylarlong avatar thiepwong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iztro's Issues

流月索引错误 | monthly index is incorrect

描述(Description)

由于对流月索引计算方式的理解错误,导致原本正确的流月索引出现了错误。感谢网友 先不要慌 的指出。

Monthly horoscope index is incorrect because of my misunderstanding. Thanks to 先不要慌

版本(Version)

  • v1.2.3
  • v1.2.4
  • v1.2.5

v1.2.3 以前的版本不受影响
only affect v1.2.3 v1.2.4 and v1.2.5


#36 引发。(caused by #36 )

加入流时信息|Add timely scope information

摘要(Summary)

🇨🇳
在运限信息中加入流时信息。

🇺🇸
Add timely scope information to horoscope.


Ref. #1 (comment)

需求(Requirements)

🇨🇳

  • 包含流时所在宫位索引
  • 流时天干
  • 流时四化

🇺🇸

  • timely scope index should be included
  • heavenly stem of timely scope should be included
  • mutagen of timely scope should be included.

是否加入流时星耀,还需在今后大家的使用中来决定。

支持国际化输出|support localization

摘要(Summary)

🇨🇳
暂定支持 🇨🇳 简体中文🇭🇰 繁体中文🇺🇸 英文🇯🇵 日文🇰🇷 韩文 输出。

🇺🇸
Provisionally support 🇨🇳 Simplify Chinese, 🇭🇰 Traditional Chinese, 🇺🇸 English, 🇯🇵 Japanese and 🇰🇷 Korean.

开发插件相关功能

摘要(Summary)

新建插件功能,以支持更多、更灵活的配置以及方法。


需求(Requirements)

  • 全局配置插件
  • 全局配置数据(比如四化)

请问什么时候出手机版本?

摘要(Summary)

🇨🇳

🇺🇸


Ref. {referrence}

需求(Requirements)

🇨🇳

  • 需求一
  • 需求二
  • ...

🇺🇸

  • feature 1
  • feature 2
  • ...

v2.0.4:horoscope-计算流日不准确

描述(Description)

版本(Version)

  • {version number}

环境(Environment)

重现(Reproduce)

  • 调用的方法(funciton name)

  • 参数(parameters)

  • 返回值(returns)

优化Horoscope|optimize Horoscope

摘要(Summary)

🇨🇳
目前Horoscope对象还有些不方便,需要新增name字段

🇺🇸
need to add a new field name


需求(Requirements)

🇨🇳

  • Horoscope 添加 name 字段
  • name 字段添加国际化翻译
  • 更新文档
  • 更新UT

🇺🇸

  • add name field to Horoscope
  • name should be localized
  • update docs
  • update UT

新增静态方法|add some static methods

摘要(Summary)

🇨🇳
新增一些静态方法

🇺🇸
add some static methods


Ref. {referrence}

需求(Requirements)

🇨🇳

  • 新增获取命宫主星方法
  • 新增获取生肖方法
  • 新增获取星座方法

🇺🇸

  • add a function to get major stars
  • add a function to get Chinese zodiac
  • add a function to get sign

v2.0.7:排盘-天梁星在申宫亮度错误

描述(Description)

天梁星在申宫时,亮度应为陷,排出来的亮度是庙

版本(Version)

  • v2.0.7

环境(Environment)

网页

重现(Reproduce)

  • 调用的方法(funciton name)

链接

  • 参数(parameters)

  • 返回值(returns)

v2.2.1 : 来因宫错误

描述(Description)

来因宫应该以生年天干判断,程序内目前错误的以地支判断了。

版本(Version)

  • v2.2.1

返回对象里加入获取运限的方法|Add a function to get horoscope in the response object

摘要(Summary)

🇨🇳
现在返回的星盘对象和获取流耀的方法是分开的,这样在调用的时候不是很方便,所以需要在返回的对象里面加入一个方法来获取制定日期的运限信息以及流曜。

🇺🇸
The astrolabe object and get horoscope stars function are detached. It's not convenient. So it would be better to add a function to get horoscope of specific date.


需求(Requirements)

🇨🇳

  • 传入时间可选,当没传入时间的时候默认获取当前日期
  • 返回数据应该包含当前时间大限、流年、流月以及流日的索引
  • 返回虚岁以便通过虚岁定位小限宫位
  • 返回大限以及流年的流曜
  • 返回大限、流年、流月以及流日的四化

🇺🇸

  • Date can be optional. When no date is provided, it will default to the current date.
  • The returned data should include the indexes of the decadal scope, yearly scope, monthly scope, and daily scope.
  • Return nominal age to determine the age-related scope.
  • Return decadal and yearly scope stars.
  • Return mutagen of decadal yearly monthly and daily scope.

新增小限12宫

摘要(Summary)

⚠️ 对于小限来说,只有小限命宫有意义,但是有用户有展示小限12宫的需求,所以在此添加到age字段中以便有需求的用户取用。

[v2.0.6-] 小限顺序错误

描述(Description)

由于没有考虑到多语言的判断问题导致小限的排列错误。

版本(Version)

  • v2.0.6(含)以前版本

星辰排布

摘要(Summary)

🇨🇳
看着很别扭,为什么不是竖着排,从右到左的顺序,这个排盘的布局还得自己实现吗,底层调上来的星辰得转换成竖着吗

ziwei.pub footer css 样式问题

描述(Description)

页面滚动到最下方后,部分内容被 footer 遮挡
image

footer 的 position: fixed; -> position: sticky; 应该可以解决

版本(Version)

环境(Environment)

重现(Reproduce)

三方四正宫位|surrounded palaces

摘要(Summary)

🇨🇳
获取三方四正宫位以及对三方四正宫位星耀的判断

🇺🇸
Get surrounded palaces. Stars analyzation.


需求(Requirements)

🇨🇳

  • 能够获取三方四正宫位
  • 判断指定星耀是否全部在三方四正内
  • 判断指定星耀是否至少有一颗在三方四正内
  • 判断指定星耀是否全不在三方四正内

🇺🇸

  • get surrounded palaces.
  • check whether all specific stars are in the surrounded palaces
  • check whether one of the specific stars are in the surrounded palaces
  • check whether all specific stars are not in the surrounded palaces

创建FunctionalHoroscope类|create FunctionalHoroscope class

摘要(Summary)

🇨🇳
需要加入FunctionalHoroscope类来进行运限的分析。

🇺🇸
in order to analyze horoscope, we need to add FunctionalHoroscope class.


Ref. {referrence}

需求(Requirements)

🇨🇳

  • FunctionalHoroscope 需要继承 Horoscope 的所有属性
  • FunctionalHoroscope 需要实现类似 FunctionalAstrolabe 的功能
    • 获取运限的宫位
    • 获取运限指定宫位的三方四正
    • 判断宫位星耀情况
    • 判断运限四化情况 为了不让一个PR过于复杂,将在下一个版本实现

🇺🇸

  • extends properties of Horoscope
  • implements functions like FunctionalAstrolabe
    • to get specific palace of a horoscope
    • to get surrounded palaces of a horoscope
    • to check stars of a horoscope
    • to check mutagens of a horoscope will be implemented in the next version to keep the PR simpler

v2.2.0: 疑似小限数据错误

描述(Description)

据用户报告,在运限时间超过85岁以后,小限数据不再变化。

版本(Version)

  • v2.2.0

环境(Environment)

重现(Reproduce)

  • 调用的方法(funciton name)

    horoscope()

分离日期转换组件

摘要(Summary)

将农历阳历转换代码解耦

需求(Requirements)

  • 分离calendar文件夹下代码到 新的仓库
  • 覆盖当前calendar组件所有功能

{2.2.2}:{decadal}-运钺和运魁可能设置反了

  1. 用生日制作一个astrolabe
  2. horoscope = astrolabe.horoscope()得到十年大运
  3. 在大运数据里,找到decadal = horoscope["decadal"]大运具体信息
  4. 再找到此大运相关的天魁天钺decadal["stars"]
  5. 此时会发现运魁运钺(或者叫大魁大钺)可能是反的

真太陽時間校正

摘要(Summary)

🇨🇳

因為經度產生時差的問題,會讓我們以為生日當時紀錄的時間是正確的。例如,在台北同一時間在重慶出生的人,雖然行政時間是一樣的,但是其實已經有很巨大的時差。真太陽時間就是在進行這個與中原標準時間的校正,這樣就可以進行全球東西半球正確的紫微斗數的排盤。

重构代码

摘要(Summary)

将以前 Star 转化为 FunctionalStar 的方法去掉,改为在初始化的时候就生成 FunctionalStar 实例。

需求(Requirements)

  • 删除 _toFunctionalStars() 方法
  • 重构代码
  • 修改UT

新增空宫判断

摘要(Summary)

FunctionalPalace 中新增一个方法,判断该宫位是否为空宫。

宫位飞星判断

摘要(Summary)

🇨🇳
目前功能只有生年四化和流四化的判断,需要加入宫位飞星四化的判断。


需求(Requirements)

🇨🇳

  • 判断指定宫位是否飞化到目标宫位,四化传入数组,中一个即返回true
    • 目标宫位序号或名字,四化(数组)
    • 输出布尔值
  • 判断指定宫位是否没有飞化到目标宫位,四化传入数组,所有四化都没有中才返回true
    • 目标宫位序号或名字,四化(数组)
    • 输出布尔值
  • 判断指定宫位是否有自化
    • 传入四化(可选),如果不传入则会判断所有四化
    • 输出布尔值
  • 获取指定宫位飞化宫位数据
    • 目标宫位序号或名字
    • 输出禄权科忌所在宫位实例数组,数组下标对应 [禄,权,科,忌]

农历月底晚子时不对

描述(Description)

农历月底的时候晚子时加一天以后没有考虑到月份也要加一的问题。

版本(Version)

  • 所有版本

重现(Reproduce)

  • 调用的方法(funciton name)

    • astrolabeByLunarDate()
  • 参数(parameters)

    • lunarDateStr: 1987-10-30
    • timeIndex: 12
    • gender: 女

判断星耀是否有四化|Check mutagen state for stars

摘要(Summary)

🇨🇳
紫微斗数的大部分主星和部分辅星会起四化(禄、权、科、忌),而限运和宫位也会起四化,此版本只实现本命四化

🇺🇸
Most major stars and some minor stars in Zi Wei Dou Shu have four mutagens which are addtional mutagen, forceful mutagen, easygoing mutagen and focused mutagen. Besides, horoscope and palaces have those mutagens as well. We only focus on original mutagens in this issue.


需求(Requirements)

🇨🇳

  • 判断指定星耀是否有四化
  • 判断指定宫位内是否有四化
  • 判断三方四正内是否有四化
  • 判断对宫是否有四化

🇺🇸

  • check mutagen status for specific start
  • check mutagen status for specific palace
  • check mutagen status for surrounded palaces
  • check mutagen status for opposite palace

是否支持python调用?

首先感谢您的无私开源,这个仓库对我的帮助很大。
如题,请问目前该库是否支持python调用?
如果支持的话,请问应当如何调用呢?
如果不支持的话,是否在未来有添加python支持的可能性?
期待着您的回复,这对我非常重要,谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.