Chart Studio and Python Code

Hello,

Is there an issue with the (Python) code versions of graphs made with Chart Studio? In every instance, be it my own or another’s graphs, the Python code always has a few unmatched curly brackets lying around.

Any insights or suggestions on this issue would be much appreciated.

All the best,
António

That does seem like an issue! can you provide an example URL please?

Hi Nicolas,

This is one of my own graphs, the Python code has 4 unmatched curly brackets: https://plot.ly/~inthefold/118#code

All the best,
António

Hi again,

My text editor hightlighted 4 curly brackets, but the issue with the example I’ve linked above is 3 missing quotation marks and 3 missing square brackets between lines 388-395 (lines pertaining to “colorscale”).

The Python code as offered by Chart Studio reads:

  "colorscale": {
    "diverging": [
      [0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419], 
    "sequential": [
      [0, "#0508b8"], [0.0893854748603352, "#1910d8"], [0.1787709497206704, "#3c19f0"], [0.2681564245810056, "#6b1cfb"], [0.3575418994413408, "#981cfd"], [0.44692737430167595, "#bf1cfd"], [0.5363128491620112, "#dd2bfd"], [0.6256983240223464, "#f246fe"], [0.7150837988826816, "#fc67fd"], [0.8044692737430168, "#fe88fc"], [0.8938547486033519, "#fea5fd"], [0.9832402234636871, "#febefe"], [1, "#fec3fe], 
    "sequentialminus": [
      [0, "#0508b8"], [0.0893854748603352, "#1910d8"], [0.1787709497206704, "#3c19f0"], [0.2681564245810056, "#6b1cfb"], [0.3575418994413408, "#981cfd"], [0.44692737430167595, "#bf1cfd"], [0.5363128491620112, "#dd2bfd"], [0.6256983240223464, "#f246fe"], [0.7150837988826816, "#fc67fd"], [0.8044692737430168, "#fe88fc"], [0.8938547486033519, "#fea5fd"], [0.9832402234636871, "#febefe"], [1, "#fec3fe]
  }

But it should read:

  "colorscale": {
    "diverging": [
      [0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]
      ], 
    "sequential": [
      [0, "#0508b8"], [0.0893854748603352, "#1910d8"], [0.1787709497206704, "#3c19f0"], [0.2681564245810056, "#6b1cfb"], [0.3575418994413408, "#981cfd"], [0.44692737430167595, "#bf1cfd"], [0.5363128491620112, "#dd2bfd"], [0.6256983240223464, "#f246fe"], [0.7150837988826816, "#fc67fd"], [0.8044692737430168, "#fe88fc"], [0.8938547486033519, "#fea5fd"], [0.9832402234636871, "#febefe"], [1, "#fec3fe"]
      ], 
    "sequentialminus": [
      [0, "#0508b8"], [0.0893854748603352, "#1910d8"], [0.1787709497206704, "#3c19f0"], [0.2681564245810056, "#6b1cfb"], [0.3575418994413408, "#981cfd"], [0.44692737430167595, "#bf1cfd"], [0.5363128491620112, "#dd2bfd"], [0.6256983240223464, "#f246fe"], [0.7150837988826816, "#fc67fd"], [0.8044692737430168, "#fe88fc"], [0.8938547486033519, "#fea5fd"], [0.9832402234636871, "#febefe"], [1, "#fec3fe"]
      ]
  }

My corrections were: I added a closing quotation mark to the last color hex code for “diverging”, “sequential”, “sequentialminus”, as well as a closing square bracket for “diverging”, “sequential”, “sequentialminus”.

I’m guessing this is the issue behind the cases I’ve seen of unmatched curly brackets. I’ll check it tomorrow.
This might be too verbose, but I hope this helps.

All the best,
António

Hi,

Well, I checked and my guess was wrong. The “unmatched curly brackets” issue is pervasive as far as I was able to observe, and it doesn’t arise only with “colorscale” . I’m hoping for an update on this soon.

All the best,
António

OK, thanks for the detailed report. I’ll try to get a fix out soon.

Hi,

A few months have passed since I created this thread, but as far as I can see no progress has been made on this issue. Are there any news on this front? Will there a be a fix for this soon, or not?

All the best,
António