Linking and brushing between parallel coordinate and scatterplot

Hi @Fantasyfans2012, @phylroy,

this is a way to make it work, at least from parallel coordinates to scatter (not bidirectional):

import plotly.express as px
import plotly.graph_objects as go
import ipywidgets as widgets
import numpy as np

df = px.data.iris()
figScatter_inputs = dict(x="sepal_width", y="sepal_length", color="species", marginal_y="rug", marginal_x="histogram") 
figScatter = px.scatter(df, **figScatter_inputs)
labels = {"species_id": "Species",
    "sepal_width": "Sepal Width", "sepal_length": "Sepal Length",
    "petal_width": "Petal Width", "petal_length": "Petal Length"}
labelsrev = {v:k for k,v in labels.items()}
figParallel = px.parallel_coordinates(df, color="species_id", labels=labels,
    color_continuous_scale=px.colors.diverging.Tealrose, color_continuous_midpoint=2)

fig1 = go.FigureWidget(figParallel)
fig2 = go.FigureWidget(figScatter)

def update_highlight(dimension, constraintrange):
    df_filt = df.copy()
    for d in fig1.data[0].dimensions:
        if d.constraintrange is not None:
            crs = np.array(d.constraintrange)
            if crs.ndim==1:
                crs  = [crs]
            masks=[]
            for cr in crs:
                key = labelsrev[d.label]
                masks.append(df_filt[key].between(*cr))
            df_filt = df_filt[np.logical_or.reduce(masks)]
    fig2.data = []
    if df_filt.index.empty:
        fig2.layout.annotations = [dict(text='filtering results in empty dataframe', showarrow=False)]
    else:
        fig2.layout.annotations = []
        pxfig = px.scatter(df_filt, **figScatter_inputs)
        fig2.add_traces(pxfig.data)
        fig2.layout = pxfig.layout
    
for d in fig1.data[0].dimensions:
    d.on_change(update_highlight, 'constraintrange')
display(widgets.HBox([fig1, fig2]))

hope it helps, Alex-