String accessors?

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

メンテナーはふだん 1 日以内に返信

@Fil がすでに取り組んでいます。

2021年8月19日 から。

評価

この issue はまだ評価されていません。

説明

d3-array currently uses function accessors, e.g.

d3.median(data, d => d.foo)

What if a string could be used instead of an accessor for convenience?

d3.median(data, "foo")

There’s some precedent for this, e.g. Lodash’s _.property:

_.map(data, "foo")

(However, I don’t think we want to support nested properties as in Lodash. I think these should be simple property names with no implicit DSL.)

Here’s where it might be used:

  • d3.min
  • d3.minIndex
  • d3.max
  • d3.maxIndex
  • d3.extent
  • d3.sum
  • d3.mean
  • d3.median
  • d3.cumsum
  • d3.quantile
  • d3.quantileSorted
  • d3.variance
  • d3.deviation
  • d3.fsum
  • d3.least
  • d3.leastIndex
  • d3.greatest
  • d3.greatestIndex
  • d3.bisector
  • d3.group
  • d3.groups
  • d3.index
  • d3.indexes
  • d3.rollup
  • d3.rollups
  • d3.groupSort
  • d3.count
  • d3.every
  • d3.some
  • d3.filter
  • d3.map
  • d3.sort
  • d3.rank (#236)
  • bin.value? (possibly breaking change, but why would you ever use a constant here?)
主要言語
JavaScript
スター
465
フォーク
193
平均マージ
5時間 46分
マージ済み PR(30日)
1

環境構築

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

はじめの一歩

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

d3/d3-array のほかの issue

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

似ている issue

JavaScript の issue をもっと見る

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

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