How to use the d3-time.timeMilliseconds function in d3-time

To help you get started, we’ve selected a few d3-time 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 DefinitelyTyped / DefinitelyTyped / d3-time / d3-time-tests.ts View on Github external
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => { return d.getMonth() === 2; });

// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval

// Test built-in factories and date array creator definitions ------------------

countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);

countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);

countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);

countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);

countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
github DefinitelyTyped / DefinitelyTyped / types / d3-time / d3-time-tests.ts View on Github external
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => d.getMonth() === 2);

// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval

// Test built-in factories and date array creator definitions ------------------

countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);

countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);

countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);

countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);

countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
github DefinitelyTyped / DefinitelyTyped / types / d3-time / d3-time-tests.ts View on Github external
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => d.getMonth() === 2);

// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval

// Test built-in factories and date array creator definitions ------------------

countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);

countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);

countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);

countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);

countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
dateArray = d3Time.timeDays(start, end, 2);
github DefinitelyTyped / DefinitelyTyped / d3-time / d3-time-tests.ts View on Github external
resultDate = simpleI.floor(inBetween);
resultDate = simpleI.round(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.ceil(inBetween);
resultDate = simpleI.offset(inBetween);
resultDate = simpleI.offset(inBetween, 3);
simpleI = simpleI.filter((d: Date) => { return d.getMonth() === 2; });

// count = simpleI.count(start, end); // Test fails, since .count(...) is not defined on Interval
// simpleI = simpleI.every(10); // Test fails, since .every(...) is not defined on Interval

// Test built-in factories and date array creator definitions ------------------

countableI = d3Time.timeMillisecond;
dateArray = d3Time.timeMilliseconds(start, end);
dateArray = d3Time.timeMilliseconds(start, end, 60000);

countableI = d3Time.timeSecond;
dateArray = d3Time.timeSeconds(start, end);
dateArray = d3Time.timeSeconds(start, end, 120);

countableI = d3Time.timeMinute;
dateArray = d3Time.timeMinutes(start, end);
dateArray = d3Time.timeMinutes(start, end, 5);

countableI = d3Time.timeHour;
dateArray = d3Time.timeHours(start, end);
dateArray = d3Time.timeHours(start, end, 2);

countableI = d3Time.timeDay;
dateArray = d3Time.timeDays(start, end);
dateArray = d3Time.timeDays(start, end, 2);
github elastic / kibana / x-pack / legacy / plugins / infra / server / lib / adapters / log_entries / kibana_log_entries_adapter.ts View on Github external
public async getContainedLogSummaryBuckets(
    request: InfraFrameworkRequest,
    sourceConfiguration: InfraSourceConfiguration,
    start: number,
    end: number,
    bucketSize: number,
    filterQuery?: LogEntryQuery
  ): Promise {
    const bucketIntervalStarts = timeMilliseconds(new Date(start), new Date(end), bucketSize);

    const query = {
      allowNoIndices: true,
      index: sourceConfiguration.logAlias,
      ignoreUnavailable: true,
      body: {
        aggregations: {
          count_by_date: {
            date_range: {
              field: sourceConfiguration.fields.timestamp,
              format: TIMESTAMP_FORMAT,
              ranges: bucketIntervalStarts.map(bucketIntervalStart => ({
                from: bucketIntervalStart.getTime(),
                to: bucketIntervalStart.getTime() + bucketSize,
              })),
            },
github elastic / kibana / x-pack / plugins / infra / server / lib / adapters / log_entries / kibana_log_entries_adapter.ts View on Github external
public async getContainedLogSummaryBuckets(
    request: InfraFrameworkRequest,
    sourceConfiguration: InfraSourceConfiguration,
    start: number,
    end: number,
    bucketSize: number,
    filterQuery: LogEntryQuery
  ): Promise {
    const bucketIntervalStarts = timeMilliseconds(new Date(start), new Date(end), bucketSize);

    const query = {
      allowNoIndices: true,
      index: sourceConfiguration.logAlias,
      ignoreUnavailable: true,
      body: {
        aggregations: {
          count_by_date: {
            date_range: {
              field: sourceConfiguration.fields.timestamp,
              format: TIMESTAMP_FORMAT,
              ranges: bucketIntervalStarts.map(bucketIntervalStart => ({
                from: bucketIntervalStart.getTime(),
                to: bucketIntervalStart.getTime() + bucketSize,
              })),
            },