Skip to content

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Jun 19, 2023

(any mark that depends on this channel must declare it)

ref. #1699 (comment)

(any mark that depends on this channel must declare it)
@Fil Fil requested a review from mbostock June 19, 2023 16:11
x2: {value: x2, scale: "x", optional: x1 == null},
y2: {value: y2, scale: "y", optional: y1 == null}
y2: {value: y2, scale: "y", optional: y1 == null},
title: {value: title, optional: true} // filter: defined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, just for posterity: this works because the channels that are defined here override the default channels that are declared by styles. And that’s specifically because styles is listed first in the spread here:

if (defaults !== undefined) channels = {...styles(this, options, defaults), ...channels};

That’s fine. It’s a little subtle, but it makes sense that the mark-specific channel definitions would override the defaults.

import * as Plot from "@observablehq/plot";
import * as d3 from "d3";

export async function titleDefinedTip() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m going to rename this to “sparseTitle” instead of “titleDefined” since the interesting thing about this test is that sometimes the title is not defined. 😂

@mbostock mbostock merged commit b7633b7 into fil/filter-href Jun 22, 2023
@mbostock mbostock deleted the fil/filter-visual branch June 22, 2023 16:42
mbostock added a commit that referenced this pull request Jun 22, 2023
…1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
mbostock added a commit that referenced this pull request Jun 22, 2023
…1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
mbostock added a commit that referenced this pull request Jun 22, 2023
* null filter on the href channel

closes #1696

* the title channel is not filtering the mark, unless it's a tip mark (#1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Fil added a commit that referenced this pull request Aug 21, 2023
* null filter on the href channel

closes #1696

* the title channel is not filtering the mark, unless it's a tip mark (#1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* null filter on the href channel

closes observablehq#1696

* the title channel is not filtering the mark, unless it's a tip mark (observablehq#1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants