Socket
Socket
Sign inDemoInstall

d3-time

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-time

A calculator for humanity’s peculiar conventions of time.


Version published
Maintainers
1
Created

What is d3-time?

The d3-time npm package is a module that provides utilities for manipulating dates in JavaScript. It is part of the D3 (Data-Driven Documents) suite of tools, which are used for producing dynamic, interactive data visualizations in web browsers. d3-time is specifically designed to handle time scales, sequences, and intervals, making it a powerful tool for dealing with temporal data.

What are d3-time's main functionalities?

Time Scales

Create a time scale that maps a domain of dates to a range of numeric values. This is useful for creating time-based charts.

const timeScale = d3.scaleTime().domain([new Date(2020, 0, 1), new Date(2020, 11, 31)]).range([0, 100]);

Time Intervals

Generate an array of dates at regular intervals, such as every month between two dates. This is useful for generating axis ticks or processing data at regular time intervals.

const start = new Date(2020, 0, 1); const end = new Date(2020, 11, 31); const everyMonth = d3.timeMonth.every(1); const months = everyMonth.range(start, end);

Time Formatting

Format dates according to a specified pattern. This is useful for displaying dates in a human-readable format.

const formatTime = d3.timeFormat('%B %d, %Y'); const formatted = formatTime(new Date(2020, 0, 1));

Other packages similar to d3-time

Keywords

FAQs

Package last updated on 11 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc