Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChannelValueSpec is only partially supported #1873

Open
18 of 41 tasks
mbostock opened this issue Sep 24, 2023 · 1 comment
Open
18 of 41 tasks

ChannelValueSpec is only partially supported #1873

mbostock opened this issue Sep 24, 2023 · 1 comment
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

We advertise that ChannelValueSpec can be used in place of ChannelValue, but there are quite a few places where we assume ChannelValue instead of ChannelValueSpec. I tried to do a survey here:

  • src/channel.js (createChannel is only called with a ChannelValue)
  • src/options.js (numberChannel is only called with a ChannelValue)
  • src/style.js (maybeColorChannel does not support fill as ChannelValueSpec)
  • src/style.js (maybeNumberChannel does not support fillOpacity as ChannelValueSpec)
  • src/style.js (maybeColorChannel does not support stroke as ChannelValueSpec)
  • src/style.js (maybeNumberChannel does not support strokeOpacity as ChannelValueSpec)
  • src/style.js (maybeNumberChannel does not support strokeWidth as ChannelValueSpec)
  • src/style.js (maybeNumberChannel does not support opacity as ChannelValueSpec)
  • src/marks/auto.js (materializeValue is only called with a ChannelValue)
  • src/marks/axis.js (channels only contains Channel with ChannelValue)
  • src/marks/cell.js (maybeColorChannel does not support stroke as ChannelValueSpec)
  • src/marks/cell.js (maybeColorChannel does not support stroke as ChannelValueSpec)
  • src/transforms/basic.js filterTransform (test must be a ChannelValue)
  • src/transforms/basic.js sortTransform (supports {value})
  • src/transforms/bin.js (does not support x as ChannelValueSpec)
  • src/transforms/bin.js (does not support y as ChannelValueSpec)
  • src/transforms/bin.js (z must be a ChannelValue)
  • src/transforms/bin.js (does not support fill as ChannelValueSpec)
  • src/transforms/bin.js (does not support stroke as ChannelValueSpec)
  • src/transforms/bin.js (maybeBin supports {value})
  • src/transforms/centroid.js (geometry must be a ChannelValue)
  • src/transforms/dodge.js (R.value must be a ChannelValue)
  • src/transforms/group.js (does not support x as ChannelValueSpec)
  • src/transforms/group.js (does not support y as ChannelValueSpec)
  • src/transforms/group.js (does not support fill as ChannelValueSpec)
  • src/transforms/group.js (does not support stroke as ChannelValueSpec)
  • src/transforms/group.js (z must be a ChannelValue)
  • src/transforms/group.js (maybeEvaluator does not support input as ChannelValueSpec)
  • src/transforms/hexbin.js (z must be a ChannelValue)
  • src/transforms/interval.js (maybeIntervalK supports {value})
  • src/transforms/interval.js (maybeIntervalK supports {value})
  • src/transforms/interval.js (maybeIntervalMidK supports {value})
  • src/transforms/map.js (maybeZ does not support {value} for fill and stroke)
  • src/transforms/select.js (maybeZ does not support {value} for fill and stroke)
  • src/transforms/select.js (selectChannel does not support {value} for v)
  • src/transforms/stack.js (does not support x as ChannelValueSpec)
  • src/transforms/stack.js (does not support y as ChannelValueSpec)
  • src/transforms/stack.js (maybeZ does not support {value} for fill and stroke)
  • src/transforms/stack.js (order must be a ChannelValue)
  • src/transforms/tree.js (path must be a ChannelValue)
  • src/transforms/tree.js (path must be a ChannelValue)

I don’t think the fix is to add ChannelValueSpec support to Plot.valueof (or at least, that isn’t sufficient). For example, there are places where we call maybeColorChannel that would need to support ChannelValueSpec, and maybeZ should allow a ChannelValueSpec for fill and stroke but not z. 🤔

Related #1869.

@mbostock mbostock added the bug Something isn’t working label Sep 24, 2023
@Fil
Copy link
Contributor

Fil commented Oct 2, 2023

See also #1831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

2 participants