(self, data, json_file_path, parent=None)
| 3305 | |
| 3306 | class CustomPlotDialog(QMainWindow): # Custom plot user inputs |
| 3307 | def __init__(self, data, json_file_path, parent=None): |
| 3308 | super().__init__(parent) |
| 3309 | |
| 3310 | self.data = data |
| 3311 | self.json_file_path = json_file_path |
| 3312 | |
| 3313 | self.plot_window = CustomPlotWindow(json_file_path, data) |
| 3314 | |
| 3315 | self.x_select = QComboBox() |
| 3316 | self.x_select.addItems(list(self.data.columns)) |
| 3317 | self.y_select = QComboBox() |
| 3318 | self.y_select.addItems(list(self.data.columns)) |
| 3319 | |
| 3320 | self.log_x_checkbox = QCheckBox('Logarithmic X-axis') |
| 3321 | self.log_y_checkbox = QCheckBox('Logarithmic Y-axis') |
| 3322 | |
| 3323 | self.plot_button = QPushButton("Plot") |
| 3324 | self.plot_button.clicked.connect(self.plot) |
| 3325 | self.save_csv_button = QPushButton("Save CSV") |
| 3326 | self.save_csv_button.clicked.connect(self.save_to_csv) |
| 3327 | |
| 3328 | |
| 3329 | # create a central widget to hold our layout |
| 3330 | central_widget = QWidget() |
| 3331 | layout = QVBoxLayout(central_widget) |
| 3332 | |
| 3333 | layout.addWidget(QLabel("Select X-axis:")) |
| 3334 | layout.addWidget(self.x_select) |
| 3335 | layout.addWidget(self.log_x_checkbox) |
| 3336 | layout.addWidget(QLabel("Select Y-axis:")) |
| 3337 | layout.addWidget(self.y_select) |
| 3338 | layout.addWidget(self.log_y_checkbox) |
| 3339 | layout.addWidget(self.plot_button) |
| 3340 | layout.addWidget(self.plot_window.canvas) |
| 3341 | layout.addWidget(self.save_csv_button) |
| 3342 | |
| 3343 | # Add color column selection |
| 3344 | self.color_select = QComboBox() |
| 3345 | self.color_select.addItem("None") |
| 3346 | self.color_select.addItems(list(self.data.columns)) |
| 3347 | self.color_select.currentIndexChanged.connect(self.update_color_ramp_combo) |
| 3348 | layout.addWidget(QLabel("Select color column:")) |
| 3349 | layout.addWidget(self.color_select) |
| 3350 | |
| 3351 | # Add color ramp selection |
| 3352 | self.color_ramp_select = QComboBox() |
| 3353 | self.update_color_ramp_combo() |
| 3354 | layout.addWidget(QLabel("Select color ramp:")) |
| 3355 | layout.addWidget(self.color_ramp_select) |
| 3356 | |
| 3357 | # Add checkbox for polygon plotting |
| 3358 | self.polygon_checkbox = QCheckBox("Attribute to Plot Polygons") # attributes each point to the polygon it falls in |
| 3359 | layout.addWidget(self.polygon_checkbox) |
| 3360 | |
| 3361 | # set the central widget |
| 3362 | self.setCentralWidget(central_widget) |
| 3363 | |
| 3364 | # Draw a blank plot for preview |
nothing calls this directly
no test coverage detected