You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-35Lines changed: 7 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1357,58 +1357,30 @@ If *curve* is a function, it will be invoked with a given *context* in the same
1357
1357
1358
1358
The tension option only has an effect on cardinal and Catmull–Rom splines (*cardinal*, *cardinal-open*, *cardinal-closed*, *catmull-rom*, *catmull-rom-open*, and *catmull-rom-closed*). For cardinal splines, it corresponds to [tension](https://github.com/d3/d3-shape/blob/master/README.md#curveCardinal_tension); for Catmull–Rom splines, [alpha](https://github.com/d3/d3-shape/blob/master/README.md#curveCatmullRom_alpha).
1359
1359
1360
-
…
1361
-
1362
1360
## Formats
1363
1361
1364
1362
These helper functions are provided for use as a *scale*.tickFormat [axis option](#position-options), as the text option for [Plot.text](#plottextdata-options), or for general use. See also [d3-time-format](https://github.com/d3/d3-time-format) and JavaScript’s built-in [date formatting](https://observablehq.com/@mbostock/date-formatting) and [number formatting](https://observablehq.com/@mbostock/number-formatting).
1365
1363
1366
1364
#### Plot.formatIsoDate(*date*)
1367
1365
1368
-
Given a Date, returns the [shortest equivalent ISO 8601 UTC string](https://github.com/mbostock/isoformat/).
Given a *date*, returns the shortest equivalent ISO 8601 UTC string.
1376
1371
1377
-
Returns a function that formats a week day number (from 0 = Sunday to 6 = Saturday) according to the *locale* and *format*.
1378
-
-*locale*: any valid [BCP 47 language tag](https://tools.ietf.org/html/bcp47); defaults to "en-US". Use navigator.language to respect the browser’s setting.
1379
-
-*format*: any valid [weekday format](https://tc39.es/ecma402/#datetimeformat-objects), *i.e.* one of "narrow", "short", "long"; defaults to "short".
Plot.formatWeekday(navigator.language, "long") //depends on the browser’s settings
1375
+
Plot.formatWeekday("es-MX", "long")(0)//"domingo"
1391
1376
```
1392
1377
1393
-
This function is periodic: day -1 is Saturday, and day 8 is Sunday.
1378
+
Returns a function that formats a given week day number (from 0 = Sunday to 6 = Saturday) according to the specified *locale*and *format*. The *locale*is a [BCP 47 language tag](https://tools.ietf.org/html/bcp47) and defaults to U.S. English. The *format* is a [weekday format](https://tc39.es/ecma402/#datetimeformat-objects): either *narrow*, *short*, or *long*; if not specified, it defaults to *short*.
1394
1379
1395
1380
#### Plot.formatMonth(*locale*, *format*)
1396
1381
1397
-
Returns a function that formats a month number (from 0 = January to 11 = December) according to the *locale* and *format*.
1398
-
-*locale*: any valid [BCP 47 language tag](https://tools.ietf.org/html/bcp47); defaults to "en-US". Use navigator.language to respect the browser’s setting.
1399
-
-*format*: any valid [month format](https://tc39.es/ecma402/#datetimeformat-objects), *i.e.* one of "2-digit", "numeric", "narrow", "short", "long"; defaults to "short".
Plot.formatMonth(navigator.language, "long") // depends on the browser’s settings
1411
-
```
1412
-
1413
-
This function is periodic: month -1 is December, and month 12 is January.
1414
-
1386
+
Returns a function that formats a given month number (from 0 = January to 11 = December) according to the specified *locale* and *format*. The *locale* is a [BCP 47 language tag](https://tools.ietf.org/html/bcp47) and defaults to U.S. English. The *format* is a [month format](https://tc39.es/ecma402/#datetimeformat-objects): either *2-digit*, *numeric*, *narrow*, *short*, *long*; if not specified, it defaults to *short*.
0 commit comments