Skip to content

color/symbol mapping breaks transforms filter #1502

Open
@mevers

Description

@mevers

Issue

transforms filter plus color/symbol mapping seems to break the transforms filter.

Reprex

Sample data

df <- data.frame(
    x = c(1:10, 1:10),
    y = c(1:10, 10:1),
    z = c(rep("up", 10), rep("down", 10)))

The idea is to only show data where z = "up" through a transforms filter.

Case 1: transforms filter without color mapping

This works

plot_ly(
    df,
    x = ~x, y = ~y, text = ~z,
    type = "scatter", mode = "markers+text",
    marker = list(size = 10, opacity = 0.8),
    transforms = list(
        list(
            type = "filter",
            target = ~z,
            operation = "=",
            value = "up")))

Screen Shot 2019-03-21 at 3 58 58 pm

Case 2: transforms filter with color mapping

This does not work

plot_ly(
    df,
    x = ~x, y = ~y, text = ~z, color = ~z,
    type = "scatter", mode = "markers+text",
    marker = list(size = 10, opacity = 0.8),
    transforms = list(
        list(
            type = "filter",
            target = ~z,
            operation = "=",
            value = "up")))

Screen Shot 2019-03-21 at 3 59 35 pm

Summary

In both cases the transforms filter is the same and should select only those entries where z = "up"; however, when a color (or symbol) mapping is added, for some reason only entries where z = "down" are shown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions