@@ -344,9 +344,6 @@ void ScatterplotPlugin::init()
344344 connect (&_positionDataset, &Dataset<>::guiNameChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
345345
346346 const auto currentColorDatasetChanged = [this ](Dataset<DatasetImpl> currentColorDataset) -> void {
347- if (_colorDataset == currentColorDataset)
348- return ;
349-
350347 if (_colorDataset.isValid ())
351348 disconnect (&_colorDataset, &Dataset<>::guiNameChanged, this , nullptr );
352349
@@ -362,8 +359,35 @@ void ScatterplotPlugin::init()
362359 currentColorDatasetChanged (_settingsAction.getColoringAction ().getCurrentColorDataset ());
363360 });
364361
365- connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction (), &ScalarAction::sourceDataChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
366- connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction (), &ScalarAction::sourceDataChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
362+ const auto currentPointSizeDatasetChanged = [this ]() -> void {
363+ auto currentPointSizeDataset = _settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction ().getCurrentDataset ();
364+
365+ if (_pointSizeDataset.isValid ())
366+ disconnect (&_pointSizeDataset, &Dataset<>::guiNameChanged, this , nullptr );
367+
368+ _pointSizeDataset = currentPointSizeDataset;
369+
370+ connect (&_pointSizeDataset, &Dataset<>::guiNameChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
371+
372+ updateHeadsUpDisplay ();
373+ };
374+
375+ connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction (), &ScalarAction::sourceSelectionChanged, this , currentPointSizeDatasetChanged);
376+
377+ const auto currentPointOpacityDatasetChanged = [this ]() -> void {
378+ auto currentPointOpacityDataset = _settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction ().getCurrentDataset ();
379+
380+ if (_pointOpacityDataset.isValid ())
381+ disconnect (&_pointOpacityDataset, &Dataset<>::guiNameChanged, this , nullptr );
382+
383+ _pointOpacityDataset = currentPointOpacityDataset;
384+
385+ connect (&_pointOpacityDataset, &Dataset<>::guiNameChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
386+
387+ updateHeadsUpDisplay ();
388+ };
389+
390+ connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction (), &ScalarAction::sourceSelectionChanged, this , currentPointOpacityDatasetChanged);
367391
368392 connect (&_settingsAction.getMiscellaneousAction ().getBackgroundColorAction (), &ColorAction::colorChanged, this , &ScatterplotPlugin::updateHeadsUpDisplayTextColor);
369393
@@ -1038,11 +1062,9 @@ void ScatterplotPlugin::updateHeadsUpDisplay()
10381062
10391063 addMetaDataToHeadsUpDisplay (" Size" , _settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction ().getCurrentDataset (), datasetsItem);
10401064 addMetaDataToHeadsUpDisplay (" Opacity" , _settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction ().getCurrentDataset (), datasetsItem);
1041-
10421065 } else {
10431066 getHeadsUpDisplayAction ().addHeadsUpDisplayItem (" No datasets loaded" , " " , " " );
10441067 }
1045-
10461068}
10471069
10481070void ScatterplotPlugin::updateHeadsUpDisplayTextColor ()
0 commit comments