view client/src/components/DiagramLegend.vue @ 2956:974122125a76

Let it be an error if closest points of DISMARs on axis are equal This might be the case e.g. if both distance marks are very far away from the available axis geometries. Instead of returning a point in such a case, which would likely be an unexpected result, raise an exception by means of STRICT.
author Tom Gottfried <tom@intevation.de>
date Mon, 08 Apr 2019 14:53:09 +0200
parents 451d73940c81
children 7d33eff62dc6
line wrap: on
line source

<template>
  <div :class="['d-flex border-right', { collapsed }]" id="diagram-legend">
    <span class="box-control toggle" @click="collapsed = !collapsed">
      <font-awesome-icon icon="angle-left" fixed-width />
    </span>
    <div
      class="d-flex align-items-center justify-content-center w-100"
      style="overflow: hidden"
    >
      <div class="text-left">
        <slot />
      </div>
    </div>
  </div>
</template>

<style lang="sass" scoped>
#diagram-legend
  position: relative
  width: 180px
  font-size: 0.8rem
  .toggle
    margin-left: 0
    position: absolute
    top: 0.25rem
    left: 0.25rem
    svg
      transition: transform 0.3s
  &.collapsed
    width: 0
    .toggle
      left: 0.25rem
      svg
        transform: rotateY(180deg)
  .legend
    margin: 10px 0
    span
      vertical-align: middle
      display: inline-block
      width: 12px
      height: 12px
      border-radius: 50%
</style>

<script>
/* This is Free Software under GNU Affero General Public License v >= 3.0
 * without warranty, see README.md and license for details.
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 * License-Filename: LICENSES/AGPL-3.0.txt
 *
 * Copyright (C) 2018 by via donau
 *   – Österreichische Wasserstraßen-Gesellschaft mbH
 * Software engineering by Intevation GmbH
 *
 * Author(s):
 * Markus Kottländer <markus.kottlaender@intevation.de>
 */

export default {
  data() {
    return {
      collapsed: false
    };
  },
  watch: {
    collapsed() {
      this.$nextTick(this.$parent.drawDiagram);
    }
  }
};
</script>