AstroChart

repository·master·Indexed 42 days ago

https://github.com/kibo/astrochart

A pure JavaScript library for generating SVG-based astrological charts. Version 2.0.1 focuses exclusively on visualization and requires planetary data to be provided by the user, as it does not perform astronomical calculations.

Tokens
455
Snippets
3
Records
3
Agent score
3%

What's inside AstroChart

  1. Format planetary data for AstroChart

    master

    AstroChart expects a data object containing a planets map and a cusps array.

    • planets: An object where keys are planet names and values are arrays containing the position (degree).
    • cusps: An array of numbers representing the house cusp positions.

    Supported Planet Keys: Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Chiron, Lilith, NNode.

    {
    	"planets":{"Moon":[0], "Sun":[30], "Mercury":[60]},
    	"cusps":[300, 340, 30, 60, 75, 90, 116, 172, 210, 236, 250, 274]
    }
  2. Initialize and render an AstroChart

    master

    To use AstroChart, include the astrochart.min.js script in your HTML. You can then instantiate a new chart by calling new astrology.Chart(id, width, height) and rendering a radix chart using the .radix(data) method.

    Note: AstroChart is a visualization library only; it does not calculate planetary positions. You must provide the planetary data yourself.

    <script src="js/astrochart.min.js"></script>
    <script>
    	window.onload = function(){
    		var chart = new astrology.Chart( 'paper', 800, 800);
    		chart.radix( data );
    	};
    </script>
  3. Configure AstroChart with custom settings

    master

    You can pass a settings object as the fourth argument to the astrology.Chart constructor to customize the chart's appearance or behavior. For example, you can adjust the SYMBOL_SCALE.

    var settings = {SYMBOL_SCALE:2};
    var chart = new astrology.Chart( 'paper', 800, 800, settings);