How to use the pondjs.TimeRange function in pondjs

To help you get started, we’ve selected a few pondjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esnet / react-timeseries-charts / packages / react-timeseries-charts / src / MultiBrush.tsx View on Github external
: tb;
                newEnd =
                    this.state.brushingInitializationSite === "brush" ||
                    this.state.brushingInitializationSite === "handle-right"
                        ? Math.round(te - endOffsetConstrain)
                        : te;

                // Swap if needed
                if (newBegin > newEnd) {
                    [newBegin, newEnd] = [newEnd, newBegin];
                }
            }

            if (this.props.onTimeRangeChanged) {
                this.props.onTimeRangeChanged(
                    new TimeRange(newBegin, newEnd),
                    this.state.brushIndex
                );
            }
        }
    }
github esnet / react-timeseries-charts / lib / components / MultiBrush.js View on Github external
}

                    newBegin = this.state.brushingInitializationSite === "brush" || this.state.brushingInitializationSite === "handle-left" ? parseInt(tb - startOffsetConstraint, 10) : tb;
                    newEnd = this.state.brushingInitializationSite === "brush" || this.state.brushingInitializationSite === "handle-right" ? parseInt(te - endOffsetConstrain, 10) : te;

                    // Swap if needed
                    if (newBegin > newEnd) {
                        ;
                        var _ref = [newEnd, newBegin];
                        newBegin = _ref[0];
                        newEnd = _ref[1];
                    }
                }

                if (this.props.onTimeRangeChanged) {
                    this.props.onTimeRangeChanged(new _pondjs.TimeRange(newBegin, newEnd), this.state.brushIndex);
                }
            }
        }
github openpowerquality / opq / view / app / imports / ui / components / EventInspector / EventSummary.jsx View on Github external
constructor(props) {
    super(props);

    const { event } = props;

    const start = event.target_event_start_timestamp_ms;
    const end = event.target_event_end_timestamp_ms;

    this.state = {
      waveforms: [],
      waveformsVisible: {},
      timeRange: new TimeRange(start, end),
      start,
      end,
    };
  }
github esnet / react-timeseries-charts / src / components / EventHandler.js View on Github external
let newBegin = parseInt(this.state.initialPanBegin - timeOffset, 10);
            let newEnd = parseInt(this.state.initialPanEnd - timeOffset, 10);
            const duration = parseInt(this.state.initialPanEnd - this.state.initialPanBegin, 10);

            if (this.props.minTime && newBegin < this.props.minTime.getTime()) {
                newBegin = this.props.minTime.getTime();
                newEnd = newBegin + duration;
            }

            if (this.props.maxTime && newEnd > this.props.maxTime.getTime()) {
                newEnd = this.props.maxTime.getTime();
                newBegin = newEnd - duration;
            }

            const newTimeRange = new TimeRange(newBegin, newEnd);
            if (this.props.onZoom) {
                this.props.onZoom(newTimeRange);
            }
        } else if (this.props.onMouseMove) {
            const mousePosition = this.getOffsetMousePosition(e);
            if (this.props.onMouseMove) {
                this.props.onMouseMove(mousePosition[0], mousePosition[1]);
            }
        }
    }
github esnet / react-timeseries-charts / lib / components / EventHandler.js View on Github external
var newBegin = parseInt(this.state.initialPanBegin - timeOffset, 10);
                var newEnd = parseInt(this.state.initialPanEnd - timeOffset, 10);
                var duration = parseInt(this.state.initialPanEnd - this.state.initialPanBegin, 10);

                if (this.props.minTime && newBegin < this.props.minTime.getTime()) {
                    newBegin = this.props.minTime.getTime();
                    newEnd = newBegin + duration;
                }

                if (this.props.maxTime && newEnd > this.props.maxTime.getTime()) {
                    newEnd = this.props.maxTime.getTime();
                    newBegin = newEnd - duration;
                }

                var newTimeRange = new _pondjs.TimeRange(newBegin, newEnd);
                if (this.props.onZoom) {
                    this.props.onZoom(newTimeRange);
                }
            } else if (this.props.onMouseMove) {
                var mousePosition = this.getOffsetMousePosition(e);
                if (this.props.onMouseMove) {
                    this.props.onMouseMove(mousePosition[0], mousePosition[1]);
                }
            }
        }
    }, {
github esnet / react-timeseries-charts / src / components / Brush.js View on Github external
viewport() {
        const { width, timeScale } = this.props;
        const viewBeginTime = timeScale.invert(0);
        const viewEndTime = timeScale.invert(width);
        return new TimeRange(viewBeginTime, viewEndTime);
    }
github esnet / react-timeseries-charts / packages / react-timeseries-charts / src / MultiBrush.tsx View on Github external
viewport() {
        const { width, timeScale } = this.props;
        const viewBeginTime = timeScale.invert(0);
        const viewEndTime = timeScale.invert(width);
        return new TimeRange(viewBeginTime, viewEndTime);
    }
github esnet / react-timeseries-charts / src / components / MultiBrush.js View on Github external
viewport() {
        const { width, timeScale } = this.props;
        const viewBeginTime = timeScale.invert(0);
        const viewEndTime = timeScale.invert(width);
        return new TimeRange(viewBeginTime, viewEndTime);
    }

pondjs

A timeseries library build on top of immutable.js

BSD-3-Clause-LBNL
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular pondjs functions