chart_style 参数说明
| 参数名 |
类型 |
说明 |
| chart_style |
String |
绘图风格:"standard"(标准,默认)、"classic"(经典)、"gd"(GD风格) |
include_coordinates 参数说明
| 参数名 |
类型 |
默认值 |
说明 |
| include_coordinates |
Boolean |
false |
是否返回坐标数据,用于前端交互。传 true 时返回 coordinates 字段,包含内外盘所有可点击元素的坐标位置 |
| theme |
String |
"light" |
主题:"light" 或 "dark",影响坐标计算时的配置 |
坐标数据返回结构
双盘返回的坐标数据包含两个盘的坐标:
{
"coordinates": {
"chart1": {
"svg_config": {...},
"planets": [...],
"houses": [...],
"signs": [...]
},
"chart2": {
"svg_config": {...},
"planets": [...],
"houses": [...],
"signs": [...]
}
}
}
坐标字段说明
| 字段 |
类型 |
说明 |
| planets |
array |
所有天体坐标,type 字段区分类型:planet、arabic_part、fixed_star 等 |
| houses |
array |
12个宫位数字的坐标位置 |
| signs |
array |
12个星座符号的坐标位置 |
| z_x, z_y |
number |
统一的坐标字段名,表示元素在SVG中的位置 |
aspect_scheme 参数说明
| 参数名 |
类型 |
说明 |
| aspect_scheme |
String |
相位方案名称(如:"one"、"two"、"three"、"natal"),不传则使用双盘类型的默认方案 |
orb_scheme 参数说明
| 参数名 |
类型 |
说明 |
| orb_scheme |
String |
容许度方案(如:"default"、"xingguang")。不传则使用双盘类型的默认方案 |
display_aspects 参数说明
| 值 |
类型 |
说明 |
| 不传递 |
- |
使用默认相位:["conjunction", "opposition", "trine", "square", "sextile"](5个主要相位) |
| "none" |
String |
不显示任何相位线 |
| [] |
Array |
空列表,使用默认相位(与不传递参数效果相同) |
| ["conjunction", "opposition"] |
Array |
只显示指定的相位 |
可用的相位名称
| 相位名称 |
含义 |
| conjunction |
合相 |
| opposition |
对冲 |
| trine |
三分相 |
| square |
四分相 |
| sextile |
六分相 |
| quincunx |
梅花相(150°) |
| semisextile |
半六分相(30°) |
| semisquare |
半刑相(45°) |
| sesquisquare |
一又四分之三相(135°) |
custom_orbs 参数结构(可选)
当 orb_scheme 选择为自定义方案时,可以通过 custom_orbs 指定不同相位与不同天体的容许度(单位:度)。
{
"custom_orbs": {
"aspects": {
"conjunction": 8.0,
"opposition": 8.0,
"trine": 6.0,
"square": 6.0,
"sextile": 4.0
},
"planets": {
"SUN": 2.0,
"MOON": 2.0
}
}
}
恒星相关参数(通用)
include_fixed_star
| 参数名 |
类型 |
说明 |
| include_fixed_star |
String/Boolean |
恒星选择方案(如:"royal"、"essential"、"important"、"default"、"complete";或 true/false) |
fixed_stars_list
| 参数名 |
类型 |
说明 |
| fixed_stars_list |
Array |
自定义恒星列表(使用恒星ID),如:["FS0016", "FS0035", "FS0031", "FS0033"] |
fixed_stars_in_svg
| 参数名 |
类型 |
说明 |
| fixed_stars_in_svg |
String/Array |
控制恒星在SVG中的显示(不影响恒星计算与相位分析),如:"all"、"conjunct"、["conjunction", "opposition"]、null |
内外圈显示参数(通用)
| 参数名 |
类型 |
说明 |
| inner_display_planets |
Array |
内圈(Chart1)在SVG中显示的天体列表,如:[0, 1, 2](太阳、月亮、水星) |
| outer_display_planets |
Array |
外圈(Chart2)在SVG中显示的天体列表,如:[0, 1](太阳、月亮) |
Chart1 / Chart2 专用参数
双盘接口支持分别为 Chart1(内圈)和 Chart2(外圈)配置不同的天体参数。
Chart1 (内圈) 常用参数
| 参数名 |
类型 |
说明 |
| chart1_planets_config |
Object |
第一个盘(内圈)的行星配置 |
| chart1_fixed_stars |
String/Boolean/Array |
第一个盘(内圈)的恒星配置 |
| chart1_custom_asteroids |
Array |
第一个盘(内圈)的小行星配置 |
| chart1_custom_arabic_parts |
Array |
第一个盘(内圈)的阿拉伯点配置 |
| chart1_custom_special_points |
Array |
第一个盘(内圈)的特殊点配置 |
| chart1_custom_eclipse_points |
Array |
第一个盘(内圈)的食点配置 |
| chart1_custom_syzygy_points |
Array |
第一个盘(内圈)的朔望点配置 |
Chart2 (外圈) 常用参数
| 参数名 |
类型 |
说明 |
| chart2_planets_config |
Object |
第二个盘(外圈)的行星配置 |
| chart2_fixed_stars |
String/Boolean/Array |
第二个盘(外圈)的恒星配置 |
| chart2_custom_asteroids |
Array |
第二个盘(外圈)的小行星配置 |
| chart2_custom_arabic_parts |
Array |
第二个盘(外圈)的阿拉伯点配置 |
| chart2_custom_special_points |
Array |
第二个盘(外圈)的特殊点配置 |
| chart2_custom_eclipse_points |
Array |
第二个盘(外圈)的食点配置 |
| chart2_custom_syzygy_points |
Array |
第二个盘(外圈)的朔望点配置 |
行星显示优先级规则
⚠️ 重要:计算 vs 显示的区别
系统采用双层配置:计算层决定哪些天体被计算,显示层决定哪些天体在SVG中显示。
内圈(Chart1)显示优先级:
inner_display_planets(如果明确传递)— 最高优先级,完全控制显示内容
chart1_custom_*配置(如果有自定义配置)— 显示所有自定义计算的天体
- 默认系统设置(如果没有任何自定义配置)— 使用双盘类型的默认配置
外圈(Chart2)显示优先级:
outer_display_planets(如果明确传递)— 最高优先级,完全控制显示内容
chart2_custom_*配置(如果有自定义配置)— 显示所有自定义计算的天体
- 默认系统设置(如果没有任何自定义配置)— 使用双盘类型的默认配置
✅ 实际应用示例:
- 如果传递了
chart1_custom_asteroids: [16, 201] 但 inner_display_planets: [0,1,2],则小行星会被计算但不会在SVG中显示
- 如果只传递了
chart1_custom_asteroids: [16, 201] 而不传 inner_display_planets,则小行星会被计算并显示
- 这种设计允许用户精确控制视觉呈现,避免图表过于拥挤
请求示例(通用)
恒星配置请求
{
"include_fixed_star": "default"
}
自定义恒星列表请求
{
"fixed_stars_list": ["FS0001", "FS0005", "FS0017"]
}
恒星在SVG中的显示控制
{
"include_fixed_star": "default",
"fixed_stars_in_svg": "all"
}
内外圈行星分别控制请求
{
"inner_display_planets": [0, 1, 2, 3, 4, 5, 6],
"outer_display_planets": [0, 1]
}
Chart1/Chart2 分离参数示例(分开计算)
{
"chart1_custom_asteroids": [16, 201],
"chart2_custom_asteroids": [433]
}
不显示相位的请求(display_aspects = "none")
{
"display_aspects": "none"
}
自定义容许度请求
{
"include_analysis": true,
"custom_orbs": {
"aspects": {
"conjunction": 1.0,
"opposition": 1.0,
"trine": 1.0,
"square": 1.0,
"sextile": 1.0
}
}
}
GD风格请求
{
"chart_style": "gd",
"include_analysis": true,
"include_fixed_star": "default"
}