[Request] Get the current/default locale definition when passing no argument to `formatLocale`

オープン
#110 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
46/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript

調査の方向性

Start by reading the implementation and tests for formatLocale and formatDefaultLocale, then check how other D3 functions return their current settings when called without arguments. Determine how the current locale definition can be retrieved without changing existing locale behavior. Done means a no-argument call returns a definition that can be modified and passed back to formatLocale as described.

索引モデルが issue の本文から書いたものです。

説明

Many d3 functions use the presence of an argument to control their behavior -- if an argument is passed, it used to update the object, and if it's missing then the current value is returned. For instance d3.scaleLinear().domain([0,1]) vs d3.scaleLinear().domain().

It would be handy if d3.formatLocale could be used this same way in order to return the current locale settings (likely the defaults if the user hasn't called d3.formatDefaultLocale) so that the user could modify just one of them before passing the updated definition list back to d3.formatLocale. For instance,

const definition = d3.formatLocale();
definition.minus = "-"  // Replace the default unicode minus character with a hyphen
// Leave everything else, such as commas and the decimal separator, as the en-US default
const formatter = d3.formatLocale(definition).format(",.2f")
主要言語
JavaScript
スター
643
フォーク
107
平均マージ
6時間 25分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

d3/d3-format のほかの issue

d3/d3-format の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。