Update total count map preview based on available/selected dataset and `hide` flag. Parameters ---------- hide: bool `True` - plot data if datasets are available and at least one dataset is selected, otherwise hide the plot, `False` - hide th
(self, *, hide=False, new_plot=False)
| 1954 | self._fig_maps.set_visible(False) |
| 1955 | |
| 1956 | def update_total_count_map_preview(self, *, hide=False, new_plot=False): |
| 1957 | """ |
| 1958 | Update total count map preview based on available/selected dataset and `hide` flag. |
| 1959 | |
| 1960 | Parameters |
| 1961 | ---------- |
| 1962 | hide: bool |
| 1963 | `True` - plot data if datasets are available and at least one dataset is selected, |
| 1964 | otherwise hide the plot, `False` - hide the plot in any case |
| 1965 | new_plot: bool |
| 1966 | `True` - plotting new data that was just loaded, reset the plot settings |
| 1967 | """ |
| 1968 | |
| 1969 | if new_plot and not hide: |
| 1970 | # Clear the displayed data range. The range will be computed based on the available data. |
| 1971 | self.clear_map_preview_range() |
| 1972 | |
| 1973 | # Find out if any data is selected |
| 1974 | show_plot = False |
| 1975 | if self.io_model.data_sets: |
| 1976 | show_plot = any([_.selected_for_preview for _ in self.io_model.data_sets.values()]) |
| 1977 | logger.debug(f"LinePlotModel.update_total_count_map_preview(): show_plot={show_plot} hide={hide}") |
| 1978 | if show_plot and not hide: |
| 1979 | logger.debug("LinePlotModel.update_total_count_map_preview(): plotting existing datasets") |
| 1980 | self._show_total_count_map_preview() |
| 1981 | else: |
| 1982 | logger.debug("LinePlotModel.update_total_count_map_preview(): hiding plots") |
| 1983 | self._hide_total_count_map_preview() |
| 1984 | self._fig_maps.canvas.draw() |
no test coverage detected