Gathering detailed insights and metrics for d3plus-format
Gathering detailed insights and metrics for d3plus-format
npm install d3plus-format
Typescript
Module System
Node Version
NPM Version
76.9
Supply Chain
99.5
Quality
77.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
197,852
Last Day
96
Last Week
625
Last Month
3,571
Last Year
36,738
1 Stars
165 Commits
5 Watching
2 Branches
8 Contributors
Latest Version
1.2.8
Package Id
d3plus-format@1.2.8
Unpacked Size
388.26 kB
Size
101.17 kB
File Count
12
NPM Version
8.17.0
Node Version
16.16.0
Publised On
20 Aug 2024
Cumulative downloads
Total Downloads
Last day
-65.5%
96
Compared to previous day
Last week
-51.2%
625
Compared to previous week
Last month
-5.9%
3,571
Compared to previous month
Last year
20%
36,738
Compared to previous year
3
1
Shorthand formatters for common number types.
If using npm, npm install d3plus-format
. Otherwise, you can download the latest release from GitHub or load from a CDN.
1import modules from "d3plus-format";
d3plus-format can be loaded as a standalone library or bundled as part of D3plus. ES modules, AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3plus
global is exported:
1<script src="https://cdn.jsdelivr.net/npm/d3plus-format@1"></script> 2<script> 3 console.log(d3plus); 4</script>
Live examples can be found on d3plus.org, which includes a collection of example visualizations using d3plus-react. These examples are powered by the d3plus-storybook repo, and PRs are always welcome. :beers:
The new specifier strings added by d3plus-format are:
.3~a
- abbreviated decimal notation with a numeric suffix (ie. "k", "M", "B", etc). This is an alias of the formatAbbreviate
function.1200000
to "1.2M"
).Name | Default | Description |
---|---|---|
separator | "" | Separation between the number with the suffix. |
suffixes | [] | List of suffixes used to format numbers. |
grouping | [3] | The array of group sizes, |
delimiters | {thousands: ",", decimal: "."} | Decimal and group separators. |
currency | ["$", ""] | The currency prefix and suffix. |
An extension to d3's format function that adds more string formatting types and localizations.
The new specifier strings added by d3plus-format are:
.3~a
- abbreviated decimal notation with a numeric suffix (ie. "k", "M", "B", etc). This is an alias of the formatAbbreviate
function.This is a global function.
Formats a number to an appropriate number of decimal places and rounding, adding suffixes if applicable (ie. 1200000
to "1.2M"
).
This is a global function.
Param | Type | Description |
---|---|---|
n | Number | String | The number to be formatted. |
locale | Object | String | The locale config to be used. If value is an object, the function will format the numbers according the object. The object must include suffixes , delimiter and currency properties. |
A default set of date formatters, which takes into account both the interval in between in each data point but also the start/end data points.
This is a global function.
Param | Type | Default | Description |
---|---|---|---|
d | Date | The date string to be formatted. | |
dataArray | Array | The full array of ordered Date Objects. | |
[formatter] | function | d3.timeFormat | An optional instance of d3.timeFormat to be used for localization. |
An extension to d3's formatDefaultLocale function that allows setting the locale globally for formatters.
This is a global function.
A set of default locale formatters used when assigning suffixes and currency in numbers.
Name | Default | Description |
---|---|---|
separator | "" | Separation between the number with the suffix. |
suffixes | [] | List of suffixes used to format numbers. |
grouping | [3] | The array of group sizes, |
delimiters | {thousands: ",", decimal: "."} | Decimal and group separators. |
currency | ["$", ""] | The currency prefix and suffix. |
This is a global namespace.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More