So if I understand this correctly, in band.js, within Timeline._Band = function(timeline, bandInfo, index) {...}, add:
/* attached image div for the band */
if (bandInfo.bandImage) {
this._bandImage = this._timeline.getDocument().createElement("div");
this._bandImage.className = "timeline-band-image-layer";
var img = this._timeline.getDocument().createElement("img");
img.src = ("bandImage" in bandInfo) ? bandInfo.bandImage : "../images/blue-circle.png";
this._label.appendChild(img);
this._timeline.addDiv(this._bandImage);
}
I'm just using blue-circle.png from images in the parent folder of band.js to test. Then within timeline.js, in Timeline.createBandInfo = function(params) {...}, I would need to do something like:
if ("bandImage" in params) { ...}
or should it be in Timeline.create ?
Still trying to understand everything under the hood, so a bit confused.
My eventual goal is to be able to tack on an image (perhaps a jagged edge) to bands where:
1. Start date is unknown, tack onto beginning band
2. End date is unknown, tack onto end of band
3. Start and end date is unknown, tack onto both ends of band
At the same time, I'd like to integrate it into the color of the band, so there will be a number of images. The plan is to specify the image as a parameter within the source json file for each band. I've done something similar by leveraging 'classname' and using the associated css to decide band color and a fade gradient at the ends of the band, consistent with which dates are known and unknown. However, the gradient is a % function of the length of the band, so it does not always look consistent. I got a bit closer by specifying the gradient using pixel count, but still not exactly right:
If you can suggest a better way of doing this, I'm totally open to suggestions.
steve