Skip to content

Commit 4f5ea4f

Browse files
committed
Add circleOptions.strokeEnabled and circleOptions.strokeWeight
1 parent e379a8b commit 4f5ea4f

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- Add options `ignoreEmptyGeohashValues` and `ignoreInvalidGeohashValues`.
4242
- Add `ignoreEscapeKey` option.
4343
- Add `hideTimepickerNavigation` option.
44+
- Add `circleOptions.strokeEnabled` and `circleOptions.strokeWeight`.
4445

4546
## v0.2.0
4647

src/partials/editor.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,24 @@ <h5>Global options</h5>
362362
<h5>Circle parameters</h5>
363363
<div class="gf-form">
364364
<label class="gf-form-label width-10">Minimum size</label>
365-
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.circleMinSize" ng-change="ctrl.refresh()"
365+
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.circleMinSize" ng-change="ctrl.render()"
366366
placeholder="1" ng-model-onblur />
367367
</div>
368368
<div class="gf-form">
369369
<label class="gf-form-label width-10">Maximum size</label>
370-
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.circleMaxSize" ng-change="ctrl.refresh()"
370+
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.circleMaxSize" ng-change="ctrl.render()"
371371
placeholder="10" ng-model-onblur />
372372
</div>
373-
373+
<div class="gf-form">
374+
<label class="gf-form-label width-10">Enable strokes</label>
375+
<gf-form-switch checked="ctrl.panel.circleOptions.strokeEnabled" on-change="ctrl.redrawCircles()">
376+
</gf-form-switch>
377+
</div>
378+
<div class="gf-form">
379+
<label class="gf-form-label width-10">Stroke width</label>
380+
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.circleOptions.strokeWeight" ng-change="ctrl.redrawCircles()"
381+
placeholder="3" ng-model-onblur />
382+
</div>
374383
</div>
375384

376385
<div class="gf-form-group" style="overflow-x: visible">
@@ -396,7 +405,7 @@ <h5>Map thresholds to colors</h5>
396405

397406
<div class="gf-form-group">
398407
<h5>Popup labels</h5>
399-
<gf-form-switch class="gf-form" label="Sticky" label-class="width-10" checked="ctrl.panel.stickyLabels" on-change="ctrl.toggleStickyLabels()">
408+
<gf-form-switch class="gf-form" label="Sticky" label-class="width-10" checked="ctrl.panel.stickyLabels" on-change="ctrl.redrawCircles()">
400409
</gf-form-switch>
401410
<gf-form-switch class="gf-form" label="Auto-pan" label-class="width-10" checked="ctrl.panel.autoPanLabels" on-change="ctrl.render()">
402411
</gf-form-switch>

src/worldmap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ export default class WorldMap {
230230
fillColor: this.getColor(dataPoint.value),
231231
fillOpacity: 0.5,
232232
location: dataPoint.key,
233+
stroke: Boolean(this.ctrl.settings.circleOptions.strokeEnabled),
234+
weight: parseInt(this.ctrl.settings.circleOptions.strokeWeight) || 3,
233235
});
234236

235237
this.createClickthrough(circle, dataPoint);

src/worldmap_ctrl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ const panelDefaults = {
2222
valueName: "total",
2323
circleMinSize: 2,
2424
circleMaxSize: 30,
25+
circleOptions: {
26+
strokeEnabled: true,
27+
strokeWeight: 3,
28+
},
2529
locationData: null,
2630
thresholds: "0,10",
2731
colors: [
@@ -503,7 +507,7 @@ export default class WorldmapCtrl extends MetricsPanelCtrl {
503507
this.render();
504508
}
505509

506-
toggleStickyLabels() {
510+
redrawCircles() {
507511
this.map.clearCircles();
508512
this.render();
509513
}

0 commit comments

Comments
 (0)