Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
.DS_Store
build/
coverage/
bun.lock


2 changes: 1 addition & 1 deletion dist/astrochart.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/jest.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _exports: import('ts-jest/dist/types').InitialOptionsTsJest;
export = _exports;
1 change: 1 addition & 0 deletions dist/project/__tests__/radix.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions dist/project/src/aspect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface FormedAspect {
name: string;
degree: number;
color: string;
width: number;
orbit: number;
};
precision: string;
Expand Down
1 change: 1 addition & 0 deletions dist/project/src/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface AspectData {
degree: number;
orbit: number;
color: string;
width: number;
}
export type Aspect = Record<string, AspectData>;
export interface Dignity {
Expand Down
21 changes: 21 additions & 0 deletions dist/webpack.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const entry: string;
export namespace module {
const rules: {
test: RegExp;
use: string;
exclude: RegExp[];
}[];
}
export namespace resolve {
const extensions: string[];
}
export const mode: string;
export namespace output {
const clean: boolean;
const path: string;
const filename: string;
namespace library {
const name: string;
const type: string;
}
}
55 changes: 42 additions & 13 deletions project/examples/radix/radix_2016_11_15.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,46 @@
<div id="paper"></div>

<script src="../../../dist/astrochart.js"></script>
<script type="text/javascript">

var data = {
"planets":{"Moon":[64.25288092281401],"Venus":[273.7830306594277],"Jupiter":[194.01740070357724],"NNode":[158.69506558607495],"Mars":[304.51132244447103],"Lilith":[229.84586450839743],"Saturn":[255.93879297657875, -0.2],"Chiron":[350.7902705629371],"Uranus":[21.33233540624847],"Sun":[233.42635496859216],"Mercury":[244.23481860676145],"Neptune":[339.24756865409074],"Pluto":[285.5359664922833]},
"cusps":[265.6850555442075,307.6441825689919,353.38796689506074,26.86890880306794,50.191811553503044,68.57049261566578,85.6850555442075,127.64418256899188,173.3879668950608,206.8689088030679,230.19181155350307,248.5704926156658]
};

window.onload = function () {
var chart = new astrochart.Chart('paper', 600, 600);
chart.radix( data ).aspects();
};
</script>
<script type="text/javascript">

var data = {
"planets": {
"Moon": [64.25288092281401],
"Venus": [273.7830306594277],
"Jupiter": [194.01740070357724],
"NNode": [158.69506558607495],
"Mars": [304.51132244447103],
"Lilith": [229.84586450839743],
"Saturn": [
255.93879297657875, -0.2
],
"Chiron": [350.7902705629371],
"Uranus": [21.33233540624847],
"Sun": [233.42635496859216],
"Mercury": [244.23481860676145],
"Neptune": [339.24756865409074],
"Pluto": [285.5359664922833]
},
"cusps": [
265.6850555442075,
307.6441825689919,
353.38796689506074,
26.86890880306794,
50.191811553503044,
68.57049261566578,
85.6850555442075,
127.64418256899188,
173.3879668950608,
206.8689088030679,
230.19181155350307,
248.5704926156658
]
};

window.onload = function () {
var chart = new astrochart.Chart('paper', 600, 600);
chart.radix(data).aspects();
};
</script>
</body>
</html>
</html>
13 changes: 7 additions & 6 deletions project/src/aspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ export interface FormedAspect {
name: string
degree: number
color: string
width: number
orbit: number
}
precision: string
}

const DEFAULT_ASPECTS = {
conjunction: { degree: 0, orbit: 10, color: 'transparent' },
square: { degree: 90, orbit: 8, color: '#FF4500' },
trine: { degree: 120, orbit: 8, color: '#27AE60' },
opposition: { degree: 180, orbit: 10, color: '#27AE60' }
conjunction: { degree: 0, orbit: 10, color: 'transparent', width: 4 },
square: { degree: 90, orbit: 8, color: '#FF4500', width: 4 },
trine: { degree: 120, orbit: 8, color: '#27AE60', width: 4 },
opposition: { degree: 180, orbit: 10, color: '#27AE60', width: 4 }
}
/**
* Aspects calculator
Expand Down Expand Up @@ -88,7 +89,7 @@ class AspectCalculator {
if (this.hasAspect(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect])) {
aspects.push(
{
aspect: { name: aspect, degree: this.settings.ASPECTS[aspect].degree, orbit: this.settings.ASPECTS[aspect].orbit, color: this.settings.ASPECTS[aspect].color },
aspect: { name: aspect, degree: this.settings.ASPECTS[aspect].degree, orbit: this.settings.ASPECTS[aspect].orbit, color: this.settings.ASPECTS[aspect].color, width: this.settings.ASPECTS[aspect].width },
point: { name: point, position: points[point][0] },
toPoint: { name: toPoint, position: this.toPoints[toPoint][0] },
precision: this.calcPrecision(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect].degree).toFixed(4)
Expand Down Expand Up @@ -139,7 +140,7 @@ class AspectCalculator {

aspects.push(
{
aspect: { name: aspect, degree: this.settings.ASPECTS[aspect].degree, orbit: this.settings.ASPECTS[aspect].orbit, color: this.settings.ASPECTS[aspect].color },
aspect: { name: aspect, degree: this.settings.ASPECTS[aspect].degree, orbit: this.settings.ASPECTS[aspect].orbit, color: this.settings.ASPECTS[aspect].color, width: this.settings.ASPECTS[aspect].width },
point: { name: point, position: points[point][0] },
toPoint: { name: toPoint, position: this.toPoints[toPoint][0] },
precision: precision.toFixed(4)
Expand Down
2 changes: 1 addition & 1 deletion project/src/radix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class Radix {

const line = this.paper.line(startPoint.x, startPoint.y, endPoint.x, endPoint.y)
line.setAttribute('stroke', this.settings.STROKE_ONLY ? this.settings.LINE_COLOR : aspectsList[i].aspect.color)
line.setAttribute('stroke-width', (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString())
line.setAttribute('stroke-width', (aspectsList[i].aspect?.width ? aspectsList[i].aspect.width : this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString())

line.setAttribute('data-name', aspectsList[i].aspect.name)
line.setAttribute('data-degree', aspectsList[i].aspect.degree.toString())
Expand Down
10 changes: 5 additions & 5 deletions project/src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type SVG from './svg'

export interface AspectData { degree: number; orbit: number; color: string }
export interface AspectData { degree: number; orbit: number; color: string; width: number; }
export type Aspect = Record<string, AspectData>
export interface Dignity {
name: string
Expand Down Expand Up @@ -283,10 +283,10 @@ const settings: Settings = {

// Aspects
ASPECTS: {
conjunction: { degree: 0, orbit: 10, color: 'transparent' },
square: { degree: 90, orbit: 8, color: '#FF4500' },
trine: { degree: 120, orbit: 8, color: '#27AE60' },
opposition: { degree: 180, orbit: 10, color: '#27AE60' }
conjunction: { degree: 0, orbit: 10, color: 'transparent', width: 4 },
square: { degree: 90, orbit: 8, color: '#FF4500', width: 4 },
trine: { degree: 120, orbit: 8, color: '#27AE60', width: 4 },
opposition: { degree: 180, orbit: 10, color: '#27AE60', width: 4 }
},

// Dignities
Expand Down