profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/Fil/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

d3/d3-geo-projection 932

Extended geographic projections for d3-geo.

d3/d3-geo 761

Geographic projections, spherical shapes and spherical trigonometry.

d3/d3-geo-polygon 84

Clipping and geometric operations for spherical polygons.

d3/versor 26

a home for Mike Bostock's versor.js

Fil/attitude 25

Attitude: orientation of an object in space.

Cerdic/textwheel 7

proposal for an interoperability layer for text engines

Fil/archivage-militant 5

Archivage militant

archiloque/dredd 3

Let me judge your mails, tool to survey mailing lists health

Fil/array-blur 3

blur an array of numbers in 1 or 2 dimensions

Fil/batch-image-transform 3

batch apply an image filter

PullRequestReviewEvent

issue commentd3/d3-delaunay

context.moveTo and context.lineTo implementation

try voronoi.render([context]) ; the brackets indicate that the context is optional.

MLouis8

comment created time in 12 hours

issue closedd3/d3-delaunay

context.moveTo and context.lineTo implementation

Hello, I'm using canvas.getContext('2d') as a context for displaying a voronoi diagram. But when I call voronoi.render([context]) the following error comes up : "TypeError: context.moveTo is not a function" How can I use d3-delaunay API without creating my own context ?

here is my code: <script src="https://gist.github.com/MLouis8/390f882dd72d0ee4fb25ddde97b1172b.js"></script>

thanks

closed time in 12 hours

MLouis8

PR opened observablehq/plot

Reviewers
scheme subset

Often we want to use a scheme such as "greens", but its light end is too light and doesn't contrast against the white background. Tweaking the domain means we have to know it in advance. This PR explores tweaking the range instead.

Currently, if a range is defined, the scheme is ignored. With this PR, when both are present the scheme is not ignored and defines the color; the range then defines the subset of the scheme that we want to interpolate on.

Capture d’écran 2021-09-25 à 11 27 35

Note: WIP. There are no tests yet, and this builds up on #538.

Try it in https://observablehq.com/d/e5cbada7ee2a257c

+6 -3

0 comment

1 changed file

pr created time in 18 hours

create barnchobservablehq/plot

branch : fil/scheme-range

created branch time in 18 hours

pull request commentobservablehq/plot

expose scales

All tests are fixed now. For reference the correct polylinear test is: Capture d’écran 2021-09-25 à 08 18 36

(The error was in maybePiecewiseRange which was checking the old type==quantitative.)

Fil

comment created time in 20 hours

push eventobservablehq/plot

Philippe Rivière

commit sha 986889933a08240bac91f39e8167e7fb3200a120

another test (piecewise + scheme + reverse)

view details

push time in 20 hours

push eventobservablehq/plot

Philippe Rivière

commit sha 94f246e221f07a967b2477fc78f5f7a5bbe00c0c

fix tests: * sqrt is now pow with exponent .5 * clamp is now exposed when false

view details

Philippe Rivière

commit sha f28fcf11c8f3cb43026dfe3cc6271bee96459546

fix polylinear

view details

Philippe Rivière

commit sha 7af0c27f57eef58684b262bc7a2803f8382d669f

fix interpolator test

view details

push time in 20 hours

PullRequestReviewEvent

PR opened observablehq/plot

log scales default to ~s
+10 -13

0 comment

4 changed files

pr created time in a day

create barnchobservablehq/plot

branch : fil/log-si

created branch time in a day

PullRequestReviewEvent

issue commentobservablehq/plot

Default to SI (~s) for log tick format instead of exponential, or ,~f?

let's do it! I see three places where we can intervene:

  1. in src/axis.js : createAxis; simple and tested, but not super satisfying:

