Commit 8bfd461c authored by Matěj Lang's avatar Matěj Lang
Browse files

Filtering now makes points transparent.

Updated color for 'stick not marked'.
parent 9a9d0dd9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ export default {}

  --color-manually-edited: #00a864;
  --color-discarded: #dddddd;
  --color-not-marked: #aaaaaa;
  --color-not-marked: #d1b8b6;
  --color-normal: #555555;
}

+34 −13
Original line number Diff line number Diff line
@@ -511,22 +511,41 @@ export default {
      // x: D3 scale for x axis.
      // y: D3 scale for y axis.
      for (const imageName in this.chartData) {
        if (Object.hasOwnProperty.call(this.chartData, imageName)) {
          let opacity = 1
          if (
          Object.hasOwnProperty.call(this.chartData, imageName) &&
          !this.$store.getters.isFilteredOut(
            this.$store.getters.isFilteredOut(
              this.chartData[imageName],
              this.stickID
            )
          ) {
            opacity = 0.2
          }
          const timestamp = this.chartData[imageName].dateTime
          const snowHeight = this.chartData[imageName].sticks[this.stickID]
            .snowHeight
          const type = this.stickType(imageName)
          if (type.type === 'cross') {
            this.drawCross(context, timestamp, snowHeight, x, y, type.color)
            this.drawCross(
              context,
              timestamp,
              snowHeight,
              x,
              y,
              type.color,
              opacity
            )
          }
          if (type.type === 'point') {
            this.drawPoint(context, timestamp, snowHeight, x, y, type.color)
            this.drawPoint(
              context,
              timestamp,
              snowHeight,
              x,
              y,
              type.color,
              opacity
            )
          }
        }
      }
@@ -556,7 +575,7 @@ export default {
      // Stick not found
      if (!stick.visible || image.weatherConditions === 0) {
        result.type = 'point'
        result.color = '#aaaaaa'
        result.color = '#d1b8b6'
        result.opacity = 1
        return result
      }
@@ -569,7 +588,7 @@ export default {
      // Custom user tag
    },

    drawPoint(context, timestamp, snowHeight, x, y, color) {
    drawPoint(context, timestamp, snowHeight, x, y, color, opacity) {
      // context: Canvas context, used for drawing into canvas.
      // timestamp: (x axis) string, containing standard time format.
      // snowHeight: (y axis) number.
@@ -582,6 +601,7 @@ export default {
        const py = Math.floor(y(snowHeight))

        context.beginPath()
        context.globalAlpha = opacity || 1
        context.fillStyle = color || '#555555'
        context.strokeStyle = color || '#555555'
        context.lineWidth = this.datapointLineWidth
@@ -589,7 +609,7 @@ export default {
        context.fill()
      }
    },
    drawCross(context, timestamp, snowHeight, x, y, color) {
    drawCross(context, timestamp, snowHeight, x, y, color, opacity) {
      // context: Canvas context, used for drawing into canvas.
      // timestamp: (x axis) string, containing standard time format.
      // snowHeight: (y axis) number.
@@ -601,10 +621,11 @@ export default {
      if (px >= 0 && px <= this.width) {
        const py = Math.floor(y(snowHeight))

        context.beginPath()
        context.strokeStyle = color || '#555555'
        context.globalAlpha = opacity || 1
        context.lineWidth = this.datapointLineWidth * 2
        context.lineCap = 'round'
        context.beginPath()
        context.moveTo(px - this.datapointRadius, py - this.datapointRadius)
        context.lineTo(px + this.datapointRadius, py + this.datapointRadius)
        context.moveTo(px - this.datapointRadius, py + this.datapointRadius)
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ export default {
      // Stick not found
      if (!stick.visible || image.weatherConditions === 0) {
        result.type = 'point'
        result.color = '#aaaaaa'
        result.color = '#d1b8b6'
        result.opacity = 1
        return result
      }