public renderTimeAxis()

in tutorials/viewer/src/tutorial_view.tsx [60:76]


    public renderTimeAxis(timestamp: number, xScale: d3.ScaleLinear<number, number>) {
        return (
            <g>
                {this.props.tutorial.captions.map((caption, index) => (
                    caption.text != null ?
                        <rect
                            key={index}
                            className={classNames("el-ranges", ["is-active", this.state.currentCaptionIndex == index])}
                            y={4}
                            x={Math.min(xScale(caption.timeBegin), xScale(caption.timeEnd))}
                            height={12}
                            width={Math.abs(xScale(caption.timeEnd) - xScale(caption.timeBegin))}
                        /> : null
                ))}
            </g>
        );
    }