SIMILE | Timeline | Documentation | HotZoneEther class

- SIMILE
- Timeline
- Documentation
- HotZoneEther class

# Timeline.HotZoneEther class

Hot-zone ethers are intended to magnify time spans in which there are a lot of events compared to the rest of history. In the JFK Assassination example, the time span within the few days starting on November 22, 1963 is full of development.

A hot-zone ether is like a linear ether in that, generally, equal pixel distances map to equal time spans, and equal time spans map to equal pixel distances. However, there are zones in which this mapping is scaled as if magnifying glasses are put on them. These zones can overlap and the effect of an overlap is like that of overlapping two magnifying glasses.

## Initialization

The constructor of Timeline.HotZoneEther takes an object whose fields (listed below) specify initialization settings for the ether.

interval
required, a number of milliseconds in some date/time interval. The interval is intentionally left unspecified for your discretion. For example, if you want to use the interval of a day, you can construct your initialization object as follows:

    new Timeline.HotZoneEther({
        interval: 1000 * 60 * 60 * 24,
        ...
    });

or in a more understandable manner,

    new Timeline.HotZoneEther({
        interval: Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY],
        ...
    });

Together with the field pixelsPerInterval, this field specifies the mapping of the ether outside the hot zones.
pixelsPerInterval
required, the number of pixels corresponding to the date/time interval above. Start off with 100 and then adjust to achieve the effect you want. Together with the field interval, this field specifies the mapping of the ether outside the hot zones.
startsOn, endsOn, centersOn
optional. Any one of those fields can be specified to set (directly or indirectly) the origin of the ether. These can be String or Date objects; they are parsed using Timeline.DateTime.parseGregorianDateTime() into Date objects. If none of these fields is specified, the current date is used to center the ether.
zones
required, an array describing the hot zones. Each element of this array is an object with the following fields:
startTime
required, a String or a Date object that specifies the beginning date/time of the zone. It is parsed by Timeline.DateTime.parseGregorianDateTime() to get a Date object.
endTime
required, a String or a Date object that specifies the ending date/time of the zone. It is parsed by Timeline.DateTime.parseGregorianDateTime() to get a Date object.
magnify
required, a number specifying the magnification of the mapping in this zone. A greater-than-1 number causes more pixels to be mapped to the same time interval, resulting in a zoom-in effect.

## Example

Here is an example of constructing a hot zone ether:

    new Timeline.HotZoneEther({
        interval: Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY],
        pixelsPerInterval: 300,
        zones: [
            {   start:          "Fri Nov 22 1963 00:00:00 GMT-0600",
                end:            "Mon Nov 25 1963 00:00:00 GMT-0600",
                magnify:        3
            },
            {   start:          "Fri Nov 22 1963 09:00:00 GMT-0600",
                end:            "Fri Nov 22 1963 21:00:00 GMT-0600",
                magnify:        5
            }
        ],
        centersOn: "Fri Nov 22 1963 12:30:00 GMT-0600"
    });

This ether maps 300 pixels to a day for all time except during November 22, 23, and 24, 1963. On these 3 days, 3 x 300 = 900 pixels are mapped to a day, except from 9am to 9pm on November 22 when 5 x 900 = 4500 pixels are mapped to a day. Below, the upper band has such a hot zone ether while the lower band has a linear ether. As the two bands scroll in synchrony, observe the highlight in the lower band grow and shrink as the upper band moves over its hot zones.

## Related Topics

- Ethers, basics and interface
- Timeline.HotZoneGregorianEtherPainter, the default ether painter to be used for hot zone ethers