Tuesday, March 3, 2020

D3-Celestial Version 0.7: Better Star Names

To be able to present constellations and star names from other cultures like the traditional Chinese ones(upcoming feature), I refactored the star-naming system so that it is possible to display different types of names. The feature is selectable in the form below with the Stars -> Show section. The select box has the star name options Beyer, Flamsteed, variables, Gliese and designation, which is a combination of all the previous options, and contains whichever applies first.

Try selecting a different constellation, dial up the display limits and select different star designations to see the effect.

To facilitate the extended naming capability, I extracted all the different names and designations from the stellar data files into a separate file unsurprisingly called 'starnames.json' that contains all the names apart from the Hipparcos number. That also reduces redundancy, since most names only need to appear once.

These are the relevant options in the configuration object, all renamed from previous versions to better represent the actual meaning:

{
  stars: {
    designation: true, // Show star names (Bayer, Flamsteed, Variable star, Gliese or designation, 
                       // i.e. whichever of the previous applies first); may vary with culture setting
    designationType: "desig",  // Which kind of name is displayed as designation (fieldname in starnames.json)
    designationStyle: { fill: "#ddddbb", font: "11px 'Palatino Linotype', Georgia, Times, 'Times Roman', serif", 
                        align: "left", baseline: "top" },
    designationLimit: 2.5,  // Show only names for stars brighter than nameLimit
    propername: false,   // Show proper name (if present)
    propernameType: "name", // Field in starnames.json that contains proper name; may vary with culture setting
    propernameStyle: { fill: "#ddddbb", font: "13px 'Palatino Linotype', Georgia, Times, 'Times Roman', serif", 
                       align: "right", baseline: "bottom" },
    propernameLimit: 1.5,  // Show proper names for stars brighter than propernameLimit
}}

The different parameter names in older versions are transformed automatically to preserve backward compatibility.
Finally, I've also exposed an additional function, 'Celestial.showConstellation(id)', that zooms in and focuses on the selected constellation given with the three-letter-code ID (case-insensitive).

  // Zoom in on the constellation Orion
  Celestial.showConstellation('ori');

1 comment:

  1. Hi,

    Is it possible to only show 1 constellation? Like choose Sco and only show that with lines and rest is just stars?

    /J

    ReplyDelete