✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Tweaking go.Parcoords

I’m using go.Parcoords in dash and mostly very happy with it. Very nice features out of the box!

Is there a way to disable the numerical values at the top and bottom of the range for each variable displayed? These are mostly redundant given the ticks.

Thanks.

2 Likes

While there’s no visibility toggle for this at the moment, the attribute rangefont can be used to reduce saliency even to zero, for example, by specifying a font color with zero alpha, quick example: https://codepen.io/monfera/pen/xLNqXN

mock.data[0].rangefont = {color: 'rgba(255,0,0,0)'}

Font size almost works too, but that has a minimum value of 1 (plotly.js custom), so that’s not completely invisible. Wondering if maybe reducing the allowed minimum size to 0 would be useful for purposes like this - @etienne ?

That works great. Thanks!!

The next issue is that my variable names are longish and the first one is getting clipped. This doesn’t happen in your JS mockup, even when the longest var name is moved to the 1st column. As far as I can tell, this is because you specify pad=[80,80,80,80], which is not possible via the go.Parcoord API. If this is the solution, perhaps that keyword should be passed through as well. Thanks!

Hm, that’s odd. pad doesn’t seem to be in the chart schema and therefore the go API. We’ll look into this and update this thread when it’s fixed. Thanks for reporting!

My pleasure. Thanks for being so responsive!

Edit - scratch that, see thread below.


(Original comment)

@plevin - You may be able to get around it by using the dict style of the traces instead of the go. objects. That is:

dcc.Graph(figure={'data': [{
    'type': 'parcoords',
    'pad': [80, 80, 80, 80],
     # the rest of your attributes
}]})

The go objects provide keyword validation and docstrings but otherwise just subclass dict and end up as the same JSON format in the end.

It looks like pad is in the mock as this attrib was present during some point of development but then got canned for the time, it doesn’t have an impact (test: fork the above example, add

mock.data[0].rangefont = {color: 'rgba(255,0,0,0)'}
mock.data[0].pad = [200,200,200,200]  // <- new line

run the pen, and no change happens.

It’s worth trying if the domain makes it work with your data (font size, text length), e.g.

mock.data[0].domain.x = [0.1, 0.9]
1 Like

@etienne just reminded me of margin, perhaps this would work in this case:

mock.layout.margin = {l: 200, r: 200};