vega-lite icon indicating copy to clipboard operation
vega-lite copied to clipboard

Field named "constructor" causes rendering to fail

Open jakevdp opened this issue 2 years ago • 2 comments

Minimal reproduction (view in editor):

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.17.0.json",
  "data": {"values": [{"constructor": "x"}]},
  "mark": "circle",
  "encoding": {"color": {"field": "constructor"}}
}

I can only reproduce this with the string "constructor"; it works correctly with any other string.

First reported in https://stackoverflow.com/q/72006719/2937831

jakevdp avatar Apr 25 '22 23:04 jakevdp

Update, similar failures can be seen for fields named "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", and other standard javascript object attributes 😀

jakevdp avatar Apr 25 '22 23:04 jakevdp

Haha, good catch. We should check whether this is a Vega or Vega-Lite issue.

domoritz avatar Apr 26 '22 03:04 domoritz