question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Duplicate signal name' error for shared param across views

See original GitHub issue

When using repeat to layer multiple fields, one is unable to use hover to implement any interaction. An error is shown Error: Duplicate signal name: "sel1_tuple"

See https://observablehq.com/@cjnygard/vega-lite-bug for implementation (you can play with the flags in the plot4() function to true different combinations of hover, repeat, and facet. It’s clearly related to the repeat, as shown in the below generated JSON (generated from the page above).

{
  "facet": {
    "column": {
      "field": "name"
    }
  },
  "spec": {
    "repeat": {
      "layer": [
//        "y1",    // Uncomment this to trigger bug
        "y2"
      ]
    },
    "spec": {
      "layer": [
        {
          "mark": {
            "type": "line",
            "interpolate": "monotone"
          },
          "encoding": {
            "x": {
              "field": "x",
              "type": "quantitative"
            },
            "y": {
              "field": {
                "repeat": "layer"
              },
              "type": "quantitative"
            },
            "color": {
              "datum": {
                "repeat": "layer"
              },
              "legend": {
                "title": "Legend"
              }
            }
          }
        },
        {
          "mark": {
            "type": "circle"
          },
          "encoding": {
            "x": {
              "field": "x",
              "type": "quantitative"
            },
            "y": {
              "field": {
                "repeat": "layer"
              },
              "type": "quantitative"
            },
            "color": {
              "datum": {
                "repeat": "layer"
              },
              "legend": {
                "title": "Legend"
              }
            },
            "opacity": {
              "condition": {
                "test": {
                  "selection": "sel1"
                },
                "value": 1
              },
              "value": 0
            }
          },
          "selection": {
            "sel1": {
              "type": "single",
              "encodings": [
                "y"
              ],
              "on": "mouseover",
              "nearest": true,
              "empty": "none"
            }
          }
        }
      ],
      "width": 350,
      "height": 200
    }
  },
  "data": {
    "values": [
      {
        "name": "foo",
        "x": 1,
        "y1": 1,
        "y2": 21
      },
      {
        "name": "foo",
        "x": 2,
        "y1": 2,
        "y2": 22
      },
      {
        "name": "foo",
        "x": 3,
        "y1": 3,
        "y2": 23
      },
      {
        "name": "bar",
        "x": 4,
        "y1": 10,
        "y2": 31
      },
      {
        "name": "bar",
        "x": 5,
        "y1": 11,
        "y2": 32
      },
      {
        "name": "bar",
        "x": 6,
        "y1": 12,
        "y2": 33
      }
    ]
  }
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
mattijncommented, Oct 23, 2022

The reply from @kanitw with top-level defined params and a layered chart can be resolved using views within params in combination with a name definition on a single chart object within the layer: Open the Chart in the Vega Editor

Status of a chart with a:

  1. repeat operator & params within the spec: Open the Chart in the Vega Editor
  2. repeat operator & params top-level: Open the Chart in the Vega Editor
  3. repeat operator & params top-level using a views attribute and name: Open the Chart in the Vega Editor
  4. repeat operator on a layer & params on the first object within layer: Open the Chart in the Vega Editor (slow!)
  5. repeat operator on a layer & params top-level: Open the Chart in the Vega Editor
  6. repeat operator on a layer & params top-level using a views attribute & name on the first object within layer: Open the Chart in the Vega Editor (slow!)

The following issue is also related to the repeat operator on a layer with params top-level using a views attribute & name on the first object within layer: https://github.com/vega/vega-lite/issues/8348, but there is still another issue with brush not resolving properly.

1reaction
kanitwcommented, Mar 11, 2022

I’m able to replicate this when we add params to top-level for multi-view charts

{

  "params": [{"name": "selection", "select": {"type": "point"}}],
  "data": {"url": "data/cars.json"},
  "layer": [
    {
      "mark": {"type": "point", "filled": true},
      "encoding": {
        "x": {"field": "Horsepower", "type": "quantitative"},
        "y": {"field": "Acceleration", "type": "quantitative"}
      }
    },
    {
      "transform": [{"filter": {"param": "selection"}}],
      "mark": {"type": "point", "filled": true},
      "encoding": {
        "x": {"field": "Horsepower", "type": "quantitative"},
        "y": {"field": "Acceleration", "type": "quantitative"}
      }
    }
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

vega lite - Defining params at top-level in layer chart gives ...
When you try to provide params at top level, then you get the duplicate signal error . This is because the vega-lite is...
Read more >
Altair : Duplicate signal name: "selector080_columnName"
I am trying to create a regression line using Altair and Streamlit and I am getting the following error while trying to execute...
Read more >
Nastran Dmap Error Message List - Siemens PLM
In DMAP, when defining a parameter, the "N" in V,N %1 means user cannot set the value of the parameter with name %1...
Read more >
Managing views | BigQuery - Google Cloud
For instructions on renaming a view when you copy it, see Copying a view. You cannot change the name of an existing view...
Read more >
Part 5. Sharing Data Between Callbacks - Dash Plotly
Why Global Variables Will Break Your App. Dash is designed to work in multi-user environments where multiple people view the application at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found