Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gui-js/libs/shared/src/lib/backend/minsky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,7 @@ export class PlotWidget extends Item {
async redraw(): Promise<boolean> {return this.$callMethod('redraw');}
async redrawWithBounds(): Promise<void> {return this.$callMethod('redrawWithBounds');}
async registerImage(): Promise<void> {return this.$callMethod('registerImage');}
async removePensFrom(a1: number): Promise<void> {return this.$callMethod('removePensFrom',a1);}
async renderFrame(a1: minsky__RenderNativeWindow__RenderFrameArgs): Promise<void> {return this.$callMethod('renderFrame',a1);}
async renderToEMF(a1: string): Promise<void> {return this.$callMethod('renderToEMF',a1);}
async renderToPDF(a1: string): Promise<void> {return this.$callMethod('renderToPDF',a1);}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@

<div class="markers">
<select id="verticalMarkers" multiple size="5">
<option disabled>Vertical Markers</option>
<option class="selectTitle" title="Click to clear selection"
value="[clear selection]">Vertical Markers</option>
<option *ngFor="let m of availableMarkers" [selected]="verticalMarkers.includes(m)">{{m}}</option>
</select>
<select id="horizontalMarkers" multiple size="5">
<option disabled>Horizontal Markers</option>
<option class="selectTitle" title="Click to clear selection"
value="[clear selection]">Horizontal Markers</option>
<option *ngFor="let m of availableMarkers" [selected]="horizontalMarkers.includes(m)">{{m}}</option>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ select {
width: 125px;
}

.selectTitle {
color: blue;
font-weight: bold;
}

button {
margin: $margin;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export class PlotWidgetOptionsComponent implements OnInit, OnDestroy {
let markers=[];
let selectedOptions=(document.getElementById(id) as HTMLSelectElement).selectedOptions;
for (let i=0; i<selectedOptions.length; ++i)
markers.push(selectedOptions[i].value);
if (selectedOptions[i].value!=="[clear selection]")
markers.push(selectedOptions[i].value);
return markers;
}

Expand Down Expand Up @@ -224,6 +225,24 @@ export class PlotWidgetOptionsComponent implements OnInit, OnDestroy {
plot.y1max(+this.y1max.value);
plot.horizontalMarkers.$properties(this.getMarkersSelection("horizontalMarkers"));
plot.verticalMarkers.$properties(this.getMarkersSelection("verticalMarkers"));
// remove markers if changed
let markers=await plot.horizontalMarkers.$properties();
let markersUpdated=false;
for (let marker of this.horizontalMarkers)
if (!markers.includes(marker)) {
markersUpdated=true;
break;
}
if (!markersUpdated) {
markers=await plot.verticalMarkers.$properties();
for (let marker of this.verticalMarkers)
if (!markers.includes(marker)) {
markersUpdated=true;
break;
}
}
if (markersUpdated)
plot.addPlotPt(await this.electronService.minsky.t());
plot.requestRedraw();
this.electronService.minsky.canvas.requestRedraw();
}
Expand Down
1 change: 1 addition & 0 deletions model/plotWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ namespace minsky
assignSide(pen,marker);
labelPen(pen++,v->tooltip);
}
removePensFrom(pen);
}


Expand Down