Skip to content

Commit

Permalink
fix(dash): nicer shape/circle buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Jul 19, 2021
1 parent 3ad9172 commit 81a2e46
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Binary file modified src/assets/btn-circles.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/btn-polygons.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 19 additions & 10 deletions src/charts/choropleth-map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
polygon-and-circle-map.choro-map(:props="mapProps")

.config-bar
button.button(@click="useCircles=false" title="Shapes")
img(src="../assets/btn-polygons.jpg" width=32)
button.button(@click="useCircles=true" title="Circles")
img(src="../assets/btn-circles.jpg" width=32)
img.img-button(@click="useCircles=false"
src="../assets/btn-polygons.jpg"
title="Shapes")

input.slider.has-output.is-small.is-fullwidth.is-danger(
id="sliderOpacity" min="0" max="100" v-model="sliderOpacity" step="5" type="range")
img.img-button(@click="useCircles=true"
src="../assets/btn-circles.jpg"
title="Circles")

input.slider.is-small.is-fullwidth.is-danger(
id="sliderOpacity" min="0" max="100" v-model="sliderOpacity" step="5" type="range")

</template>

Expand Down Expand Up @@ -52,7 +54,7 @@ export default class VueComponent extends Vue {
}
private async mounted() {
bulmaSlider.attach()
// bulmaSlider.attach()
// load the boundaries and the dataset, use promises so we can clear
// the spinner when things are finished
await Promise.all([this.loadBoundaries(), this.loadDataset()])
Expand Down Expand Up @@ -152,7 +154,7 @@ export default class VueComponent extends Vue {

<style scoped lang="scss">
@import '@/styles.scss';
@import '~vue-slider-component/theme/default.css';
@import '../../node_modules/vue-slider-component/theme/default.css';
.map-layout {
position: absolute;
Expand All @@ -178,11 +180,18 @@ export default class VueComponent extends Vue {
width: 8rem;
}
button {
.img-button {
margin-right: 0.15rem;
padding: 0 0;
height: 2.5rem;
width: 2.5rem;
border: var(--borderThin);
border-radius: 4px;
}
.img-button:hover {
border: 2px solid var(--linkHover);
}
}
@media only screen and (max-width: 640px) {
}
</style>
3 changes: 1 addition & 2 deletions src/views/DashBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default class VueComponent extends Vue {
// Vue is weird about new properties: use Vue.set() instead
// this.opacity[card.id] = 0.5
Vue.set(this.opacity, card.id, 0.2)
Vue.set(this.opacity, card.id, 0.1)
numCard++
})
Expand Down Expand Up @@ -256,7 +256,6 @@ export default class VueComponent extends Vue {
button {
color: var(--link);
opacity: 0.5;
padding-right: 2px;
}
button:hover {
opacity: 1;
Expand Down

0 comments on commit 81a2e46

Please sign in to comment.