if (scale.base && scale.base() === 10 && tickFormat === undefined) tickFormat = "~s";

  1. in src/quantitative.js, ScaleLog; by overwriting its tickFormat function (lots of code, just to replace a string on line 111 of https://github.com/d3/d3-scale/blob/main/src/log.js#L109)

  2. in d3's tickFormat, either switch to "~s" (breaking change), or allow to set this differently…

mbostock

comment created time in a day

delete branch observablehq/plot

delete branch : fil/piecewise-linear

delete time in 2 days

PR closed observablehq/plot

Reviewers
polylinear (aka piecewise linear) scales with an unspecified range bug

Now merged in #538

A polylinear scale (or piecewise linear) scale is defined by example as:

d3.scaleLinear()
  .domain([0, 100, 200, 300, 400])
  .range(["red", "blue", "green", "lime", "yellow"]) // or pixels for a position scale

In Plot, specifying the domain and range works as expected, but we must also specify type: "linear", otherwise Plot decides (rightly) that it might be an ordinal scale (a point scale).

However if we specify only the domain, and let the range be determined by the dimensions of the Plot (say, for the y axis, by autoScaleRangeY), only the two first elements of the domain are mapped to [ymin, ymax], and the resulting chart is broken.

This pull-request closes that gap.

Capture d’écran 2021-09-03 à 16 55 51

The (made-up) example could be adapted to a real-life scenario of a mission which has long periods of idle time and shorter periods of more intense activity.

const times = [
  new Date(2013, 3, 5),
  new Date(2013, 3, 11),
  new Date(2013, 3, 14),
  new Date(2013, 3, 16),
  new Date(2013, 3, 18),
  new Date(2013, 3, 21),
  new Date(2013, 3, 27)
];

const events = [
  { date: new Date(2013, 3, 5, 13, 0), text: "Initiate" },
  { date: new Date(2013, 3, 11, 13, 0), text: "Begin" },
  { date: new Date(2013, 3, 13, 20, 0), text: "Entry" },
  { date: new Date(2013, 3, 15, 0, 0), text: "Test" },
  { date: new Date(2013, 3, 16, 0, 0), text: "Drive" },
  { date: new Date(2013, 3, 17, 8, 0), text: "Drive" },
  { date: new Date(2013, 3, 18, 15, 0), text: "Brake" },
  { date: new Date(2013, 3, 20, 10, 0), text: "Stop" },
  { date: new Date(2013, 3, 23, 14, 0), text: "Shutdown" }
];

export default async function() {
  return Plot.plot({
    grid: true,
    x: {
      domain: times,
      type: "linear",
      ticks: [...d3.timeDays(...d3.extent(times)), times[times.length-1]],
      tickFormat: d3.timeFormat("%d"),
      inset: 20,
      label: "date →"
    },
    color: { scheme: "cool" },
    marks: [
      Plot.barX(d3.pairs(times), {x1: "0", x2: "1", fill: (_,i) => i}),
      Plot.dotX(events, {x: "date", fill: "white"}),
      Plot.textX(events, {x: "date", text: "text", dx: -5, dy: -10, fill: "white", textAnchor: "start"})
    ],
    height: 90
  });
}
+215 -10

6 comments

5 changed files

Fil

pr closed time in 2 days

pull request commentobservablehq/plot

Create Image mark

In a sense I have a hunch that this would be better as a Plot plugin so people could begin using it immediately, and we could then see various use cases. It's hard to imagine what people will really want to do once it's available :)

Re: the aspect ratio, I don't feel that there is a need for anything else than the original shape. Maybe we'll want to add a mask on the image, to make it square, or circular? But I feel that changing the aspect ratio almost inevitably results in ugly visuals.

RLesser

comment created time in 2 days

push eventobservablehq/plot

Philippe Rivière

commit sha 56d3da846cdca77b6b83a0316d24d17038f20105

numeric interval & documentation (#552)

view details

push time in 2 days

delete branch observablehq/plot

delete branch : fil/interval

delete time in 2 days

issue commentobservablehq/inputs

When assigning the value of a range input, implicitly correct invalid values?

Yet another example reported in https://observablehq.com/@martien/arc ; uploading #180 fixed it.

mbostock

comment created time in 2 days

push eventobservablehq/plot

Philippe Rivière

commit sha 216eac08a35225fc0cdc6538ad5ab53005773444

Update src/transforms/interval.js

view details

push time in 2 days

push eventobservablehq/plot

Philippe Rivière

commit sha 2f42e6763093839e310fcc9d374b6e799361d8d7

apply suggestions from review

view details

push time in 2 days

Pull request review commentobservablehq/plot

numeric interval & documentation

 import {maybeInsetX, maybeInsetY} from "./inset.js"; // chose between UTC and local time (or better, an explicit timeZone option). function maybeInterval(interval) {   if (interval == null) return;+  if (typeof interval === "number" && interval) {

I'm OK with not trying :)

Fil

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

pull request commentobservablehq/inputs

better string coercion

wow; and the error message about comparisons is quite misleading, since we're not trying to compare.

We'll have to fix that also in all D3 modules I guess?

mbostock

comment created time in 2 days

PullRequestReviewEvent

issue commentd3/d3-color

Supporting CSS color level 4

see also https://github.com/d3/d3-color/pull/71

Ayc0

comment created time in 2 days